Disembodied list and data retrieve

Discussion in 'Cadence' started by JDole, Jan 17, 2008.

  1. JDole

    JDole Guest

    Hello all,

    Sorry if this question has been asked before. I have the following
    SKILL function and I noticed that evaluating CMD1 and CMD2 retrieves
    different info from list1 and list2. The difference between the two list
    is that list1 is formed using '( ) operator while list2 list("....")
    function. Appreciate any help from more knowledgeable coder. Thanks.




    ======================== CUT HERE ====================
    procedure(proc1( )

    let((list1 list2 cmd1 cmd2 item1 item2)

    list1 = '(nil CELL pmos PINNAME g LAYER metal1 PURPOSES drawing)
    list2 = list(nil "CELL" "pmos" "PINNAME" "g" "LAYER"
    "metal1" "PURPOSES" "drawing")

    printf("LIST1: %L\n", list1);
    ;; prints ----> (nil CELL pmos PINNAME g LAYER metal1
    PURPOSES drawing)

    printf("LIST2: %L\n", list2);

    ;; prints ----> (nil "CELL" "pmos" "PINNAME" "g" "LAYER"
    "metal1" "PURPOSES" "drawing")


    cmd1 = strcat("list1" "->" "LAYER");
    item1 = evalstring(cmd1);

    cmd2 = strcat("list2" "->" "LAYER");
    item2 = evalstring(cmd2);

    printf("CMD1= %s ITEM1: %L\n", cmd1 item1);
    ; prints -----> "metal1" <---- THIS IS DIFFERENT

    printf("CMD2= %s ITEM2: %L\n", cmd2 item2);
    ; prints -----> "nil" <---- THIS IS DIFFERENT
    );
    );
     
    JDole, Jan 17, 2008
    #1
  2. JDole

    S. Badel Guest

    list1 = '(nil CELL pmos PINNAME g LAYER metal1 PURPOSES drawing)
    It appears that in disembodied property lists, the name of a property (name/value pair) must be a
    symbol, not a string.

    So list2 should rather look like

    list2 = list(nil 'CELL "pmos" 'PINNAME "g" 'LAYER "metal1" 'PURPOSES "drawing")
    This is awkward, for you can simply do

    item1 = list1->LAYER

    Or, equivalently

    item1 = get(list1 'LAYER)
    item1 = getq(list1 LAYER)

    prop = 'LAYER
    item1 = get(list1 prop)

    etc..

    There's however an important difference between list1 and list2 : list2 will be reinitialized each
    time the function is called, while list1 will keep its value. See this post for details
    http://groups.google.ch/group/comp.cad.cadence/browse_frm/thread/3161f757fe0532fa/0eda6695ce937c29


    Stéphane
     
    S. Badel, Jan 17, 2008
    #2
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.