Workflow for Adding Features to Simulators
You can use certain functions to add new features to existing simulators. Create a SKILL file to hold your information.
-
Use the
asiGetToolfunction to get the tool object associated with the simulator you want to modify. -
Add the features you want by using the procedures and passing in the tool argument.
For example, you might useasiAddEnvOptionto add an environment option orasiAddSimOptionto add a simulator option. - If needed, add the code to send your option to Cadence SPICE (to send to your target simulator).
- If needed, add the code to invalidate the flowchart step if the value of your option changes.
-
Load your code changes into your .
cdsinitfile.
Later, you can add your changes to your site .cdsinitfile. -
Add any necessary changes to the .
cdsenvfile.-
Type
virtuosoin a UNIX shell. - Type the following command in the CIW and substitute the appropriate simulator name for <simulator>. Do not include the angle brackets (<>).
asiCreateCdsenvFile('<
A file calledsimulator>)<simulator>CdsenvFileis created in your current working directory.-
Use this file to replace the existing .
cdsenvfile in the <install_dir>/tools/dfII/etc/tools/<simulator> directory. Be sure to save a backup copy of the existing.cdsenv file before completing this step. Use the following command to replace the existing.cdsenv file with your new file:
mv <
simulator>CdsenvFile <install_dir>/tools/dfII/etc/ tools/<simulator>/.cdsenv -
Type
Examples
The following example shows how you might add an environment option called myFile to the environment options form for Spectre. The steps from the previous procedure are called out in the comments.
; get the Spectre tool tool=asiGetTool('Spectre) ; This is step 1. ; add the environment option myFile asiAddEnvOption( tool ; This is step 2. ?name 'myFile
?type 'fileName
?prompt "My File"
?value ""
?invalidateFunc 'asiInvalidateControlStmts
; This is step 4. See the note
; following this example.
) ; modify the step that sends control statements,to send myFile also. flowchart = asiGetFlowchart( tool ) ; This is step 3.
asiChangeFlowchartStep( flowchart ?name 'asiSendControlStmts
?postFunc 'mySendMyFile
) ; Write the function (mySendMyFile) to send (the contents of) myFile to Spectre. defmethod( mySendMyFile ( ( session Spectre_session ) ) ; This is also step 3. let(( netlistDir customInclude customIncludeFile ) ; Check if the option is set.
if( nequal( asiGetEnvOptionVal( session 'myFile) "") then
; There is a mechanism in Spectre that allows you to
' create a file
; called: .customInclude in the netlist directory. If you
; then send
; a 'ptptop' command to Spectre, it includes the contents of
; .customInclude in the final netlist for your target
; simulator.
; Open the .customInclude file in the netlist directory.
netlistDir = asiGetNetlistDir(session)
when( rexMatchp( "Verilog" asiGetSimName( session ) )
netlistDir = strcat( netlistDir "/analog" )
)
customInclude=strcat(netlistDir ".customInclude")
customIncludeFile = outfile( customInclude "w")
; Add whatever you need to add to this file.
; In this case, perhaps it is the contents of 'myFile'.
; When you are finished, close the file.
close( customIncludeFile )
; Send the 'ptprop' command to Spectre to include the
; contents of this file in the final netlist.
asiSendSim( session "ptprop analog CustomIncludeFile 1" nil
nil nil )
else
; Send the command to turn off the inclusion of the file in
; the final netlist.
asiSendSim( session "deprop analog CustomIncludeFile" nil
nil nil )
)
t
)
)
asiInvalidateControlStmts is a wrapper to asiInvalidateFlowchartStep, which invalidates the asiSendControlStmts step (as shown below):defmethod( asiInvalidateControlStmts ( ( session Spectre_session ) )
asiInvalidateFlowchartStep( session 'asiSendControlStmts )
)
Return to top