• 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. Import csv data and jartListToWaveform()

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 143
  • Views 14925
  • 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

Import csv data and jartListToWaveform()

ritterp
ritterp over 13 years ago

 Hello,

I apologize if this question has been asked before. In spite of its very basic nature I could not find any answer to the following problem on the cadence forums.

From a previous simulation I have a CSV textfile with time/value pairs

input.csv

0.00000000000e+00 -1.10875637805e+00
2.00000000000e-13 -1.10875643662e+00
....

 and the following skill code is used to import it:

pFILE=infile("input.csv")

if( pFILE then
lDATA=list()
time=0
value=0

while(gets( tLINE pFILE)
time=substring(tLINE 1 17)
value=substring(tLINE 19 18)
lDATA=cons(list(time value) lDATA)
)
wDATA=artListToWaveform(lDATA)
newWindow()
plot(wDATA)
)

close(pFILE)

Unfortunately my input.csv is pretty large (300K lines) and artListToWaveform(lDATA) crashes with a stack overflow. Moreover, the import itself is not as fast as I'd like it to be, but this is probably due to the substring function

Is there a more efficieny way for importing large csv files? Thank you in advance.

Regards, Phil

  • Cancel
  • ritterp
    ritterp over 13 years ago

    I've just came across getAsciiWave() which is much faster than my handmade solution, and, even more importantly, it does not crash at 300K lines.

    ... I knew there must be a simple solution ;-)

    • 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