Skip to main content

PSIM Command Line Interface

The PSIM Command Line Interface (CLI) allows users to interact with PSIM simulations and operations directly from the command line. This can be particularly useful for automating tasks, running batch simulations, or integrating PSIM with other tools and scripts.

Usage

To use the PSIM CLI, you can run commands in the terminal or command prompt. Below are some examples of how to use the CLI for various operations:

Running a Simulation

Usage: PsimCmd.exe -i "[input file]" -o "[output file]" -v "VarName1=VarValue" -v "VarName2=VarValue" -g -KF "[Save data file (.ssf)]" -LF "[Load data file (.ssf)]" -t "TotalTime" -s "TimeStep" -tv "SecondaryTimestepRatio" -pt "PrintTime" -ps "PrintStep" -Net "Netlist file name" -m "file name for errors"


Except input file, all other parameters are optional.
All file names should be enclosed by " or ' characters.
Command-line parameters:
-i : Followed by input schematic file or Script file(.script).
-o : Followed by output text (.txt) or binary (.smv) file.
-g : Run Simview after the simulation is complete.
-t : Followed by total time of the simulation.
-s : Followed by time step of the simulation.
-tv : Use variable time step. Followed by Ratio. SecondaryTimeStep = TimeStep / Ratio.
-tc : Do not use variable time step.
-pt : Followed by print time of the simulation.
-ps : Followed by print step of the simulation.
-v : Followed by variable name and value. This parameter can be used multiple times.
example: -v "R1=1.5" -v "R2=5"
special variables:
TIMESTEPTYPE 0,1 0:Standard 1:Variable
TIMESTEPRATIO 2,4,8,...
TOTALTIME
TIMESTEP
PRINTTIME
PRINTSTEP
SAVEFLAG 0,1
LOADFLAG 0,1
HARDWARETARGET 0,1,....20
No hardware target : 0
General system : 1
Myway expert3 : 2
Ps f2833x system : 3
Pro f28335 system : 4
Ps f2803x system : 5
Ps f2806x system : 6
Ps f2802x system : 7
Ps kv31 system : 8
Myway expert4 : 9
Ps f28004x system : 10
Ps f2837x system : 11

-m : Followed by Text file for Error messages
-KF: Set 'Save flag' in Simulation control followed by .ssf file path to save data to.
-K0 : Remove 'Save flag' in Simulation control.
-LF: Set 'Load flag' in Simulation control, followed by .ssf file path to load data from.
-L0 : Remove 'Load flag' in Simulation control. Starts simulation from beginning.
-Net : Generate netlist file. Simulation will not run. Followed by optional Netlist file name.
-NetXml : Generate XML netlist file. Simulation will not run. Followed by optional XML file name.
-NetXmlU : Generate XML netlist file in UTF16 format. Simulation will not run. Followed by optional XML file name.
-c : Followed by input netlist file.
-SP or -SPICE : Run HyperSpice simulation.
-LT : Run LTspice simulation. (Requires Spice module)
-hw : Generate hardware code. (Requires SimCoder modules)
To run Script file: input file following -i switch must be a .script file. In case of script file, variables (-v switch) are passed to the script.
///////////////////////////////////////////////
// return values:
/////////////////////////////
// 0: Success
//
// Errors:
// 2: Failed to run simulation or generate an XML file or generate Simcoder C code.
// 3: Can not open input schematic file
// 4: Input file is missing
// 10: unable to retrieve valid license.
// -1: Failed to run script otherwise it returns the script return value or 0
///////////////////////////////////////////////