• 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. Integrating Perl with Ocean

Stats

  • Locked Locked
  • Replies 10
  • Subscribers 143
  • Views 15436
  • 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

Integrating Perl with Ocean

Inas Mohammed
Inas Mohammed over 8 years ago

Hello,

Please i need help with the following questions.

First i need to explain what i want to do: 

I have a Perl script which will generate a file contains variable values which will be used in the netlist to simulated. Then this netlist will be simulated using an Ocean script which will put the outputs in an output file. This output file generated by Ocean will be passed again to the Perl script to do some calculations on these values.

So my questions are:

1) Can we integrate Perl with Ocean in the mentioned sequence of operations?

if yes, then how?

If no, then what is the other way to  achieve the same goal.

2) How to pass files between perl and ocean?

3) Instead of passing the outputs from ocean again to perl to do some calulations, can we make it directly inside ocean then make the final output file of ocean contains the final needed values. I mean the normal testbench outputs are some currents, then i calculate the difference between the values before and after the layout. So can i make ocean do this calculation dierctly instead passing again to perl?

Your help is highly appreciated 

Thanks

Regards,

Inas

  • Cancel
  • skillUser
    skillUser over 8 years ago

    Hi Inas,

    Search for "ipcBeginProcess" - there are several examples in this forum as well as some solution articles and examples in the documentation also.

    However, it would seem to make sense to perform calculations within the Ocean script itself - I would make the variables Design Variables in ADE and in the design and then you can control them directly within Ocean before running a simulation (or another subsequent simulation, for example). If you are not too familiar with Ocean, you could try setting up the simulation and some calculations from the ADE GUI and then using "Session -> Save Ocean Script" to output the setup as a starting point.

    Best regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Inas Mohammed
    Inas Mohammed over 8 years ago
    Hi Lawrence,

    Firstly: thanks for your detailed reply.
    Secondly: you are right about setting the calculations i need inside ADE GUI then save the ocean script.
    Thirdly: about the "ipcBeginProcess" to start the simulation from inside the PERL script or what?

    Thanks
    Regards,
    Inas
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 8 years ago
    Hi Inas,

    The ipcBeginProcess() command is for you to be able to start an external process from Virtuoso and be able to communicate with it (e.g. get results back from it). This was suggested so that you could call your Perl script from Ocean/Virtuoso. However it really does sound as though you should do all of the calculations etc. in SKILL/Ocean and control any subsequent simulations that way. Going back to your original question it seems that you have (or should have) some design variables in the design (schematic) that may be dependent on some calculations; in Ocean you can perform calculations and then use the desVar() command to set each design variable prior to simulation.

    Hope this clarifies things.

    Regards,
    Lawrence.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Inas Mohammed
    Inas Mohammed over 8 years ago
    Thanks Lawrence for your reply,
    Yes i got your point
    I have another question please, now my perl script generate a .txt file for the variables values which is included in the "input.scs" netlist and this file is included inside the ocean script, but when i simulate this script it doesn't see the new values, but simulate using the old values saved from the state in the "desvar", so how can i make ocean see the new values of the variables?
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    Two things:

    1. Don't define the variables with desVar and specify them via an include file - otherwise you have two definitions for the same variable. Depending on the order in the netlist, only one will win.
    2. If you're running in the default "interactive" mode, if you run one simulation in the OCEAN session, change the include file, and run() again, then spectre won't restart (it expects variable value changes to communicated directly by OCEAN to the simulator rather than re-reading the netlist). You can get around that by using envSetVal("spectre.envOpts" "controlMode" 'string "batch") before the simulator() call in the OCEAN script.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Inas Mohammed
    Inas Mohammed over 8 years ago
    about note no.1: so you mean i can have a text file having the same format like the desvar e.g: "VAR1" "100", then write includeFile("file.txt" path) correct?
    about note no.2: i don't get what do you mean by "interactive" mode, can you explain point no.2 more please?

    Thanks so Andrew
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    I thought you already had this .txt file included in the netlist? If so, how? The file wouldn't be in the format you are suggesting here - it would presumably be a spectre "parameters" statement (see "spectre -h parameters") and you'd not include it with includeFile() in OCEAN because that's not supported with spectre.

    Normally when ADE or OCEAN starts spectre it (by default) runs in "interactive" mode. The idea being that if you run a simulation, then change a parameter (by calling desVar() again with different values) and then run() again, spectre does not need to exit, restart, re-read the netlist, re-checkout the license and then run; instead ADE/OCEAN sends the new variable/parameter value to the simulator in memory and it can re-run directly which is faster.

    However, if the existing spectre invocation is dependent upon some file which was included for which the contents have now changed, it won't see those contents (since everything is already in memory) - by forcing spectre to run in batch mode, each simulation starts the simulator from scratch and reads the files off disk again.

    Whether this makes sense or not depends on what you're doing - and your last reply suggests to me that you're not doing what you earlier said you were doing - so I think you need to clarify things.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Inas Mohammed
    Inas Mohammed over 8 years ago

    I have a perl script which generates the file attached ("output_vairiables.txt") in the following format 

    1) output_variables.txt file

    simulator lang=spectre
    parameters VAR1=100m\
    VAR2=900m\
    VAR3=300m\
    VAR4=700m\
    VAR5=700m\
    VAR6=300m\
    VAR7=900m\
    VAR8=100m\
    VAR9=700m\
    VAR10=900m\
    VAR11=700m\
    VAR12=500m\

    2) Then this file is included inside the "input.scs" file like the following for the BOLD line:

    // Generated for: spectre
    // Generated on: Feb 26 20:38:45 2017
    // Design library name: Islam_patterns_largeVGS_5patterns_test3
    // Design cell name: TB_NMOS_CM_8x8_v03
    // Design view name: schematic
    simulator lang=spectre
    global 0

    include "/root/Desktop/output_variables.txt"
    include "/usr/local/IC614/TSMC_65nm/tsmcN65/../models/spectre/crn65gplus_2d5_lk_v1d0.scs" section=tt_bip
    include "/usr/local/IC614/TSMC_65nm/tsmcN65/../models/spectre/crn65gplus_2d5_lk_v1d0.scs" section=tt_dio
    include "/usr/local/IC614/TSMC_65nm/tsmcN65/../models/spectre/crn65gplus_2d5_lk_v1d0.scs" section=tt_dio_33
    ..............

    3) Then this file is included in the Ocean script i saved from the ADE in the design() command like the following for the BOLD line

    simulator( 'spectre )
    design( "/root/simulation/TB_NMOS_CM_8x8_v03/spectre/schematic/netlist/netlist_test")
    resultsDir( "/root/simulation/TB_NMOS_CM_8x8_v03/spectre/schematic" )

    modelFile( 

    '("/usr/local/IC614/TSMC_65nm/tsmcN65/../models/spectre/crn65gplus_2d5_lk_v1d0.scs" "tt_bip")
    '("/usr/local/IC614/TSMC_65nm/tsmcN65/../models/spectre/crn65gplus_2d5_lk_v1d0.scs" "tt_dio")
    ....................

    4) Then i commented the desvar() lines to make it see the variables values included before.

    But the old results always appear.

    I wish i made it clear by that. so i don't know where is the issue, why the Ocean can't see the new values?

    Thanks,

    Regards,

    Inas

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Inas Mohammed
    Inas Mohammed over 8 years ago
    The "output_variables.txt" format is like that as i made like the shape that was written originally in the "input.scs" file
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    Are you manually modifying the input.scs in step 2? If so, when you run() the simulation in step 3, the input.scs will be recreated and it will lose the include line. You could add output_variables.txt to your modelFile() call, and then it would be included in the input.scs that OCEAN creates.

    Remember that OCEAN constructs the input.scs from the netlist you specify, plus the models, plus any design variables, plus any analysis statements, options, and signals to be saved.

    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