• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Error encountered during pcell instantiation??

Stats

  • Locked Locked
  • Replies 24
  • Subscribers 143
  • Views 21277
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Error encountered during pcell instantiation??

Messi
Messi over 14 years ago
 Hai,

     

    This is the code i have written to read a file and then instantiate a pcell inside an already created pcell:

procedure(mypcell(ruleFile pcellInfo)

  let( (ruleFileTable purposeList mastercv inst )

  ruleFileTable  =  readFile( ruleFile )

;readFile is the function name for another procedure I created to read an file and drop its contents into a table

           foreach(line FileTable

           purposeList = caddr(line)

    ;the table has mainly four elements and I want the third element based on which instantiation has to be carried out

          unless(rexMatchp(pcellinfo purposeList)

           case(pcellinfo

             ("a"

         ;;To Create PCell for “a”

                    mastercv   = dbOpenCellViewByType("test" "pcell" "layout" "" "w")

                  ;mastercv is an already created pcell

                    inst           = dbCreateParamInst(

                                         "pcell" mastercv "a" list(0 0) "R0" 1

                                           list(

                                               list( "w"  "float" 0.5)

                                                )

                                                );dbCreateParamInst

                                         dbClose(mastercv)

                                      ); for case “a”

           ("b"

;;To Create PCell for "b"                   

                     mastercv   = dbOpenCellViewByType("test" "pcell" "layout" "" "w")

                     inst           =  dbCreateParamInst(

                                        "pcell" mastercv "b" list(0 0) "R0" 2

                                           list(

                                                list( "w"  "float" 0.5)

                                                list( "s"  "float" 0.25)

                                                )

                                            );dbCreateParamInst

                                          dbClose(mastercv)

                                          );case

                                   );for case  "b"               

                           );unless

        );foreach

    );let

);procedure

But i am generating errors while i run this code :

Can anyone look into and this find the error in it.....

Thanks,

  Messi
  • Cancel
  • Messi
    Messi over 14 years ago

    Hai,

       Purpose of my code is the same as i mentioned earlier that is i read a specific rule file then tabulate it,then based on the purpose mentioned in the tabular form,i create a new pcell.

    Eg: if i have pcell at "lib1" "cell1" "layout"  as my master cellview.and my ruletable says poly width i am trying to create another pcell with cellview name as "ruleno.(R1A)".this created cellview should be instantiated into the master cellview.

    If rule says spoly spacing(R1B).It creates another cellview named "R1B" and now the master pcell should have two instances of "R1B".

    Am i heading to my purpose through this code??or whatever i have coded is wrong?? I am saving the cellviews using dbSave(cvd)...

     

    Regards,

    Messi

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 14 years ago

    Hi Messi,

    Perhaps you don't mean "pcell" when  you say "pcell"? It sounds as if you are writing some code which is building some layout cellViews based on your tabular file. These don't appear to be pcells, but just conventional cellViews. Each of these conventional cellViews has an instance of the mastercv cellView.

    This seems to be the opposite of what you're describing, so I'm definitely confused!

    Regards,

    Andrew. 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Messi
    Messi over 14 years ago

    Hai,

      yes,first  i would like to make layout cellviews with name of rule no.then make pcell inside each of these cellviews.Then instantiate in master.I thought first i will create cellviews for each case and do instantiation and save the code.

     After this is done i can make pcells for each of the cellviews right?? ie by

      pcDefinePCell( list(ddGetObj("lib1") "R1A" "layout"

      ......................................

     )

     

    Regards,

    Messi

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 14 years ago

    Hi Messi,

    Sorry, I don't understand. I can't see how you can create all the cellViews and then make them pcells. If you call pcDefinePCell for the same lib/cell/view as an existing cellView, it will overwrite it and replace it with whatever parameterized code you have within the pcDefinePCell body.

    So either what you're trying to do doesn't make sense, or (quite possibly) I have completely failed to understand what you're trying to do. You might want to try describing it at a very high level in pseudo-code to make it clearer.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Messi
    Messi over 14 years ago

    Hai,

       maybe as you told it doesnt make sense..Ok let me make pcells for each rule no. cases and then come back to you...

    anyways thanks,

      Messi

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Messi
    Messi over 14 years ago

    hai,

      As you mentioned maybe the code and requirement may not make sense.anyway will make pcells for each rule case and get back to you...

    Thanks once again,

    Regards,

    Messi

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Messi
    Messi over 14 years ago

    Hai,

      let me put my requirement properly,

    1.Create a pcell based on type given in rule file(this is done) at location "lib1" "pcell" "layout"

    2.Now i have created cellviews with names as rule no.s,inside each of this cellviews i want to instantiate instances of the already created pcell.

    ie.if my rule file matches "width" then i want to take instance from my created pcell at "lib1" "pcell" "layout".My rule file looks like

       ;RULE NO.  LAYER      TYPE       VALUE
    R1A                POLY     WIDTH     0.5
    R1B                POLY      SPACE   0.25
    R2A               ACTIVE    WIDTH     0.7
    R2B               ACTIVE    SPACE    0.3

     I have coded to make it into tabular form.Now i want the new cellview say named "R1A" contain instance from my pcell with parameters taken from rule file.

    The code is like,

          procedure(instPcell(ruleFile libName @rest pcellInfo)
      let( (ruleTable  mastercv cv)
        ruleTable = parseFile(ruleFile)
        mastercv  = dbOpenCellViewByType(nthelem(1 pcellInfo) nthelem(2  pcellInfo)
                       nthelem(3 pcellInfo) "" "r")
        foreach(i ruleTable~>?
         cv   = dbOpenCellViewByType(libName i "layout" "maskLayout" "w")
          cond(
             (rexMatchp("[wW][iI][dD][tT][hH]" nth(1 ruleTable[i]))       
                dbCreateParamInst(
           cv mastercv i list(0 0) "R0" 1
                   list(
                      list( "w1"      "float"  nth(2 ruleTable[i]))
                      list( "layer1"  "string" nth(0 ruleTable[i]))
                      list( "type"    "string" nth(1 ruleTable[i]))
                  ))
       )
      (rexMatchp("[sS][pP][aA][cC][eE]" nth(1 ruleTable[i]))  
         dbCreateParamInst(
           cv mastercv i list(0 0) "R0" 2
         list( list(  "w1"     "float"                       ?  )  (here i want to give poly width as given in rule table)
               list( "space"   "string"     nth(2 ruleTable[i]))
               list( "layer2"  "string"      nth(0 ruleTable[i]))
               list( "type"    "string"      nth(1 ruleTable[i]))
        ));dbCreateParamIns
        )
      (t (println "Arg is an unknown type"))
       );cond
     dbSave(cv)
     dbClose(cv)
          );foreach
       dbClose(mastercv)
      );let
    );procedure

    My error that i want to clear is shown in bold letters..How can give that value??

     

    Regards,

    Messi

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Messi
    Messi over 14 years ago

    Hai,

      when i run i get the error dbCreateParamInst: invalid float "0.7"

      how to remove this??

    Regards,

    Messi

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 14 years ago
    Hi Messi,

    The problem is that you've parsed each line in your rule file to be a list of strings, and so you're passing a string where a float is expected.

    Use the function cdfParseFloatString or atof to convert it to a float when calling dbCreateParamInst. cdfParseFloatString has the benefit of handling suffixes like "k" and "u". So:

         dbCreateParamInst(
           cv mastercv i list(0 0) "R0" 2
         list( list(  "w1"     "float"                     cdfParseFloatString(nth(2 ruleTable[i])))))

    Note your code still has the unnecessary ruleTable~>? in the foreach loop.

    Another thing you might want to consider to make the code more readable is that rather than using rexMatchp, you could do:

           case(upperCase(nth(1 ruleTable[i]))
             ("WIDTH"       
                dbCreateParamInst(
           cv mastercv i list(0 0) "R0" 1
                   list(
                      list( "w1"      "float"  cdfParseFloatString(nth(2 ruleTable[i])))
                      list( "layer1"  "string" nth(0 ruleTable[i]))
                      list( "type"    "string" nth(1 ruleTable[i]))
                  ))
       )

      ("SPACE"  
       dbCreateParamInst(
           cv mastercv i list(0 0) "R0" 2
    ...

    In fact better still would be to do:

    ruleData=ruleTable[i]

    At the beginning (within) the foreach loop, so you don't have to keep looking up the entry in the hash.

    Regards,

    Andrew
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Messi
    Messi over 14 years ago

    Hai Andrew,

        I have eliminated the error as you suggested.Thanks.But i couldnt figure out how to give width value for my second condition.(i have mentioned it in bold along with code).

    I want to check all conditions ie both upeer and lower case by using [wW] [iI] ...etc...So that even if i modify rule file and run i need not change my code...

    Regards,

    Messi

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
<>

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information