I want to add this input signal in my hspice code. Here I am doing transient analysis.
How can I do it?
Electronic – Generate HSPICE input signal
hspicesignalspice
Related Solutions
Typically the value is passed on the command line at the time of evoking the run.
Here is the setup line from my simulator which has the ability to read several different library hierarchies:
foundry/process-name/mosst/param.lib 3s; -> that says use the 3 sigma values
foundry/process_name/mosst/model-name.lib wp -> that says use the wp values
- wp here is similar to FF,TT,SS etc.
note: file names are changed for confidentiality reasons
The actual file that the simulator uses is assembled at run time through a series of calls that are like ifdefine statements used in compilers. Here is a snip from a *.lib file
.lib tm
*bsim3v3
.include ./models/bsim3v3/parameter-name.par
.include ./models/bsim3v3/nmos-name.mod
.include ./models/bsim3v3/pmos-name.mod
This reads as "if the called library is tm then include these files in the subdirectories"
If you are using a graphical tool there will be command parameters that you have to set that get passed to the spice executable. If you are running from the command line this will go in to your scripts to call the spice executable.
Temperature is set as a global parameter and SPICE uses it to change the models.
Monte Carlo simulation uses process corners, Voltage and Temperature and schmoos the design (and can be used to schmoo the W/L and stray capacitances at higher levels) to see the safe operating area. It is very computationally intensive.
Corner analysis is much more and can be viewed to be setting the outer limits that monte carlo must stay within.
I would recommend that you snoop through the library directory and under stand how things are called. I bet you'll find stuff in the library that would surprise you.
Hspice .MEASURE Continuous Results
This is from the 2014.09 Hspice command reference:
.MEASURE (Continuous Results)
Measures continuous results for TRIG-TARG, FIND-WHEN, Equation, and PARAM Evaluation functions.
Syntax
...
Examples from the documentation:
Example 2 The .measure statement continuously reports the time when the voltage value of node a1 reaches 2.5V, starting from the second falling edge.
.measure tran_cont cont_vout1 when v(a1)=2.5 fall=2
Example 3 The following example shows a correct .measure statement.
.measure tran_cont PERIOD
+ TRIG v(out) VAL =VDD/2 RISE=1
+ TARG v(out) VAL =VDD/2 RISE=2
.measure tran_cont FREQUENCY PARAM=1/PERIOD
The output will be in a separate continuous measures file
Hspice .MEASURE generation
Make a perl/python/whatever script that generates a .measure for each edge. Include the .measure statements into your hspice deck. The ostensible advantage of this is that the results will reside with the rest of the measurements.
VerilogA block
One can write a VerilogA piece of code which can be triggered by edges to output the time into a file. In Cadence there should be a sample library with some sample VerilogA widgets. The VerilogA code should be included into the hspice deck with a .hdl command and should be instantiated like any other subcircuit. Possible VerilogA code (in this case connect the signal of interest to the 'in' of this sampler:
`include "disciplines.vams"
module sampler(in);
input in; electrical in;
parameter real thres=0.5;
integer fh;
analog begin
@(initial_step) begin
fh = $fopen("times.txt","w");
end
@(final_step) begin
$fclose(fh);
end
@(cross(V(in)-thres, +1, 10p)) begin
// +1 means rising edge only
$fstrobe(fh,"%g",$abstime);
end
end
endmodule
PyOPUS post-processing
If you're looking for a more general post-procesing Python environment use PyOPUS. PyOPUS will open Hspice POST_VERSION=9601 binary data into numpy data structures. A post-processing script might look like:
import pyopus.simulator.hspicefile as hspf
import pyopus.evaluator.measure as meas
hspfObj = hspf.hspice_read( 'netlist.tr0' )
if hspfObj is None:
raise Exception("Error opening hspice file")
results = hspfObj[0][0][2][0] # dictionary of waveforms, keyed by name
time = results[hspfObj[0][1]] # list of scale point (in this case time)
i_rises = meas.IatXval(results['out'], 0.5, slope='rising')
t_rises = meas.XatI(time, i_rises)
Best Answer
Without seeing the schematic and some values it's impossible to tell. You could try to get around using either a behavioural source with
int()
,round()
,floor()
, orceil()
-- if a continuous voltage is applied at the input -- or aPWL()
source, something like:PWL(1 0 +1m 1 2 1 +1m 3 ...)
-- which will not need any input signal. There may be other, more complicated ways, by creating circuits that generate this kind of staircase signal, but since you didn't say anything else, there's not much else to talk about.