• 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. Mixed-Signal Design
  3. how to create a waveform for each simulation corner with...

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 64
  • Views 15418
  • 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

how to create a waveform for each simulation corner with an Ocean script and send it back to ADEXL

Frantz
Frantz over 5 years ago

Hi All,

I'm running simulation with ADEXL at different corner, and for every corner there is a csv file generated, containing simulation data results.

with an ocean script that I include in the ADEXL outputs setup,  i'm reading the files generated at each simulation run at the end of the simulation, and then I generate a waveform from each of those files with the ocean script. Unfortunately it seems like the script reads the file generated at the first corner and then uses the same file  for all the other corners thus generating the same waveform for each corner.

Is there a way to tell the script to run on different corner?

here below is my script 

Regards

Frantz

print("start my ocean script")

 

         if( axlGetCornerNameForCurrentPointInRun() then ccorner = axlGetCornerNameForCurrentPointInRun() else ccorner = "TT_85" ) ; if i'm running only one corner i set the corner name to the default's one

         path = "simulation_path"


         sprintf(file_toread "%ssbr_norm_%s.csv" path ccorner)


        fr = infile(file_toread)

        when( fr
                        while( gets(nextline fr)
                        i++
                       ;I'm counting the number of lines in the files
                        )
                )

        Nlines = i

        i = 0
        j = 0

       close(fr)

        declare( Val[Nlines-1]) ; I declare a vector to save all the data in the file

        tsteps = VAR("tstep")

        tend_plot = tsteps*(Nlines-1)

        tarray = linRg(0 tend_plot tsteps) ; I create a time axis 


        aList1 = '() ; I create a list to save all the data from the file


        fr = infile(file_toread)

        gets(nextline fr)

        for(i 1 Nlines

                   for( j 1 Ntot_taps_rk12

                             fscanf(fr "%f %s" val1 col) sum++

                             if(sum == 10

                                   then aList1 = cons(val1 aList1 )

                               )

                        ) sum = 0


               )

tax = drCreateVec('double tarray) ; i create the time axis on the x
tax -> units = "s" ; i create the label of the x axis
yax = drCreateVec('double aList_rk1) ; i create the y axis using the data read from the file
yax -> units = "V"
adxel_wave_form = drCreateWaveform(tax yax); I create the waveform to be brought out on the adexl gui

axlAddOutputs(list("adxel_wave_form"))

axlOutputResult(adxel_wave_form "adxel_wave_form") ; I bring the waveform into adexl outputs 

close(fr)

print("finished my ocean script")

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 5 years ago

    I think the error is that in your code you create the y vector like this:

     yax = drCreateVec('double aList_rk1) ; i create the y axis using the data read from the file  

    but the rest of the code is creating a variable called aList. So the data you read from the file is not used to create the waveform - and presumably the aList_rk1 variable is a hangover from an earlier experiment.

    It doesn't appear to be due to reading the wrong file (a few debug statements would have told you that, I think). I couldn't really run  your code because I don't know how you're creating this CSV file, but a simple test shows that axlGetCornerNameForCurrentPointInRun() returns the correct corner name for each corner, and so the filename must be different for each corner point, and hence it's reading a different file each time.

    Regards,

    Andrew.

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

    Hi Andrew,

    thanks for your feedback. you are right,  yax sould be = drCreateVec('double aList1). The csv file is created by a verilogA module in my test bench, and I'm passing a string variable from ADEXL to the verilogA module which is exactly the name of the corner. the axlGetCornerNameForCurrentPointInRun() returns the correct corner name of the corner and thus the ocean script is able to read the file and to send to ADEXl the waveform. But when I'want to plot the waveform from ADEXL after the simulation is completed, seems like the ocean script is recompiled and then the  axlGetCornerNameForCurrentPointInRun() is returning a nill and then the default corner name is assigned to ccorner thus the script will find the csv file with the default corner name and plot the same waveform for all the corners.

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

    Hi Andrew,

    thanks for your feedback. you are right,  yax sould be = drCreateVec('double aList1). The csv file is created by a verilogA module in my test bench, and I'm passing a string variable from ADEXL to the verilogA module which is exactly the name of the corner. the axlGetCornerNameForCurrentPointInRun() returns the correct corner name of the corner and thus the ocean script is able to read the file and to send to ADEXl the waveform. But when I'want to plot the waveform from ADEXL after the simulation is completed, seems like the ocean script is recompiled and then the  axlGetCornerNameForCurrentPointInRun() is returning a nill and then the default corner name is assigned to ccorner thus the script will find the csv file with the default corner name and plot the same waveform for all the corners.

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

    Hmm, That's a bit of a problem.

    I did try adding an output called "CORNERNAME" which had an expression (axlGetCornerNameForCurrentPointInRun() || "TT_85") and then use calcVal("CORNERNAME") in the script instead, but that doesn't work properly either. It sort of works during the running of the simulation, but gives errors during re-evaluation, and during plotting the calcVal() returns a waveform of all the CORNERNAME values - so that's no good.

    I think this is a bug - when plotting a waveform from an OCEAN script, it has to re-evaluate the script because derived waveforms are not persistently stored; in that case it's vital that axlGetCornerNameForCurrentPointInRun() returns the correct corner when the script is re-evaluated this way.

    So please contact customer support to request that this is corrected. When you do this, if you could post the case number here that would be great as I'd like to follow the progress.

    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