EDA365电子工程师网

标题: 谁能写个比较器的SKILL。 [打印本页]

作者: wolf343105    时间: 2010-7-9 09:31
标题: 谁能写个比较器的SKILL。
比如:比较上版BRD与下版BRD的NET变化,零件变化。测试点变化,等等。
作者: azhe2006    时间: 2010-7-11 15:05
帮顶
作者: neky    时间: 2010-7-13 10:04
顶顶顶顶顶
作者: ginooolu    时间: 2010-7-13 13:13
本帖最后由 ginooolu 于 2010-7-15 11:41 编辑

夹错文件,请至六楼下载


初學skill,請大家多多指教。
作者: mingzhesong    时间: 2010-7-13 14:50
楼上的字看不懂噢,我从小没文化,哎。。。
作者: ginooolu    时间: 2010-7-13 15:46

跟五楼道歉一下,因为用繁体输入的关系。上面的文字是:

前阵子在下写的比较程序,如果有兴趣可以试用看看,也请帮忙提供意见及抓错。
比对项目不多,仅包含组件,连接点,及拉线。ETCH shape也想检查,可是不知道怎么写。
但程序写得不好,比对过程颇费时,实际测试一片主板约花3~10分钟。
不知大家平常还用甚么方法做比较呢?

附檔:DccrptCN.zip;包含说明,主程序及窗体文件。 解压密码:dccrpt
[attach]29683[/attach]


初学skill,请大家多多指教。


作者: happywzb    时间: 2010-7-13 16:46

作者: wolf343105    时间: 2010-7-14 15:49
(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
作者: wolf343105    时间: 2010-7-15 11:19
解压缩后为三个文件,Dccrpt.doc,DCCRPT.form,rulerpt.ile。怎么和你所说的

加载程序:
1.        将DCCRPT.form档案拷贝到 cadence程序主目录下的\share\pcb\text\forms。
2.        将dccrpt.il档案拷贝到 home folder 的\pcbenv目录内。
3.        用文书软件编辑Allero.ilinit (home folder 的\pcbenv目录内),加入load(“dccrpt.ile” “skill”)
4.        完成后重开Allegro增加以下指令dcc
不对呀????????
作者: ginooolu    时间: 2010-7-15 12:21
再道歉一次,四楼夹错档案,请至六楼下载
作者: menghunabc    时间: 2010-12-10 11:37
用不了
作者: evel    时间: 2010-12-14 01:53
小弟前天也写了个,需要给我邮件evel.evel@gmail.com。等改进好了寄给大伙用。
[attach]34358[/attach]

作者: zhouqingmin    时间: 2011-5-2 20:10
好东东
作者: lmh    时间: 2012-3-29 11:46
学习




欢迎光临 EDA365电子工程师网 (https://bbs.elecnest.cn/) Powered by Discuz! X3.2