|
(defun Compare_List_Builder ()
;############################
;### Define the variables ###
;############################
Design=axlDBGetDesign() ; This represents the current design
Function_List=nil ; This list stores all the function designators
Function_Name=nil ; This holds the working function designator
Device_Name=nil ; This holds the working Device Name
;Value=nil ; This will hold the working Value (not currently available)
;Tolerance=nil ; This will hold the working Tolerance (not currently available)
Ref_Des=nil ; This holds the working Reference Designator
Pin_Number=nil ; This holds the working Pin Number
Pin_Use=nil ; This holds the working Pin Use code
Net_Name=nil ; This holds the working Net Name
Pin_Use_Prop_Set=nil ; This is used to override the function->pinuse definition
Compare_List_File=nil ; This holds the name of the output file
;### Open the output file and read in the data fields ###
Compare_List_File=outfile("./Compare_List_File" "w")
;### Get each component contained in the design ###
(foreach Component Design->components
Function_List=cons(Component->functions Function_List)
); end foreach Component Design->components
;### Get each Function defined for each component in the design ###
(foreach Function Function_List
Function_Name=car(Function)->name
Device_Name=car(Function)->type
Ref_Des=car(Function)->parent->name
;### Get each pin for each function for each component in the design ###
(foreach Pin car(Function)->pins
Pin_Number=Pin->pin->number
Pin_Use=Pin->use
Net_Name=Pin->pin->net->name
;### Check if the pinuse property is set, it overrides the function->pinuse ###
(foreach Prop Pin->pin->prop->??
(if Pin_Use_Prop_Set == "yes" then
Pin_Use=Prop
); end if Pin_Use_Prop_Set == "yes"
(if Prop="PINUSE" then
Pin_Use_Prop_Set="yes"
); end if Prop="PINUSE"
); end foreach Prop Pin->pin->prop->??
;### This if substitutes Not_Connected for blank net names ###
(if Net_Name == "" then Net_Name="Not_Connected")
;### Write the data to the output file ###
fprintf(Compare_List_File "%s %s %s %s %s %s\n"
Function_Name Ref_Des Device_Name Pin_Number Pin_Use Net_Name)
); end foreach Pin Function->pin
); end foreach Function Function_List
close(Compare_List_File)
;### Sort the file and add the end of file (EOF) marker ###
shell("sort -n +0.3 Compare_List_File > CompareListFile.txt;
echo \"EOF\" >> CompareListFile.txt;
rm Compare_List_File")
); end defun Compare_List_Builder
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun Compare_Logic_Changes_And_Renames ()
;############################
;### Define the variables ###
;############################
Report=nil ; This holds the output file name
String_Pre=nil ; This holds the current string of data from the pre-change comparision list
String_Post=nil ; This holds the current string of data from the post-change comparision list
Comparing=nil ; This specifies if all changes are captured
Function_Name_Pre=nil ; This holds the current function designator from the pre-change list
Function_Name_Post=nil ; This holds the current function designator from the post-change list
Delete_List=nil ; This holds all pins/functions deleted from the post-change design
Function_Name_Pre_Last=nil ; This holds the previous records function designator
Function_Name_Pre_Current=nil ; This holds the current records function designator
Ref_Des_Pre=nil ; This holds current record reference designator from the pre-change list
Ref_Des_Post=nil ; This holds current record reference designator from the post-change list
Device_Name_Pre=nil ; This holds current record device name from the pre-change list
Device_Name_Post=nil ; This holds current record device name from the post-change list
Pin_Number_Pre=nil ; This holds current record pin number from the pre-change list
Pin_Number_Post=nil ; This holds current record pin number from the post-change list
Pin_Use_Pre=nil ; This holds current record pin use code from the pre-change list
Pin_Use_Post=nil ; This holds current record pin use code from the post-change list
Net_Name_Pre=nil ; This holds current record net name from the pre-change list
Net_Name_Post=nil ; This holds current record net name from the post-change list
Function_Name_Post_Current=nil ; This holds the current records function designator
Function_Name_Post_Last=nil ; This This holds the previous records function designator
Modify_List=nil ; This holds all pins/functions changed in the post-change design
Add_Mode=nil ; This specifies if all additions have been captured
Add_List=nil ; This holds all pins/functions added to the post-change design
;########################################################
;### Open the output file and read in the data fields ###
;########################################################
Pre_Change_List=infile("./CompareListFilePreChange.txt")
Post_Change_List=infile("./CompareListFile.txt")
Report=outfile("./DeleteModifyAdd.rpt" "w")
fprintf(Report "\n\n\t\t************ 3rd Party Netin ************\n")
fprintf(Report "\t\t******* Back Annotation TO-DO List ******\n")
fprintf(Report "\t\t*****************************************\n")
fprintf(Report "\n\t\tPre-Change Design = %s.brd\n" getShellEnvVar("CHK_BRD"))
fprintf(Report "\t\tPost-Change Design = %s.brd\n" getShellEnvVar("NEW_BRD"))
fprintf(Report "\n\t\t%s\n" getCurrentTime())
fprintf(Report "\n\n\t\t************* Modifications *************\n\n")
String_Pre=parseString(gets(S Pre_Change_List))
String_Post=parseString(gets(S Post_Change_List))
;### Start the comparison loop ###
(while Comparing != "finished"
;### This if check for the end of file record in the pre-change list ###
(if car(String_Pre) != "EOF" then
Function_Name_Pre=car(String_Pre)
Function_Name_Post=car(String_Post)
;### This if compares the FuncDes, if their differant the Function_Name_Pre was deleted ###
(if Function_Name_Pre != Function_Name_Post then
Delete_List=cons(String_Pre Delete_List)
Function_Name_Pre_Last=Function_Name_Pre
;### This if eliminates multiple entries of the same RefDes in the deletion section ###
(if Function_Name_Pre_Last != Function_Name_Pre_Current then
fprintf(Report "\n\t*** Delete function %s, Ref %s\n"
Function_Name_Pre car(cdr(String_Pre)))
); end if Function_Name_Pre_Last != Function_Name_Pre_Current
String_Pre=parseString(gets(S Pre_Change_List)) ; get the next pre-change record
Function_Name_Pre=car(String_Pre)
Function_Name_Pre_Current=Function_Name_Pre
else
;### This if checks for differances between the pre and post designs ###
(if String_Pre != String_Post then
Function_Name_Post=car(String_Post)
Ref_Des_Pre=car(cdr(String_Pre))
Ref_Des_Post=car(cdr(String_Post))
Device_Name_Pre=car(cdr(cdr(String_Pre)))
Device_Name_Post=car(cdr(cdr(String_Post)))
Pin_Number_Pre=car(cdr(cdr(cdr(String_Pre))))
Pin_Number_Post=car(cdr(cdr(cdr(String_Post))))
Pin_Use_Pre=car(cdr(cdr(cdr(cdr(String_Pre)))))
Pin_Use_Post=car(cdr(cdr(cdr(cdr(String_Post)))))
Net_Name_Pre=car(cdr(cdr(cdr(cdr(cdr(String_Pre))))))
Net_Name_Post=car(cdr(cdr(cdr(cdr(cdr(String_Post))))))
Function_Name_Post_Current=Function_Name_Post
;### This if eliminates multiple entries of RefDes and DeviceName ###
(if Function_Name_Post_Last != Function_Name_Post_Current then
fprintf(Report "\n\t*** Modify Function %s: Refdes=%s, Device=%s ***\n"
Function_Name_Post Ref_Des_Pre Device_Name_Pre)
;### This if compares the RefDes ###
(if Ref_Des_Pre != Ref_Des_Post then
fprintf(Report "\tRefdes was=%s, is=%s\n" Ref_Des_Pre Ref_Des_Post)
); end if Ref_Des_Pre != Ref_Des_Post
;### This if compares the RefDes ###
(if Device_Name_Pre != Device_Name_Post then
fprintf(Report "\tDevice was=%s, is=%s\n" Device_Name_Pre Device_Name_Post)
); end if Device_Name_Pre != Device_Name_Post
); end if Function_Name_Post_Last != Function_Name_Post_Current
;### This if compares the RefDes ###
(if Pin_Number_Pre != Pin_Number_Post then
fprintf(Report "\tPin was=%s, is=%s\n" Pin_Number_Pre Pin_Number_Post)
); end if Pin_Number_Pre != Pin_Number_Post
;### This if compares the RefDes ###
(if Pin_Use_Pre != Pin_Use_Post then
fprintf(Report "\tNew pin %s; Use was=%s, is=%s\n"
Pin_Number_Post Pin_Use_Pre Pin_Use_Post)
); end if Pin_Use_Pre != Pin_Use_Post
;### This if compares the RefDes ###
(if Net_Name_Pre != Net_Name_Post then
fprintf(Report "\tNew pin %s; Net was=%s, is=%s\n"
Pin_Number_Post Net_Name_Pre Net_Name_Post)
); end if Net_Name_Pre != Net_Name_Post
Modify_List=cons(String_Post Modify_List)
Function_Name_Post_Last=Function_Name_Post_Current
String_Pre=parseString(gets(S Pre_Change_List))
String_Post=parseString(gets(S Post_Change_List))
;### This if checks for the end of file record in the pre-change list ###
(if car(String_Pre) == "EOF" then
Modify_Mode="finished"
); if car(String_Post) != "EOF"
else
String_Pre=parseString(gets(S Pre_Change_List))
String_Post=parseString(gets(S Post_Change_List))
;### This if checks for the end of file record in the pre-change list ###
(if car(String_Pre) == "EOF" then
Modify_Mode="finished"
); if car(String_Post) != "EOF"
); end if String_Pre != String_Post
); end if Function_Name_Pre != Function_Name_Post
else
;##########################################
;### Start the additions recording loop ###
;##########################################
fprintf(Report "\n\n\t\t************* Additions *************\n")
(while Add_Mode != "finished"
;### This if checks for the end of file record in the post-change list ###
(if car(String_Post) != "EOF" then
Function_Name_Post=car(String_Post)
Function_Name_Post_Current=Function_Name_Post
Ref_Des_Post=car(cdr(String_Post))
Device_Name_Post=car(cdr(cdr(String_Post)))
Pin_Number_Post=car(cdr(cdr(cdr(String_Post))))
Pin_Use_Post=car(cdr(cdr(cdr(cdr(String_Post)))))
Net_Name_Post=car(cdr(cdr(cdr(cdr(cdr(String_Post))))))
;### This if eliminates duplicate ref des entries in the additions section ###
(if Function_Name_Post_Current != Function_Name_Post_Last then
fprintf(Report "\n\t*** Add Function %s: Refdes=%s, Device=%s ***\n"
Function_Name_Post Ref_Des_Post Device_Name_Post)
); end if Function_Name_Post_Current != Function_Name_Post_Last
fprintf(Report "\tPin=%s, Use=%s, Net=%s\n" Pin_Number_Post Pin_Use_Post Net_Name_Post)
Function_Name_Post_Last=Function_Name_Post_Current
Add_List=cons(String_Post Add_List)
String_Post=parseString(gets(S Post_Change_List))
else
Add_Mode="finished"
Comparing="finished"
); end if car(String_Post) != "EOF"
); end while Add_Mode != "finished"
); end if car(String_Pre) != "EOF"
); end while Comparing != "finished"
close(Report)
); end defun Compare_Logic_Changes_And_Renames |
|