• 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. schSetWireColor(wireId color) in IC5141 ?

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 870
  • 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

schSetWireColor(wireId color) in IC5141 ?

marbs
marbs over 10 years ago

Hi All,

What is the equivalent function of  "schSetWireColor(wireId  color)" in IC5141 ?

I want to change the selected wires color in the schematic.

I have the code below, it is working well in IC616 but not in IC5141 .

How can I make it to work in IC5141 ?

procedure(wc(color)
 wireId = css()
 counter = 0
 b = geGetSelSet()


 counter = 0
 cv = geGetSelSet()
 foreach(a cv= geGetSelSet()
    counter = counter +1
    layer = a~>layerNum
    printf("\nlayer = %d " layer)
    schSetWireColor(a color)
    
 ) ; foreach

Thanks in advance.

Best Regards,

Marben

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    Marben,

    This function was new in IC616; prior to that there was no API for setting wire colors.

    I did write this solution a few years back:

    which explains how to delete the wire colors in schematic by removing the data structures used to store them, but it doesn't cover creating them in the first place. Some reverse engineering of the data structures could allow you to implement this in IC5141 potentially but I've not written anything to do that. If I have a moment, I'll put something together...
    Regards,
    Andrew.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • marbs
    marbs over 10 years ago

    Hi Andrew,

    Thank you very much for your reply.

    Best Regards,

    Marben

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

    Marben,

    During a SKILL training course, I wrote this - hopefully this will help:

    /* abSetWireColor.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       May 13, 2015 
    Modified   
    By         
    
    Two functions which should work in releases prior to IC616
    to get and set the wire color on wires in the schematic.
    
    abSetWireColor(wireObject "red")
    abGetWireColor(wireObject) => "red"
    
    You also need to call hiRedraw() to redraw the window so that
    the changes can be seen.
    
    Note, this relies on the internal structure of how the wire
    color data is stored; however, the functions are written such
    that they will use schGetWireColor and schSetWireColor if they are
    available, so the code should be future-proof.
    
    The code only tries to set solid linestyles - so it assumes that
    you have solid linestyle defined in your display.drf. I did not
    try to make the code provide a schSetWireLineStyle equivalent
    in the interests of simplicity.
    
    ***************************************************
    
    SCCS Info: @(#) abSetWireColor.il 05/13/15.15:31:33 1.1
    
    */
    
    /***************************************************************
    *                                                              *
    *                   abGetWireColor(wire "d")                   *
    *                                                              *
    *             Return the color of a piece of wire              *
    *                                                              *
    ***************************************************************/
    
    procedure(abGetWireColor(wire "d")
        if(isCallable('schGetWireColor) then
            schGetWireColor(wire)
        else
            let((colorGroup parsed tf packet)
                ;------------------------------------------------------------
                ; Find a color group with the right name which is
                ; associated with the wire, and is also a member of
                ; the root group for color information
                ;------------------------------------------------------------
                colorGroup=car(exists(group wire~>groupMembers~>group
                    rexMatchp("^sch_" group~>name) &&
                    exists(mainGroup group~>groupMembers~>group
                        mainGroup~>name=="schDisplayPacketsGroup"
                    )
                ))
                if(colorGroup then
                    parsed=parseString(colorGroup~>name "_")
                    cadr(parsed)
                ;------------------------------------------------------------
                ; Default is to get the color from the wire drawing LPP packet
                ;------------------------------------------------------------
                else
                    tf=techGetTechFile(wire~>cellView)
                    packet=techGetLPPacketName(techGetLP(tf list("wire" "drawing")))
                    nth(5 drGetPacket("display" packet))
                )
            )
        )
    )
    
    /***************************************************************
    *                                                              *
    *                abGetExistingColorGroup(wire)                 *
    *                                                              *
    *  Utility function to get the group associated with the wire  *
    *          which is related to the color information           *
    *                                                              *
    ***************************************************************/
    
    procedure(abGetExistingColorGroup(wire)
        car(exists(group wire~>groupMembers~>group
            rexMatchp("^sch_" group~>name) &&
            exists(mainGroup group~>groupMembers~>group
                mainGroup~>name=="schDisplayPacketsGroup"
            )
        ))
    )
    
    /***************************************************************
    *                                                              *
    *               abSetWireColor(wire color "dt")                *
    *                                                              *
    *                   Set the color on a wire.                   *
    *                                                              *
    ***************************************************************/
    
    procedure(abSetWireColor(wire color "dt")
        if(isCallable('schSetWireColor) then
            schSetWireColor(wire color)
        else
            if(drGetColor("display" color) then
                let((groupName currentGroup currentColor (add t) cv
                        mainGroup)
                    ;--------------------------------------------------------
                    ; If the wire already has color information, either
                    ; delete the object from the current color group,
                    ; or leave it as is (add=nil)
                    ;--------------------------------------------------------
                    currentGroup=abGetExistingColorGroup(wire)
                    when(currentGroup
                        currentColor=cadr(parseString(currentGroup~>name))
                        if(currentColor==color then
                            add=nil
                        else
                            dbDeleteObjectFromGroup(wire currentGroup)
                        )
                    )
                    when(add
                        cv=wire~>cellView
                        ;----------------------------------------------------
                        ; Either find the existing group for the color
                        ; requested, or create it
                        ;----------------------------------------------------
                        sprintf(groupName "sch_%s_solid_solid" color)
                        currentGroup=car(
                            exists(group cv~>groups group~>name==groupName))
                        unless(currentGroup
                            currentGroup=dbCreateGroup(cv groupName 
                                list("deleteLast" "collection" "unordered" 
                                    "uniqueName")
                            )
                        )
                        ;----------------------------------------------------
                        ; Add the wire to the color group
                        ;----------------------------------------------------
                        dbAddObjectToGroup(currentGroup wire)
                        ;----------------------------------------------------
                        ; Now see if the root group exists, and if not create
                        ; it
                        ;----------------------------------------------------
                        unless(exists(group currentGroup~>groupMembers~>group
                            group~>name=="schDisplayPacketsGroup")
                            mainGroup=car(
                                exists(group cv~>groups 
                                    group~>name=="schDisplayPacketsGroup"))
                            unless(mainGroup
                                mainGroup=dbCreateGroup(cv "schDisplayPacketsGroup"
                                    list("deleteLast" "collection" "unordered" 
                                        "uniqueName")
                                )
                            )
                            ;------------------------------------------------
                            ; Add the color group to the root group
                            ;------------------------------------------------
                            dbAddObjectToGroup(mainGroup currentGroup)
                        )
                        t
                    )
                )
            else
                warn("Color %L for display \"display\" was not found" color)
            )
        )
    )
    
    
    • 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