• 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 Design
  3. Defining waveform thicknesses and colors on a white background...

Stats

  • Locked Locked
  • Replies 16
  • Subscribers 127
  • Views 25324
  • 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

Defining waveform thicknesses and colors on a white background in VIVA

CADcasualty
CADcasualty over 7 years ago

I'm trying to make viva look good using a white background and the default colors are kind of lousy (in my opinion). I read in the manual:

----------------------------------------------------

viva.graph colorBank string "default"

You can use this variable to customize the set of trace colors in a Virtuoso Visualization and Analysis XL session. The default value of this environment variable is the default color bank that is specified in the display.drf file.

Note: This variable does not change the colors defined in the display.drf file. Also, when you plot simulation results from ADE, the color bank from the display.drf file is honored.

The color names should be separated by a comma, a semicolon, or a space. The color name can be a list of colors defined in the SVG color keyword, such as steelblue, azzure, or the RGB hexadecimal value of the color in the #RRGGBB format.

viva.graph colorBank string "red; blue; green; yellow"

viva.graph colorBank string "#ff0000, #0000ff, #008000, #ffff00"

----------------------------------------------------

So I tried putting:

envSetVal("viva.graph" "colorBank" 'string "red blue green yellow")

into my .cdsinit but nothing about the waveform colors changed. Note that I have other viva related stuff in my .cdsinit that does produce changes in viva so I know that all works. I also note that the documentation says "when you plot simulation results from ADE, the color bank from the display.drf file is honored" which strikes me as a bit confusing i.e. even though I define the colorBank in .cdsinit does the display.drf file still take precedence? I did take a look at the display.drf file and couldn't figure out where/what the color bank was.

Regarding the waveform thicknesses, I find "fine" to be too thin and "medium" to be too thick (and obviously all the rest of the options just waay too thick). Is there a way to hack a file (maybe display.drf) where I can monkey with line thicknesses?

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to CADcasualty

    Well, you could just use drGetColor("display" "blue") to retrieve the data, So something like:

    (defun abDisplayColorToHex (colorName @optional (display "display"))
      (let (color)
        (setq color (drGetColor display colorName))
        (if color
          (sprintf nil "0x%02x%02x%02x" (nth 2 color) (nth 3 color) (nth 4 color))
          (abColorNameToHex colorName)
        )
      )
    )

    Regards,

    Andrew.

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

    Thanks once again! Your routine works like a charm. I did try to pass it a list (which abColorNameToHex can accept) but it didn't work. I took a stab at modifying abDisplayColorToHex to accept a list based on what I saw in abColorNameToHex but I confess the programming language just confuses me too much. Would you mind please?...

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

    I put them both in the same file and defined them in a similar fashion:

    /* abColorNameToHex.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Jul 02, 2018 
    Modified   Jul 10, 2018 
    By         A.D.Beckett
    
    Convert friendly color (or colour!) names to RGB hex strings
    as suitable for passing to awvPlotWaveform. Invalid color names
    result in string when gets handled as black (or white) when plotting in
    ViVA.
    
    abColorNameToHex("pink") => "0xffc0cb"
    abColorNameToHex(list("yellow" "purple" "lightgreen")) => 
        ("0xffff00" "0xa020f0" "0x90ee90")
    
    Also provides abDisplayColorToHex which first looks for color
    names in the display.drf and if not found, uses abColorNameToHex.
    This also supports both a single color and a list of colors.
    
    Uses SKILL++ methods just to avoid having a case statement!
    
    ***************************************************
    
    SCCS Info: @(#) abColorNameToHex.il 07/10/18.17:25:52 1.2
    
    */
    
    (defmethod abColorNameToHex ((colorName string))
      (strcat "0x"
              (buildString
                (mapcar 
                  (lambda (intensity) 
                    (sprintf nil "%02x" (round (times intensity 0.255))))
                  (nameToColor colorName)
                  )
                ""
                )))
    
    (defmethod abColorNameToHex ((colorNames list))
      (mapcar 'abColorNameToHex colorNames)
      )
    
    (defmethod abDisplayColorToHex 
      ((colorName string) @optional (display "display"))
      (let (color)
        (setq color (drGetColor display colorName))
        (if color
          (sprintf nil "0x%02x%02x%02x" (nth 2 color) (nth 3 color) (nth 4 color))
          (abColorNameToHex colorName)
          )
        )
      )
    
    (defmethod abDisplayColorToHex 
      ((colorNames list) @optional (display "display"))
      (mapcar lambda((colorName) (abDisplayColorToHex colorName display))
              colorNames)
      )
    

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

    Thanks Andrew, however I do not see the new code working for the drf colors :-( 

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

    So did you use abDisplayColorToHex or abColorNameToHex? I don't see why it would have worked for you before I changed the code to handle lists but not after...

    Andrew.

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

    Very sorry - pilot error on my behalf! I did in fact use the wrong routine name. I continue to be greatly indebted to you for all of your help. God help me whenever you retire...

    • 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