• 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. saving bus of nets within an extracted view

Stats

  • Locked Locked
  • Replies 15
  • Subscribers 65
  • Views 11175
  • 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

saving bus of nets within an extracted view

NewScreenName
NewScreenName over 2 years ago

Dear all,

I am simulating an extracted view, and want to plot some internal nodes. I have followed the instructions at https://support.cadence.com/apex/ArticleAttachmentPortal?id=a1Od000000050whEAA&pageName=ArticleContent and it works fine for all nets, except those which are defined in the schematic as a bus (e.g. samplenet<99:0> ) and saved in the outputs as /someHierarchyLevels/samplenet<99:0> (in this case only /someHierarchyLevels/samplenet<99> would be saved), while it would work when saved singularly /someHierarchyLevels/samplenet<99>, /someHierarchyLevels/samplenet<98>, /someHierarchyLevels/samplenet<97> and so on. 

When a high number of such nets are involved it is quite unpractical to save them singularly, how can I still get them saved without having to expand the whole bus in the outputs tab of ADE assembler?

extraction with Quantus PVS

version:

Thanks and best regards

  • Cancel
Parents
  • ShawnLogan
    ShawnLogan over 2 years ago

    Dear NewScreenName,

    NewScreenName said:
    When a high number of such nets are involved it is quite unpractical to save them singularly, how can I still get them saved without having to expand the whole bus in the outputs tab of ADE assembler?

    I suppose one possibility, which I have used previously, is to include the save statement in an external file and use that file as an include file in your simulation setup. For example, I wrote a quick shell script that will create a save statement with names of your bus nodes in a file. I've attached the script as file "create_bus_save_file.txt". You may rename it to "create_bus_save_file.scr" as I could not upload  script file extension. Simply make the file executable (chmod +x ) and provide it with the base name of your node, the number of bits in the bus, and the desired output filename.

    For your case as an example, I just executed the following command;

    $ 

    $ create_bus_save_file.scr /someHierarchyLevels/samplenet 100 newscreennames_saves.scs

    Done! Output filename is "newscreennames_saves.scs".

    $ 

    $ head -4 newscreennames_saves.scs

    simulator lang=spectre

    save 

    /someHierarchyLevels/samplenet<0> \\

    /someHierarchyLevels/samplenet<1> \\

    $ 

    $ tail -4 newscreennames_saves.scs

    /someHierarchyLevels/samplenet<96> \\

    /someHierarchyLevels/samplenet<97> \\

    /someHierarchyLevels/samplenet<98> \\

    /someHierarchyLevels/samplenet<99>

    $ 

    Does this help?

    Shawn

    Fullscreen create_bus_save_file.txt Download
    #! /bin/bash
    if [ $# -ne 3 ]; then
       echo "Usage: create_bus_save_file <base_signal> <number _of_bits> <output_file_name>"
       exit 127
    fi
    
    echo "simulator lang=spectre" > $3
    echo "save " >> $3
    num_bits_minus_1=`expr $2 - 1 | bc`
    
    for i in $(seq 0 ${num_bits_minus_1});
    do
    	if [[ $i -lt ${num_bits_minus_1} ]]
    	then
    		echo "$1<$i> \\\\" >> $3;
    	else
    		echo "$1<$i>" >> $3;
    	fi
    done
    echo "Done! Output filename is \"$3\"."
    

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • ShawnLogan
    ShawnLogan over 2 years ago in reply to ShawnLogan

    Dear NewScreenName,

    I accidentally used the wrong line continuation character. The corrected script and corrected example follow.

    Fullscreen screen_capture.txt Download
    
    $ create_bus_save_file.scr /someHierarchyLevels/samplenet 100 newscreennames_saves.scs
    Done! Output filename is "newscreennames_saves.scs".
    $ head -4 newscreennames_saves.scs
    simulator lang=spectre
    save \ 
    /someHierarchyLevels/samplenet<0> \
    /someHierarchyLevels/samplenet<1> \
    $ tail -4 newscreennames_saves.scs
    /someHierarchyLevels/samplenet<96> \
    /someHierarchyLevels/samplenet<97> \
    /someHierarchyLevels/samplenet<98> \
    /someHierarchyLevels/samplenet<99>
    $ 
    

    Shawn

    Fullscreen 6204.create_bus_save_file.txt Download
    #! /bin/bash
    if [ $# -ne 3 ]; then
       echo "Usage: create_bus_save_file <base_signal> <number _of_bits> <output_file_name>"
       exit 127
    fi
    
    echo "simulator lang=spectre" > $3
    echo "save \\ " >> $3
    num_bits_minus_1=`expr $2 - 1 | bc`
    
    for i in $(seq 0 ${num_bits_minus_1});
    do
    	if [[ $i -lt ${num_bits_minus_1} ]]
    	then
    		echo "$1<$i> \\" >> $3;
    	else
    		echo "$1<$i>" >> $3;
    	fi
    done
    echo "Done! Output filename is \"$3\"."
    

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago in reply to ShawnLogan

    Please contact customer support - this should work (there was even a fix in ISR25 related to this, CCR 2509731 - but you're using a later version).

    Shawn's workaround won't work (as is) because it uses schematic names rather than netlist names (you could just pass the netlist name to his script, although I think the script is unnecessary). I also don't think expanding the bus is required - an include file containing:

    save someHierarchyLevels.samplenet*

    however, if the out-of-context is not working for the save, it probably won't work for plotting either so you'll probably need to use the results browser to access the signals. That's not the right way of doing this so please do contact customer support so that this can be resolved properly.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • NewScreenName
    NewScreenName over 2 years ago in reply to ShawnLogan

    Dear ShawnLogan

    Thank you this is working, I figured out myself some modification was needed there. I tried to further elaborate this script to make it able to receive any number of nets of buses, below you can find the code. Basically I tried to make a the loop to save singularly the signals nested in another loop sweeping through all the nets given. I suspect what is not working is the way I access the index k at lines 19 and 21? (just a guess, I have never worked with bash before). A part from what I added I also changed in the sense that the output file is the first argument now, to ease the loop indexing

    As a further question on the same topic, I was wondering is there a way to have this save statements in an ocean script? normally when in the outputs tab of assembler I have an expression like VT("/net1") then net1 will be automatically saved. This though does not happen if in an ocean script I am defining Vnet=VT("/net1"). Is there any way to save signals within an ocean script?

    Fullscreen create_bus_save_file_any_number_of_signals.txt Download
    #! /bin/bash
    if [ $# -lt 3 ]; then
       echo "Usage: create_bus_save_file <output_file_name> <base_signal_1> <number_of_bits_signal_1> <base_signal_2> <number_of_bits_signal_2> <base_signal_3> <number_of_bits_signal_3> ..."
       exit 127
    fi
    
    echo "simulator lang=spectre" > $1
    echo "save \\" >> $1
    
    num_given_buses=`expr "($# - 1)/2" | bc`
    
    for k in $(seq 1 ${num_given_buses});
    do
    	num_bus_elements=`expr $"(k*2 + 1)"-1 | bc`
    	for i in $(seq 0 ${num_bus_elements});
    	do
    		if [[ $i -lt ${num_bus_elements} ]]
    		then
    			echo "$"k*2"\($i\) \\" >> $1;
    		else
    			echo "$"k*2"\($i\)" >> $1;
    		fi
    	done
    done

    Thank you very much for your help

    Best regards

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • NewScreenName
    NewScreenName over 2 years ago in reply to Andrew Beckett
    Andrew Beckett said:
    if the out-of-context is not working for the save, it probably won't work for plotting either

    As far as I can see once nets were saved singularly, plotting would work as usual. I have contacted customer support. In the meantime while this is not fixed I could use what you suggest: 

    Andrew Beckett said:
    save someHierarchyLevels.samplenet*

    to be able to keep working on this.

    As sometimes I need to switch from some extracted views to others, which implies the naming of given nets changes based on if they are in an extracted cell or not for the given config view setting, I was wondering: is there a way to have an if statement in such "save someHierarchyLevels.samplenet*" which, based on what view is set in the config for the given cell, would use the proper path?

    Thank you

    Best regards

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago in reply to NewScreenName

    No, that's not possible (spectre has no knowledge of configs). I did wonder about using a stimulus file which would allow you to use the [#/someHierarchyLevels/samplenet<99>] syntax (the square bracket-hash syntax tells it to do name mapping), but I suspect that this is likely to have the same out-of-context name mapping problems as you're facing through the UI.

    In practice, I think that your attempt to use the saves for pre-layout through the UI would work OK, and including the suggested save statement above with wildcards would just lead to  a warning in both cases - for pre-layout the warning would be about your save statement, for post-layout it would (or might) be about the ADE-generated save statements (if they are not mapped correctly). I'd live with the warning for now until it can be fixed properly...

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ShawnLogan
    ShawnLogan over 2 years ago in reply to NewScreenName

    Dear NewScreenName,

    I read this question amidst the various responses and was not sure if you were still interested in its answer.

    NewScreenName said:
    I was wondering is there a way to have this save statements in an ocean script? normally when in the outputs tab of assembler I have an expression like VT("/net1") then net1 will be automatically saved. This though does not happen if in an ocean script I am defining Vnet=VT("/net1"). Is there any way to save signals within an ocean script?

    The syntax to save the voltage of a net, for example net v1, in ocean is:

    save( ’v "v1" )

    As a further example from an ocean script I happen to have:

    saveOption( 'save "selected" )
    save( 'v "/B<4>" "/B<3>" "/B<2>" "/B<1>" "/B<0>" "/VDDA" "/B<5>" "/OUTX1" "/OUTX2" "/OUTX3" "/OUTX4" "/VSS" "/PDB" "/VDDA_1" )
    save( 'i "/IVDDA/PLUS" )

    The save argument "selected" saves only the selected nets/terminal currents. The syntax for a current to save is also indicated.

    Shawn

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • ShawnLogan
    ShawnLogan over 2 years ago in reply to NewScreenName

    Dear NewScreenName,

    I read this question amidst the various responses and was not sure if you were still interested in its answer.

    NewScreenName said:
    I was wondering is there a way to have this save statements in an ocean script? normally when in the outputs tab of assembler I have an expression like VT("/net1") then net1 will be automatically saved. This though does not happen if in an ocean script I am defining Vnet=VT("/net1"). Is there any way to save signals within an ocean script?

    The syntax to save the voltage of a net, for example net v1, in ocean is:

    save( ’v "v1" )

    As a further example from an ocean script I happen to have:

    saveOption( 'save "selected" )
    save( 'v "/B<4>" "/B<3>" "/B<2>" "/B<1>" "/B<0>" "/VDDA" "/B<5>" "/OUTX1" "/OUTX2" "/OUTX3" "/OUTX4" "/VSS" "/PDB" "/VDDA_1" )
    save( 'i "/IVDDA/PLUS" )

    The save argument "selected" saves only the selected nets/terminal currents. The syntax for a current to save is also indicated.

    Shawn

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • NewScreenName
    NewScreenName over 2 years ago in reply to ShawnLogan

    Dear ShawnLogan,

    I have tried that, as it is indicated in the ocean reference as well, unfortunately on my side it is not saving the signals. Here is my short example (and in the test ADE explorer I chose the save selected option):

    axlAddOutputs( list("v_clk_b"))

    saveOption( 'save "selected" )
    save( 'v "/v6" "clk" "clk_b" )
    save( 'i "/N1/d" )
    v_clk_b = VT("/clk_b")

    axlOutputResult( v_clk_b "v_clk_b")

    Then I include this script in the outputs tab of my test, getting an eval err for v_clk_b, and when trying to plot via direct plot-> main form some of the saved signals it will state that they are not saved.

    Am I missing some side setting to be set, or is this ocean script supposed to be included in the outputs tab, or should it somehow instead be executed before running the simulation, at the time of netlisting?

    again thank you very much for following up

    Best regards

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ShawnLogan
    ShawnLogan over 2 years ago in reply to NewScreenName

    Dear NewScreenName,

    NewScreenName said:
    Am I missing some side setting to be set, or is this ocean script supposed to be included in the outputs tab, or should it somehow instead be executed before running the simulation, at the time of netlisting?

    If you need to save new output nets that have not previously been saved, you need to run a"pre-run" ocean script. If you have placed the "pre-run" ocean script in your outputs tab of your test, as it sounds you may have done, it will be executed AFTER the simulation. Hence, if you included save() statements for a net, that net will not be saved.

    To run an ocean script as a "pre-run" script, you need to right click on the test of interest in the Data View pane and choose "Pre-Run Script". A GUI will appear as shown below. Browse your directory structure to choose your script and make sure you check the enable box.

    You can also load a pre-run script will a SKILL command if you prefer. There is an example of a pre-run ocean script in Example 17-1 of the Virtuoso ADE Assembler User Guide ICADVM20.1 at

    support.cadence.com/.../techpubDocViewerPage

    I hope this makes sense and helps NewScreenName.

    Shawn

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago in reply to ShawnLogan

    Shawn,

    There's a lot of downside in using a pre-run script, and I also don't think it will actually do what you're suggesting. The pre-run script will run before the main simulation (typically used to perform calibration etc) but any save settings you make there will not affect the main simulation. Also, it would need to run an additional simulation. Also if running Monte Carlo it would prevent the grouping of points that normally occurs.

     NewScreenName,

    NewScreenName said:
    Thank you Andrew. Now I am wondering, rather than having to include manually this same save.scs file in all the corners I am running (they are quite a lot, and the way I know of to include this save.scs is in the model group of the corner I am simulating) is there a way to include it for all the corners in one place?

    Rather than specifying it as a model file, instead specify it as a definition file on the Setup→Simulation Files form. Then it will be included all the time and does not need to be specified per corner.

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • ShawnLogan
    ShawnLogan over 2 years ago in reply to Andrew Beckett

    Dear Andrew,

    Andrew Beckett said:
    There's a lot of downside in using a pre-run script, and I also don't think it will actually do what you're suggesting. The pre-run script will run before the main simulation (typically used to perform calibration etc) but any save settings you make there will not affect the main simulation.

    Thank you for reading my suggestion and your comment. Not having access to the tools prevents me from verifying my suggestion - so your insight is appreciated as the last thing I want to to do is waste NewScreenName's valuable time! or lead anyone else astray!

    Shawn

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • NewScreenName
    NewScreenName over 2 years ago in reply to Andrew Beckett

    Thank you Andrew and Shawn for your help.

    Regarding this: 

    Andrew Beckett said:
    There's a lot of downside in using a pre-run script, and I also don't think it will actually do what you're suggesting

    would there be any other way to save nets via an ocean script then? This could be useful for example to enable saving only portions of the circuit depending on some design variable values or similar.

    I guess if the save function is provided it must be possible

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ShawnLogan
    ShawnLogan over 2 years ago in reply to NewScreenName

    Dear NewScreenName,

    NewScreenName said:
    would there be any other way to save nets via an ocean script then? This could be useful for example to enable saving only portions of the circuit depending on some design variable values or similar.

    Well, since I struck out the first time, I thought a little more and let me try to take a second swing....see what you think!!

    Suppose you setup Assembler to run your basic simulation and include the saved nets for one particular set of design variables. I am assuming you want to choose the output nets to save based on one or more design variables. This setup represents the design variables for one set of saved outputs.

    Now, from the Assembler GUI, save the resulting ocean script (File->Save Script) to a file of your choice. Make a copy of the script (just to have an original copy should you want to refer to it later). Open your favorite text edit and load the copied ocean script. You may now include ocean or SKILL conditional expressions within it to set your saved nets based on the values of one or more design variables.

    After you have made your desired changes, you can run the ocean script from the CIW, UNIX command line or within Assembler itself. When the simulations complete the results can be viewed from Assembler.

    The instructions for creating and running an ocean script are in the Virtuoso ADE Assembler User Guide ICADVM20.1 at URL:

    https://support.cadence.com/apex/techpubDocViewerPage?xmlName=assembler.xml&title=Virtuoso%20ADE%20Assembler%20User%20Guide%20--%20Running%20Simulations%20-%20Creating%20an%20OCEAN%20Script&hash=pgfId-1025280&c_version=ICADVM20.1&path=assembler/assemblerICADVM20.1/asmSimulating.html#pgfId-1025280 

    So, not exactly what you might be hoping for as you are using a custom ocean script to run your simulations in lieu of solely the Assembler GUI, but perhaps might spur an idea or two.

    I hope I did not get my second strike!

    Shawn

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • NewScreenName
    NewScreenName over 2 years ago in reply to ShawnLogan

    Dear ShawnLogan,

    Thank you for following up and will give this a try

    • 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