• 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. Change color/width of selected net via SKILL code

Stats

  • Locked Locked
  • Replies 9
  • Subscribers 143
  • Views 5405
  • 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

Change color/width of selected net via SKILL code

LuisGutierrez
LuisGutierrez over 7 years ago

Hi all,

I'm working with multi voltage designs and I would like to use color/width coding in the wires of the schematic to illustrate low,medium and high voltage domains. The idea is to change the width and color of a selected net (not only the wire segment) with via a hotkey after having selected it with a mouse click. Essentially it would be something as highlighting a net but instead of temporarily changing its properties, do it permanently.

Has anybody done this successfully?

Regards,

  • Cancel
  • skillUser
    skillUser over 7 years ago

    Hi Luis,

    I just tried the following and it seemed to work:

    foreach(mapcar obj geGetSelectedSet() when(obj~>objType=="line" schSetWireColor(obj "green")))

    for setting the selected wire segment(s) to be 'green' in color.

    There is also a function schGetWireColor(). For the line thickness there is schSetWireLineStyle(), so combining this also:

    foreach(mapcar obj geGetSelectedSet() when(obj~>objType=="line" schSetWireColor(obj "green") schSetWireLineStyle(obj "thickLine")))

    Hopefully this is what you are looking for? You should be able to see the color names when manually setting the wire color. For thicknesses, the default is "solid", thicker is "thickLine2" and thickest is "thickLine" I think.

    Regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • LuisGutierrez
    LuisGutierrez over 7 years ago in reply to skillUser

    Hi Lawrence,

    Thank you for your reply. This is certainly going in the right direction. However, this command would only change the color of the selected wire segment. My idea is to change the color of the entire net, -which is composed of several wire segments- when selecting only one of such wire segments.

    I wonder if there is an environment variable such as schSetNetColor (or something similar) that allows the intended behavior. Ultimately the idea is to bind this behavior and the thickness modification to a key.

    Regards,

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 7 years ago in reply to LuisGutierrez

    Hi Luis,

    You can modify the code so that the first (arbitrarily) object in the selected set is used to find the net and then find the figures on that net, then for each figure that is a line ("wire segment") it has the properties changed for that segment:

    foreach(mapcar obj car(geGetSelectedSet())~>net~>figs
    when(obj~>objType=="line"
    schSetWireColor(obj "green")
    schSetWireLineStyle(obj "thickLine")
    ); when
    ); foreach

    Best regards,

    Lawrence.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to skillUser

    I should also point out (me being Mr. Pedantic) that the mapcar keyword is unnecessary here because you're not using the return value of the foreach. It actually costs more (a little) to collect the list of return values when using foreach mapcar, so unless you need the return values, there's little point in doing this. An ordinary foreach would suffice here.

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 7 years ago in reply to Andrew Beckett

    Very true. I used the mapcar during development/testing to check the return values of the function inside the loop, but left it in. Sometimes I wrap the foreach(mapcar ... with a "forall" to gain the overall return value. Thank you for noticing that I'd left it in, it could cause confusion...

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • LuisGutierrez
    LuisGutierrez over 7 years ago in reply to skillUser

    Thank you Lawrence!

    Works like a charm.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ssram
    ssram over 7 years ago in reply to skillUser

    But, how do i remove these coloring to get the default?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 7 years ago in reply to ssram

    Choose "cadetBlue" for the color and "solid" for the lineStyle.

    
    foreach(obj car(geGetSelectedSet())~>net~>figs
      when(obj~>objType=="line"
        schSetWireColor(obj "cadetBlue")
        schSetWireLineStyle(obj "solid")
      ); when
    ); foreach
    

    Regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to skillUser

    Lawrence's suggestion does reset the color and line style overrides on the wire (i.e. it removes the info in the database with the override) provided that the color and line style match the info for the packet used for the wire. So strictly speaking you should do:

    packetName=techGetLPPacketName(techGetLP(tf list("wire" "drawing")))
    defaultLineStyle=nth(3 drGetPacket("display" packetName))
    defaultColor=nth(5 drGetPacket("display" packetName))

    Then in Lawrence's code you could do:

    schSetWireColor(obj defaultColor)
    schSetWireLineStyle(obj defaultLineStyle)

    Regards,

    Andrew.

    • 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