#!/usr/bin/perl $FILEIN = shift(@ARGV); $FILEOUT = shift(@ARGV); if (defined($FILEIN) && defined($FILEOUT)) { print("command: OpenALF.lib2alf.pl $FILEIN $FILEOUT\n\n"); } else { die("usage: OpenALF.lib2alf.pl \n"); } $ALF_Debug = shift(@ARGV); # print out messages $ALF_InstallDir = "../source"; ### step 1: import data, use lexical parser require "$ALF_InstallDir/OpenALF.littlehelper.pl"; require "$ALF_InstallDir/OpenALF.parseLex.pl"; require "$ALF_InstallDir/IEEE1603_2003.clause6.pl"; &FileIn($FILEIN,'ALF_ReadLexical'); ### step 2: analyze syntax, create object-oriented database require "$ALF_InstallDir/OpenALF.global.pl"; require "$ALF_InstallDir/OpenALF.parseLiberty.pl"; require "$ALF_InstallDir/OpenALF.compileLiberty.pl"; &ALF_CreateLibertyData('test'); ### step 3: access liberty data for application purpose, for example: require "$ALF_InstallDir/OpenALF.compileALF.pl"; require "$ALF_InstallDir/OpenALF.simpleApplications.pl"; &ALF_DumpDatabase if $ALF_Debug; &ALF_ReportLibertyLibraryContents('test'); ### step 4: create alf view in database require "$ALF_InstallDir/OpenALF.logic.pl"; require "$ALF_InstallDir/OpenALF.timing.pl"; require "$ALF_InstallDir/OpenALF.mapLiberty2ALF.pl"; require "$ALF_InstallDir/OpenALF.ecsm2ALF.pl"; $ALF_LibertyGlobal = "\42../standard/OpenALF.LibertyGlobal.alf\42"; $ALF_LibertyScaling = "\42../standard/OpenALF.LibertyScaling.alf\42"; &ALF_LibertyData2ALF('test'); ### step 5: check database contents: &ALF_DumpDatabase if $ALF_Debug; &ALF_ReportALFLibraryContents('test',1); ### step 6: export data require "$ALF_InstallDir/OpenALF.printALF.pl"; $AutoFirstLine = "// "; # 1st line in output file will be preceded by "// " &FileOut($FILEOUT,'ALF_Export','ALF','test'); 1;