• 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. Printing to csv file with nil data

Stats

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

Printing to csv file with nil data

TeeBro
TeeBro over 5 years ago

Hi All,

I'm reading some values from an extracted view and would like to print the values to a csv file.  I have created a table and would like to have a simple print statement to walk through the table printing the values. 

The table looks like signal1 --> signal2 --> pass --> value. 

The trouble is not all passes have a value. 

For example the table might look like this:

signal1 --> signal2 --> pass1 --> 5

signal1 --> signal2 --> pass2 --> 6

signal1 --> signal3 --> pass3 --> 7

Notice there is no signal1 --> signal3 -->pass1 or signal1--> signal3 -->pass2

I want the output csv file to be the following:

signal1,signal2,pass1,5

signal1,signal2,pass2,6

signal1,signal3,,

signal1,signal3,,

signal1,signal3,pass3,7

Any ideas would be appreciated.

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago

    If you have a value that you've retrieved from the table, and are about to print it with %s in a printf statement, isn't this just a matter of doing:

    unless(value value="")

    Or if it was an integer in the table, doing something like:

    if(value then
      sprintf(value "%d" value)
    else
      value=""
    )

    Perhaps I'm missing something? If I am, it's probably because you didn't give any specifics about what's in the table or how it's structured, or how you're writing the CSV.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • TeeBro
    TeeBro over 5 years ago in reply to Andrew Beckett

    Thanks Andrew!  I was making the task too complicated.  Sometimes you just need to put the code down for a while.8-)

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to TeeBro
    TeeBro said:
    I was making the task too complicated.  Sometimes you just need to put the code down for a while.8-)

    Don't worry! It happens to us all!

    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