• 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. How to instantiate Pcell with different cell name?

Stats

  • Replies 5
  • Subscribers 143
  • Views 74
  • Members are here 0

How to instantiate Pcell with different cell name?

Yuto Lau
Yuto Lau 7 hours ago

Hi,

I tried to use the pcell "bussetp.il" introduced from link https://support.cadence.com/apex/ArticleAttachmentPortal?id=a1Od0000000nX1lEAE&pageName=ArticleContent. It can convert decimal input to binary output bus with defined analog voltage.

However, when I instantiated this cell multiple times in the same test bench but with different "buswidth" setting (e.g. one is with buswidth of 3 the other is with buswidth of 8). The simulation was terminated with error message as below

"ERROR (SFE-3): "netlist" 388: Cannot create subcircuit definition `bussetp' because a subcircuit with the same name has already been defined in line `365' of `netlist'. Either rename the existing subcircuit definition or remove the previous subcircuit definition, and rerun the simulation."

I found that in the netlist, cell "bussetp" was defined twice, with the same cell name and subckt name, but the netlist were different. One is with 3 pairs of vcvs, the other is with 8 pairs of vcvs as shown below.

How can I modify the SKILL script so that simulator will assign different cell name to the pcells with different configuration? Or please point me to the material about that.

Thanks and regards,

Yutao

Below is the netlist showing the pcell is defined twice but with different netlist content.

// Library name: tb_nsf
// Cell name: bussetp
// View name: schematic
subckt bussetp bus\<7\> bus\<6\> bus\<5\> bus\<4\> bus\<3\> bus\<2\> \
bus\<1\> bus\<0\> hi lo 0
parameters busvalue=0
vlo7 (mid7 0 lo 0) vcvs gain=1-((busvalue&128)>>7)
vhi7 (bus\<7\> mid7 hi 0) vcvs gain=(busvalue&128)>>7
vlo6 (mid6 0 lo 0) vcvs gain=1-((busvalue&64)>>6)
vhi6 (bus\<6\> mid6 hi 0) vcvs gain=(busvalue&64)>>6
vlo5 (mid5 0 lo 0) vcvs gain=1-((busvalue&32)>>5)
vhi5 (bus\<5\> mid5 hi 0) vcvs gain=(busvalue&32)>>5
vlo4 (mid4 0 lo 0) vcvs gain=1-((busvalue&16)>>4)
vhi4 (bus\<4\> mid4 hi 0) vcvs gain=(busvalue&16)>>4
vlo3 (mid3 0 lo 0) vcvs gain=1-((busvalue&8)>>3)
vhi3 (bus\<3\> mid3 hi 0) vcvs gain=(busvalue&8)>>3
vlo2 (mid2 0 lo 0) vcvs gain=1-((busvalue&4)>>2)
vhi2 (bus\<2\> mid2 hi 0) vcvs gain=(busvalue&4)>>2
vlo1 (mid1 0 lo 0) vcvs gain=1-((busvalue&2)>>1)
vhi1 (bus\<1\> mid1 hi 0) vcvs gain=(busvalue&2)>>1
vlo0 (mid0 0 lo 0) vcvs gain=1-((busvalue&1)>>0)
vhi0 (bus\<0\> mid0 hi 0) vcvs gain=(busvalue&1)>>0
ends bussetp
// End of subcircuit definition.

// Library name: tb_nsf
// Cell name: bussetp
// View name: schematic
subckt bussetp bus\<2\> bus\<1\> bus\<0\> hi lo 0
parameters busvalue=0
vlo2 (mid2 0 lo 0) vcvs gain=1-((busvalue&4)>>2)
vhi2 (bus\<2\> mid2 hi 0) vcvs gain=(busvalue&4)>>2
vlo1 (mid1 0 lo 0) vcvs gain=1-((busvalue&2)>>1)
vhi1 (bus\<1\> mid1 hi 0) vcvs gain=(busvalue&2)>>1
vlo0 (mid0 0 lo 0) vcvs gain=1-((busvalue&1)>>0)
vhi0 (bus\<0\> mid0 hi 0) vcvs gain=(busvalue&1)>>0
ends bussetp
// End of subcircuit definition.

  • Sign in to reply
  • Cancel
  • Andrew Beckett
    Andrew Beckett 4 hours ago

    That shouldn't happen (the article was written by me, by the way). The spectre netlister should produce a unique suffix for each variant. It should look like this:

    // Library name: mylib
    // Cell name: bussetp
    // View name: schematic
    subckt bussetp_pcell_0 bus\<2\> bus\<1\> bus\<0\> hi lo
    parameters busvalue=0
        vlo2 (mid2 0 lo 0) vcvs gain=1-((busvalue&4)>>2)
        vhi2 (bus\<2\> mid2 hi 0) vcvs gain=(busvalue&4)>>2
        vlo1 (mid1 0 lo 0) vcvs gain=1-((busvalue&2)>>1)
        vhi1 (bus\<1\> mid1 hi 0) vcvs gain=(busvalue&2)>>1
        vlo0 (mid0 0 lo 0) vcvs gain=1-((busvalue&1)>>0)
        vhi0 (bus\<0\> mid0 hi 0) vcvs gain=(busvalue&1)>>0
    ends bussetp_pcell_0
    // End of subcircuit definition.
    
    // Library name: mylib
    // Cell name: bussetp
    // View name: schematic
    subckt bussetp_pcell_1 bus\<7\> bus\<6\> bus\<5\> bus\<4\> bus\<3\> \
            bus\<2\> bus\<1\> bus\<0\> hi lo
    parameters busvalue=0
        vlo7 (mid7 0 lo 0) vcvs gain=1-((busvalue&128)>>7)
        vhi7 (bus\<7\> mid7 hi 0) vcvs gain=(busvalue&128)>>7
        vlo6 (mid6 0 lo 0) vcvs gain=1-((busvalue&64)>>6)
        vhi6 (bus\<6\> mid6 hi 0) vcvs gain=(busvalue&64)>>6
        vlo5 (mid5 0 lo 0) vcvs gain=1-((busvalue&32)>>5)
        vhi5 (bus\<5\> mid5 hi 0) vcvs gain=(busvalue&32)>>5
        vlo4 (mid4 0 lo 0) vcvs gain=1-((busvalue&16)>>4)
        vhi4 (bus\<4\> mid4 hi 0) vcvs gain=(busvalue&16)>>4
        vlo3 (mid3 0 lo 0) vcvs gain=1-((busvalue&8)>>3)
        vhi3 (bus\<3\> mid3 hi 0) vcvs gain=(busvalue&8)>>3
        vlo2 (mid2 0 lo 0) vcvs gain=1-((busvalue&4)>>2)
        vhi2 (bus\<2\> mid2 hi 0) vcvs gain=(busvalue&4)>>2
        vlo1 (mid1 0 lo 0) vcvs gain=1-((busvalue&2)>>1)
        vhi1 (bus\<1\> mid1 hi 0) vcvs gain=(busvalue&2)>>1
        vlo0 (mid0 0 lo 0) vcvs gain=1-((busvalue&1)>>0)
        vhi0 (bus\<0\> mid0 hi 0) vcvs gain=(busvalue&1)>>0
    ends bussetp_pcell_1
    // End of subcircuit definition.

    Note the different subckt names.

    Have you got a custom nlSetPcellName function in your environment? Try getd('nlSetPcellName) to see if that returns non-nil (you could also try pp(nlSetPcellName) to pretty-print it). I'm wondering whether the default behaviour has been overridden.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Yuto Lau
    Yuto Lau 3 hours ago in reply to Andrew Beckett

    Hi Andrew,

    Really appreciate your replay and suggestion. 

    After putting "getd('nlSetPcellName)" into CIW, it returns "funobj:nlSetPcellName". I don't quite understand this return result.

    After putting "pp(nlSetPcellName)", it returns  SKILL script for "procedure(nlSetPcellName(cv paramNames paramValues)" and "nil" at the end.

    Also, the version I am using is IC23.1-64b.ISR15.37 for your infomation.

    Regards,

    Yutao

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Andrew Beckett
    Andrew Beckett 3 hours ago in reply to Yuto Lau

    Yutao,

    That means that somebody has defined a custom function which prevents the unique naming of different variants (this is what happens if it returns nil). That's incorrect. 

    You should find out who defined that in your environment - it's a custom addition.

    You could add this at the end of the .cdsinit to disable it (this undefines the function):

    putd('nlSetPcellName nil)

    However, it's probably wise to find the definition of the function (which is presumably loaded from a .cdsinit or libInit.il file) and remove that incorrect definition of the function. If the function isn't defined, you would get the default unique naming per variant as I showed in my example above.

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Yuto Lau
    Yuto Lau 2 hours ago in reply to Andrew Beckett

    Hi Andrew,

    Thanks for your explanation.

    I attach the detail script below, which returns after inputting "pp(nlSetPcellName)" in CIW.

    procedure(nlSetPcellName(cv paramNames paramValues)
    let((name value
    (pcell_suffix "")
    )
    foreach((name value) paramNames paramValues
    when((name == "variant")
    (pcell_suffix = strcat(pcell_suffix "_"
    lowerCase(value)
    ))
    )
    )
    strcat((cv->cellName) pcell_suffix)
    )
    )

    After netlisting the test bench, above script grows to cover analog_cell, mcap etc, I am afraid it is generated by the PDK.

    I will talk with AE and see how to deal with it.

    Regards,

    Yutao

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Yuto Lau
    Yuto Lau 45 minutes ago in reply to Yuto Lau

    Hi Andrew,

    Just some follow-up.

    I find nlSetPcellName function is used in a simrc file provided from PDK. I am not sure if I can remove that.

    I added "putd('nlSetPcellName nil)" in .cdsini file in my home directory. But it does NOT work.

    Thanks and regards,

    Yutao

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • 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