SKILL code to get mapped net name

Discussion in 'Cadence' started by no4reply, Dec 16, 2004.

  1. no4reply

    no4reply Guest

    I have a question for skill coding, hope my formal colleagues can help
    me out here.

    I want to print out the artist simulation data from all pins of a cell
    to a file. Let's the say the cell has a pin "clk", in the testbench, it
    may be called "clk100". I can manually change the singal name, but
    there are 200 of them.

    Can I use skill to go through the pins of this cell, find all
    corresponding net name in the sim database.

    Thanks,
    Jack
     
    no4reply, Dec 16, 2004
    #1
  2. no4reply

    S. Badel Guest

    it shouldn't be very difficult, but it's not very clear to me what you
    want to do. if I understand it, you have a testbench with many instances
    of the same cell, whose pins are connected to nets with the same name,
    followed by a number (clk1-clk200 f.e.). you want to print out the
    (what? dc operating point ?) for each of these nets.

    if you know for sure that the pins are clk1-clk200 for ex. and you want
    to print them all you do

    file=outfile("filename")
    netnum = 1
    netname = "clk"
    while( netnum<=200
    /* make up net name */
    net = sprintf( "%s%d" netname netnum )
    /* retrieve data, i'm assuming you want operating point */
    voltage = getData( netname ?result 'dcOp )
    /* print out */
    fprintf(file "%L\t%L" netname voltage)
    netnum = netnum + 1
    ) ; netnum
    close(file)

    however if you assume your pins are connected to random net names, and
    you still want to print them all you can go through the testbench
    schematic, locate all instances, find out which net the pins are
    connected to and print them
    (i'm assuming there are no iterated instances, it would require a
    specific treatment )

    file=outfile("filename")
    sch = dbOpenCellViewByType( "myLib" "testbench" "schematic" nil "r" )

    /* search the instances */
    instances = setof( x sch~>instances x~>cellName=="myCell" )

    /* traverse the list of instances */
    foreach( inst instances

    /* print inst name */
    fprintf(file "instance %s\n" inst~>name)

    /* traverse all the pin connections */
    foreach( term inst~>instTerms
    net = term~>net~>name
    fprintf(file "pin=%L net=%L v=%L\n\n" term~>name net getData( net
    ?result 'dcOp ))
    ) ; foreach
    ) ; foreach

    dbClose(sch)
    close("filename")

    hope this helps,
    stéphane
     
    S. Badel, Dec 17, 2004
    #2
  3. no4reply

    no4reply Guest

    It helped! Thanks a lot.

    J
     
    no4reply, Dec 17, 2004
    #3
  4. no4reply

    no4reply Guest

    It helped! Thanks a lot.

    J
     
    no4reply, Dec 17, 2004
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.