Home > Community > Forums > Custom IC Design > Automatic schematic generation using SKILL

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Automatic schematic generation using SKILL 

Last post Mon, Oct 7 2013 11:33 AM by dmay. 10 replies.
Started by shamore 16 Jul 2012 08:45 AM. Topic has 10 replies and 4701 views
Page 1 of 1 (11 items)
Sort Posts:
  • Mon, Jul 16 2012 8:45 AM

    • shamore
    • Not Ranked
    • Joined on Mon, Jul 16 2012
    • Posts 4
    • Points 80
    Automatic schematic generation using SKILL Reply

    Hello,

    I am currently using Cadence version IC6.1.5.500.8. I am a regular user of Virtuoso Schematic Editor. However I don't have any experience related to automation in Schematic editor.

    I am currently designing an IC that has around 15 - 20 IO Pads. Between each of these Pad's and internal logic (input or output) port, series of buffers (50-200) needs to be placed. I have the information related to the number of buffers corresponding to each Pad in an excels sheet. Doing this work manually is very boring and also tiring?

    Would you kindly advice if its possible to automate the placement of buffers in the schematic between two signals based on the information provided via text file or .xls file.

    Thanks and Best Regards,

    Shailesh 

    • Post Points: 35
  • Tue, Jul 17 2012 7:54 AM

    • dmay
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • Allen, TX
    • Posts 393
    • Points 7,415
    Re: Automatic schematic generation using SKILL Reply

    Yes, this can be done. You need to first write some Skill code to read the text file using code like the following:

    ;Assume the txt file is a csv (comma separated values) dumped from an Excel spreadsheet looking like this:
    ;portName,numBuffers

    txtFileName="/tmp/my.csv"
    /*
    The text file for this example looks like this:
    port1,10
    port2,5
    port3,6
    */
    procedure(myReadCsv(txtFileName)
      let((portTable filePtr lineData line)
        portTable = makeTable("portTable" nil)
        filePtr = infile(txtFileName)
        while(gets(line filePtr)
            lineData = parseString(line ",")
            portTable[car(lineData)] = evalstring(cadr(lineData))
        )
        close(filePtr)
        portTable
      ) ;let
    ) ;proc

    procedure(myBuildBufferSchematic(txtFileName)
      let((portTable cv x y dx inPinId outPinId buffId wireId bufInst bufWidth )
        cv = geGetEditCellView()
        portTable = myReadCsv(txtFileName)
        x = y = 0
        dx = 5.0
        inPinId = dbOpenCellViewByType("basic" "ipin" "symbol")
        outPinId = dbOpenCellViewByType("basic" "opin" "symbol")
        buffId = dbOpenCellViewByType("myLib" "myBuf" "symbol")
        foreach(port portTable
            schCreatePin(cv inPinId port "input" nil x:y "R0")
            for(i 1 portTable[port]
                wireId=schCreateWire(cv "draw" "full" list(x:y x+dx:y) 0.05 0.05 0.0)
                bufInst = dbCreateInst(cv buffId nil x+dx:y "R0")
                bufWidth = abs(rightEdge(bufInst~>bBox) - leftEdge(bufInst~>bBox))
                ;Subtract 0.05 so the wire overlaps the instance pin (adjust as needed for your buffer)
                x = x + dx + bufWidth - 0.05
            )
            wireId=schCreateWire(cv "draw" "full" list(x:y x+dx:y) 0.05 0.05 0.0)
            schCreatePin(cv outPinId strcat(port "_out") "output" nil x+dx:y "R0")
            y=y+1
            x=0
        )
        printf("Finished\n")
      ) ;let
    ) ;proc

    ;lbl = schCreateWireLabel(cv car(wireId) x:y+0.05 labelName "lowerCenter" "R0"  "stick" 0.05 nil)

    Your needs will certainly vary from what I've provided, but here are some things to note:

    1. Paste the above in a file like with a .il extension.
    2. Modify the code to specify your text file name (use the sample lines so you can see what this does) 
    3. Modify the line that sets buffId to provide your buffer library and cell name
    4. If your input and output pins are not basic ipin and opin, then update inPinId and outPinId
    5. Open an empty schematic in edit mode
    6. Load your Skill file in your CIW: load("mySkillFileName.il")
    7. Run: myBuildBufferSchematic(txtFileName)
    8. Look at the results. You can use "undo" to get your empty schematic back. Edit the skill, and try again.

    I didn't name the wires between the buffers, but if you need to you can use the schCreateWireLabel command shown above.

    Derek

    • Post Points: 20
  • Tue, Jul 17 2012 7:56 AM

    • berndf
    • Top 150 Contributor
    • Joined on Tue, Aug 25 2009
    • Landshut, Bavaria
    • Posts 54
    • Points 840
    Re: Automatic schematic generation using SKILL Reply

     Generally this is possible.
    - Output a csv file form Excel.
    - Read it in with SKILL file IO commands.
    - Post processes in SKILL
    - Do a schematic placement with db* commands e.g. dbCreateInst

    Bernd

     

    • Post Points: 20
  • Tue, Jul 17 2012 9:04 AM

    • shamore
    • Not Ranked
    • Joined on Mon, Jul 16 2012
    • Posts 4
    • Points 80
    Re: Automatic schematic generation using SKILL Reply

    Thanks Derek for your detailed reply and also the sample script. That's very helpful.

    I followed all the steps that you have mentioned above. 

    1. So first I created a sample csv file (myfile.csv) with following data:

    port1,10
    port2,5
    port3,6

    In CIW I entered

    txtFileName="/home/myDir/myfile.csv"

    The copied your SKILL script to a .il file (build_buffer.il) and added the buffer library and cell name.

    Then in CIW I did

    load("/home/myDir/build_buffer.il)

    myBuildBufferSchematic(txtFileName)

    ----------------------------------------------------------------------- 

    However I am getting an error: 

    *Error* evalstring: argument #1 should be a string (type template = "ts") - nil

    Is it something to do with "portTable[car(lineData)] = evalstring(cadr(lineData)) ", since the buffer numbers in the txt file are not strings??

    Best Regards,

    Shailesh

    • Post Points: 20
  • Tue, Jul 17 2012 9:12 AM

    • dmay
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • Allen, TX
    • Posts 393
    • Points 7,415
    Re: Automatic schematic generation using SKILL Reply

    I'm guessing there is probably a blank line in the text file. The evalstring is going to convert the string to a number when it stores it in the table. Make sure there are no trailing blank lines in the file.

    You could error check for that this way:
        while(gets(line filePtr)
            lineData = parseString(line ",")
            when(length(lineData)==2
                portTable[car(lineData)] = evalstring(cadr(lineData))
            )
        )

    Also, if you are going to write Skill, the following commands will give you even more detail when your Skill fails:
    sstatus( stacktraceDump t )
    sstatus( stacktrace 8 )
    sstatus(traceArgs t)

    Derek

    • Post Points: 35
  • Wed, Jul 18 2012 1:39 AM

    • shamore
    • Not Ranked
    • Joined on Mon, Jul 16 2012
    • Posts 4
    • Points 80
    Re: Automatic schematic generation using SKILL Reply

    Thanks again Derek. You were right, there were trailing blank lines in my text file.

    Now the script runs perfectly.

    Also thanks for the tips related to debugging.

    That was indeed very helpful !

    Best Regards,

    Shailesh 

     

     

    • Post Points: 5
  • Wed, Jul 18 2012 1:40 AM

    • shamore
    • Not Ranked
    • Joined on Mon, Jul 16 2012
    • Posts 4
    • Points 80
    Re: Automatic schematic generation using SKILL Reply

    Thanks Bernd for the inputs !

    BR,

    Shailesh 

     

    • Post Points: 20
  • Sun, Oct 6 2013 8:20 PM

    • Skill User
    • Not Ranked
    • Joined on Tue, Jul 16 2013
    • Bangalore, Karnataka
    • Posts 15
    • Points 255
    Re: Automatic schematic generation using SKILL Reply

     Thanks Derek for this information. Actually I am also trying to do same thing. But to add on this, this is possible to read any text file and fetch information to build any schematic.

    Please let me know is this also possible to fetch the information from schematic using skill and load in some text file? Information is like no. of wires, no. of components, no. of pins in schematic etc.

      Regards

    Varun

    • Post Points: 20
  • Sun, Oct 6 2013 10:48 PM

    • Skill User
    • Not Ranked
    • Joined on Tue, Jul 16 2013
    • Bangalore, Karnataka
    • Posts 15
    • Points 255
    Re: Automatic schematic generation using SKILL Reply

     or instead of storing any information in text file, can we also store in some model like UML diagram?

    Regards

    Varun

    • Post Points: 5
  • Mon, Oct 7 2013 8:58 AM

    Re: Automatic schematic generation using SKILL Reply

    Really? Your question seems to be to do the opposite - to extract some (vaguely described) information from the schematic and write it to a text file, not the other way around.

    Also, the forum guidelines ask you not to append to old threads, especially if asking different or only loosely related questions. You can always reference an old thread in a new one if you want to point people to threads that you think might be relevant.

    Kindest Regards,

    Andrew.

    • Post Points: 20
  • Mon, Oct 7 2013 11:33 AM

    • dmay
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • Allen, TX
    • Posts 393
    • Points 7,415
    Re: Automatic schematic generation using SKILL Reply

    Perhaps dbWriteSkill will do what he wants.

    dbWriteSkill(
    d_cellViewId
    t_fileName
    t_mode
    t_release
    [ g_conn ] db
    [ g_ref ]
    [ g_lppString ]
     )
         => t / nil

    Creates a file that contains all the SKILL commands needed to recreate a cellview, so that the design can be recreated in the current or previous release by loading the file in the current or previous release, respectively.

    Open a cellview and run this:
    dbWriteSkill(geGetEditCellView() "/tmp/mycell.il" "w" "6.1")

    This will write out a skill file of all the contents of the cellview. The Skill file could be used to recreate the cellview if that is what is desired.

    Derek

    • Post Points: 5
Page 1 of 1 (11 items)
Sort Posts:
Started by shamore at 16 Jul 2012 08:45 AM. Topic has 10 replies.