6 Replies Latest reply on Aug 3, 2008 7:28 PM by john_ferguson

    How to debug TVF calibre deck


      TVF calibre deck line number is diffrent from reported by calibre if any bug in that line . How trace it with calibre deck

        • 1. Re: How to debug TVF calibre deck


          If you encounter an SVRF syntax error, you can trace the line number in the TVF code by noting the line number reported by the SVRF compiler and using the tvf::set_traceback_line command. For example, assume this error is reported by the SVRF compiler:



          ERROR: Error INP3 on line 52 of rules.tvf



          You add this line to your TVF code:



          tvf::set_traceback_line 52; # force trace at line 52



          This instructs the Tcl preprocessor to issue an error message when the output line number is equal to 52. When you run Calibre again on the TVF file that contains this command, the TVF line number is reported as shown here:



          ERROR: Error TVF1 on line 79 of rules.tvf - TVF preprocessor error: Traceback forced at SVRF output line number 52



          This tells you the error is on line 79 of the TVF file.



          1 of 1 people found this helpful
          • 2. Re: How to debug TVF calibre deck

            Once you've debugged a few TVF rule files, this can become easier. It required some finesse to figure out this line number discrepency thing before the 2007.4 release. Anyone who's coded a little TVF has run into this issue where Calibre may report out a discrepency on a line number...say 312 but the TVF rule file may only have 45 lines total.


            Perplexing? Yes, but if you think about what's happening, it makes sense. If I have a do-nothing rule file named tvf.rules that contains (Notice the intentional error in the COPY command)




            tvf::VERBATIM {

            LAYOUT PATH "TOP.gds"

            LAYOUT PRIMARY "TOP"


            DRC RESULTS DATABASE "out.rdb" ASCII



            set layers { 1 2 3 4 5 6 7 8 9 0 }

            foreach L $layers


            foreach L $layers



            And I run Calibre 2007.3 or earlier from the command line : calibre -drc -tvf.rules





            Calibre compiles the TVF rules into SVRF on the fly...and finds no Tcl or TVF related errors, then as the DRC job starts, the compiler finds an SVRF violation and reports a syntax error on line 33. The problem is that my TVF rules are only 20 lines long. To debug this with 2007.3 or earlier, you simply need to convert the TVF rules file to SVRF and go to line 33 (below)


            To convert TVF rules to SVRF, use the -E option : calibre -E svrf.rules tvfrules



            LAYER lay0 0

            COPY_1 {

            @ Copy of layer 1

            COP  Y lay1



            If you are using Calibre version 2007.4 or newer, the error will be reported on line 15 of the tvf.rules file. Line 15 is the beginning of the foreach loop that generates my COPY rulechecks.


            foreach L $layers {


            Hope that helps.



            • 3. Re: How to debug TVF calibre deck


              By the way, for anyone new to Tcl and/or TVF, there is a course available that introduces basic Tcl concepts and TVF rule coding. You can check here for the schedule and complete description : Calibre TVF Course





              Key Topics

              • Review of Tcl Syntax and Concepts

              • Using Runtime Calibre TVF

              • Using Compile Time Calibre TVF

              • Writing Compile Time TVF SVRF code

              • Writing Runtime TVF SVRF code


              • 4. Re: How to debug TVF calibre deck


                We are implementing a new debugging feature in Calibre that utilizes the RAM TCL debugger.  With this debugger, you can load a TVF rule file.  It will show any TCL issues immediately.  Then you can click on procedures to expand them to their SVRF.



                As this moves forward it will be integrated with the Calibre YieldServer TCL as well.  If you are not familiar with this, Calibre can create a DFM database.  It will contain all derivations from all rules run.  With RVE you can browse the results from using the Yield Server TCL API.  This allows you to easily debug SVRF and immediately see the results, not just for checks but for all derivations.



                Together, this approach will allow someone editing or debugging a rule file to open a high-level TCL deck that calls SVRF macros from a library.  You put stops into the code to break at suggested spots during execution, examine the expanded SVRF created, and see the results to that point.



                It is a little ways out still.  Likely released at the end of the year.  It is available now in a limited beta format.  Contact me if you are interested in more detail or would like to try it.









                • 5. Re: How to debug TVF calibre deck


                  Hi John,



                  I develop tvf deck for DFM analisys and ofthen I debug tcl and svrf error. At this time I use calibre 2007.3 for debug error, because this version report correct error line number and call stack back trace. I am interested to try this new debugging feature. 









                  • 6. Re: How to debug TVF calibre deck

                    Hello Dominico,

                    Our beta for the TCL debugger begins with 2008.3, which is not quite out the door yet, but will be shortly.  I'm sure we'd love to have your beta feedback.  Since your contact info is private, the best way to procede is for you to contact me directly.  You can reach me in the office at (503) 685-0446, or drop me an email at john_ferguson@mentor.com.  From there, we'll need to get a beta agreement signed and then get you the beta software and documentation.