Languages

CommunityCategory: MODELZENRunning MODELZEN characterization with pre-checked out HSPICE licenses

MODELZEN

Running MODELZEN characterization with pre-checked out HSPICE licenses

SA Support Team Staff 2019-03-15

I am generating models for a large circuit that contains many device instances. As MODELZEN performs HSPICE or Spectre simulation on each and every unique device instance to extract its characteristics, the total number of SPICE simulation runs is getting quite large. In our computing environment, it takes 1~2 seconds to check out a SPICE license and repeating this license check-out/check-in is taking a significant portion of the total model generation time. Is there a way to check-out the SPICE license just once, run all the SPICE simulations with this prechecked-out license, and return the license when they are done?

1 Answers
Best Answer
SA Support Team Staff 2019-03-15

In case you are using a simulator like HSPICE that supports advance license check-out, you can achieve what you want by defining the commands to be executed before and after the MODELZEN model characterization steps using the 'sim_preamble' and 'sim_postamble' properties of the technology configuration file.
Here is an example of using the HSPICE's advance license check-out feature. For more information, please refer to the HSPICE documentations.
First, you can check out the HSPICE license by running the 'hspice' command with a '-C' option:

hspice -C

And, to perform a simulation with this pre-checked out license, you can add the '-C' option to your command:

hspice -C <other arguments>

Finally, when the license is no longer needed, you can return it by using the following command:

hspice -C -K

It is also possible to use "-CC" option instead of the "-C" option (called advanced client/server mode). The usage is almost the same.
You just need to define a few properties in the technology configuration file to let MODELZEN take advantage of this advance license check-out feature of HSPICE. First, define the commands to be executed before and after the HSPICE characterizations using the sim_preamble['hspice'] and sim_postamble['hspice'] properties, respectively:

sim_preamble['hspice'] = ['hspice',  '-C']
sim_postamble['hspice'] = ['hspice', '-C', '-K']

And second, add the "-C" option to each simulation command by overriding the default definition for the sim_cmd['hspice'] property:

sim_cmd['hspice'] = lambda deck, log, outdir: ['hspice', '-C', '-i', deck, '-o', log]

Note that each command and its options are defined as an array of parsed tokens, following the convention of the Python's subprocess module. For more information, please refer to Section 4.2 Defining SPICE Simulation Option in the MODELZEN User Guide.