The program was designed to compare pairs of .AAX .AA .BA or .BAX files, using other formats may result in runtime errors. Possible combinations: AAX<->AAX; AAX<->AA; AA<->AA; BAX<->BAX; BA<->BAX; BA<->BA
Code files can be from different source, i.e. can have one extracted from FCB and the other from ONB.
program automatically detects BA/BAX/AA/AAX files
if database or code is splitted in several files they will be combined together.
Comparison performed by blocks to block, not line to line
The program try to read and compare numeric constants as numbers, i.e. D=2.3e-3 and D=0.0023 are the same and will not be detected as differnce
If xls report file name ends with _DIF it means, descrepancies has found. XLS reports generated by GenXLSreport(code_before,code_after)
Requirements for people who are using source code instead of compiled version
- use Python3.
- ampla.py is a core file contains all functions for parsing and code compare.
- External packages requirements: tkinter, xlwt, datetime
python example to compare .AA and .AAX files shown below:
from ampla import *
aa_before = AA('source_code_before.aa')
aa_after = AAX('source_code_after.aax')
print(aa_before.compare(aa_after))
GenXLSreport('source_code_before.aa','source_code_after.aax')
block Constructor, create logic block instance,parent for dbinst Pins: contain logic block pins (dictionary keys) and values Name: logic block name: MOVE,OR,AND,.. in case of BAX element used to keep instance type: DIC,AIC.. Address (unique): logic block address: PC12.1.1.2 in case of BAX element used to keep instance name: Extra: the logic block parameters: MOVE(B,16) in case of BAX element can keep type of DAT: DAT4 (I) AAX Constructor, create AAX file instance, parse AMPL logic Blocks: contains all logic blocks from AAX file fName: full path to AMPL aax file including file name Lines: text lines from AMPL file Header: AMPL code header Labels: all labels with addresses in the AMPL code AA inherit from AAX read (decode) AA file to self.Lines parse AMPL logic BAX inherit from AAX read (decode) BAX file to self.Lines parse AMPL logic BA inherit from BAX read (decode) BA file to self.Lines parse AMPL logic