• 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. Automatically reverse bus order in schematic

Stats

  • Locked Locked
  • Replies 8
  • Subscribers 142
  • Views 8075
  • 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

Automatically reverse bus order in schematic

FormerMember
FormerMember over 4 years ago

Hello,

when I import a netlist into a schematic and enable the automatic bus merging, the order is always ascending, even though the schematic options are set to descending. It seems there is no option, to alter this behaviour.

At the moment, I always have to manually select the pins in the generated schematic and change the bus order, which also updates all nets.

My idea is, to use a skill script to automatically do this. However, when I access the terminal object and try to just change the name, I get an error "Terminal with name ... already exists". This also does not take care of the labes and wire names. I already found an old answer from Andrew -> https://community.cadence.com/cadence_technology_forums/f/custom-ic-skill/12896/how-to-programtically-rename-a-selected-pin but this does not seem to be completely what I need.

Best regards

Paul

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 4 years ago

    Paul,

    What kind of netlist are you importing, and which IC sub-version are you using? Just so that I can focus my attention in the right place...

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • FormerMember
    FormerMember over 4 years ago in reply to Andrew Beckett

    Its the same circuits I mentioned here -> https://community.cadence.com/cadence_technology_forums/f/custom-ic-design/47255/spicein-fails-for-existing-symbol-with-bus-pins

    I have a Spice netlist with bus pins, which I want to import into an existing cell. Since the import does not work directly, I import it into a dummy cell and want to copy the schematic to the actual cell. However, because the bus order and pin directions are wrong, I have to manually edit the schematic every time.

    The virtuoso version I use is ICADVM20.1-65b.500.17 (it should be fairly recent)

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to FormerMember

    Paul,

    There does appear to have been one request for control over the order, but it was voided because the customer decided they didn't need it after all. So you might want to request control over the order via customer support.

    This code (I think) should do the job (at least from my very simple testing):

    procedure(CCFreverseBusOrder(@key (cv geGetEditCellView()) (check t) save)
        let((busPattern)
            busPattern=pcreCompile("^(\\w*)<(\\d+):(\\d+)>$")
            ;----------------------------------------------------------------
            ; First wire labels
            ; Note this is not attempting to rename buses which are part of
            ; a bundle
            ;----------------------------------------------------------------
            foreach(shape cv~>shapes
                when(shape~>objType=="label" && shape~>layerName=="wire" &&
                        pcreExecute(busPattern shape~>theLabel)
                    shape~>theLabel=pcreSubstitute(busPattern "\\1<\\3:\\2>")
                )
            )
            ;----------------------------------------------------------------
            ; Then the terminals
            ;----------------------------------------------------------------
            foreach(term cv~>terminals
                when(pcreExecute(busPattern term~>name)
                    ;--------------------------------------------------------
                    ; Slightly messy approach - can't directly rename the terminal
                    ; as it complains about existing terminal, so temporarily add
                    ; a dummy prefix and then rename back again
                    ;--------------------------------------------------------
                    term~>name=pcreSubstitute(busPattern "_RbODuMMy\\1<\\2:\\3>")
                    term~>name=pcreSubstitute(busPattern "\\1<\\3:\\2>")
                )
            )
            when(check
                schCheck(cv)
            )
            when(save
                dbSave(cv)
            )
            t
        )
    )
    

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • FormerMember
    FormerMember over 4 years ago in reply to Andrew Beckett

    Thank you, this works well for me. I modified it slightly to also take care of the pin direction. It seems, you already solved every problem at some point in the past Slight smile

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to FormerMember
    Unknown said:
    It seems, you already solved every problem at some point in the past

    If only! I wrote the code yesterday (didn't take long) in response to this. I also ended up filing two CCRs:

    2498066 Merge BusBits produces incorrect schematic with square bracket as delimiter
    2498083 SPICEIN with Merge BusBits fails if symbol already exists

    (the second one was the issue you mentioned in your previous post - I didn't see one filed, so I thought I'd do it whilst I had the test case ready).

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RK56
    RK56 over 4 years ago in reply to Andrew Beckett

    Hi Andrew,

    Whatever you write on the fly like this one, are they part of any skill code library in support site? I know there is a skill code library in support site but do these code snippets get added over there? Any plan of doing so?

    It would be useful

    Thanks

    -Ramakrishnan

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to RK56

    Hi Ramakrishna,

    Sometimes I do create articles for code I post here - but it's additional effort and I don't always have time to put together a full description and publish it as an article. Specifically adding into the "SKILL Library" is not something I typically do (I must admit I don't know who owns that these days), although I do typically get any articles I write related to calculator functions added into the SKILL calculator functions library (as that process is something I am aware of).

    Since support.cadence.com also searches the community, it's not necessarily a requirement to specifically publish an article. For example, if you use the  "All Content" search and search for CCFreverseBusOrder then it will find this thread...

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to RK56

    Hi Ramakrishna,

    Sometimes I do create articles for code I post here - but it's additional effort and I don't always have time to put together a full description and publish it as an article. Specifically adding into the "SKILL Library" is not something I typically do (I must admit I don't know who owns that these days), although I do typically get any articles I write related to calculator functions added into the SKILL calculator functions library (as that process is something I am aware of).

    Since support.cadence.com also searches the community, it's not necessarily a requirement to specifically publish an article. For example, if you use the  "All Content" search and search for CCFreverseBusOrder then it will find this thread...

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • RK56
    RK56 over 4 years ago in reply to Andrew Beckett

    Hi Andrew,

    I understand. Thank you.

    -Ramakrishnan

    • 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