1 #include "avt_API_types.h"
5 #define PwlFunction void
18 void sim_API_Action_Initialize ();
19 void sim_API_Action_Terminate ();
20 void sim_SetSlopeForm (SimulationContext
*sc
, PwlFunction
*f
);
22 //*************************************
24 //*************************************
27 MAN sim_SetSimulatorType
30 sim_SetSimulatorType specifies the type of simulator towards whom the simulation
31 netlists are created. Supported simulators types are 'NGSPICE' and 'ELDO'.
37 extern void sim_SetSimulatorType (SimulationContext
*sc
, char *type
);
43 sim_CreateContext creates a simulation context, relatively to a netlist. Electrical simulations directives are applied to this netlist and
44 stored in the newly created simulation context.
46 Pointer on the newly created simulation context.
50 extern SimulationContext
*sim_CreateContext (Netlist
*netlist
);
53 MAN sim_CreateNetlistContext
56 sim_CreateNetlistContext creates a simulation context, relatively to the current gns netlist which is flattened to transistor level.
58 Pointer on the newly created simulation context.
62 SimulationContext
*sim_CreateNetlistContext();
65 MAN sim_GetContextNetlist
68 sim_GetContextNetlist returns the netlist the simulation context {sc} is associated to.
70 Netlist
*sim_GetContextNetlist(SimulationContext
*sc
);
76 sim_FreeContext deletes a previously created simulation context. The netlist associated with the simulation context is not affected.
82 void sim_FreeContext (SimulationContext
*model
);
88 sim_SetDelayVTH sets the threshold voltage for delay calculations. Delay is computed
89 between the vth-crossing ins
95 extern void sim_SetDelayVTH (SimulationContext
*sc
, double vth
);
98 MAN Simulation_SetSlopeVTH
101 sim_SetSlopeVTH specifies the bounds of the slope (percentage of vdd).
107 extern void sim_SetSlopeVTH (SimulationContext
*sc
, double vth_low
, double vth_high
);
110 MAN sim_SetSimulationSlope
113 sim_SetSimulationSlope sets the default input slope for electrical simulation.
114 The unit is the second.
120 extern void sim_SetSimulationSlope (SimulationContext
*sc
, double slope
);
123 MAN sim_SetSimulationTime
126 sim_SetSimulationTime sets the duration of the electrical simulation.
133 extern void sim_SetSimulationTime (SimulationContext
*sc
, double time
);
136 MAN sim_SetSimulationStep
139 sim_SetSimulationStep sets the step used during the electrical simulation.
140 The unit is the second.
146 extern void sim_SetSimulationStep (SimulationContext
*sc
, double step
);
149 MAN sim_SetSimulationSupply
152 sim_SetSimulationSupply sets the applied power supply during the electrical simulation.
153 The unit is the volt.
159 extern void sim_SetSimulationSupply (SimulationContext
*sc
, double v_max
);
162 MAN sim_SetInputSwing
165 sets the swing to use for input connector/signal. Those values are used for instance when setting an input slope on a connector.
169 void sim_SetInputSwing (SimulationContext
*sc
, double v_vss
, double v_max
);
172 MAN sim_SetOutputSwing
175 sets the swing to use for output signal when computing a delay to the output signal or the slope on an output signal.
179 void sim_SetOutputSwing (SimulationContext
*sc
, double v_vss
, double v_max
);
182 MAN sim_GetSimulationSupply
185 sim_GetSimulationSupply returns the simulation voltage defined for the alimentation connector.
186 The unit is the volt.
192 extern double sim_GetSimulationSupply();
195 MAN simn_SetSimulationTemp
198 sim_SetSimulationTemp sets the applied temperature during the electrical simulation.
199 The unit is the celsius degree.
205 extern void sim_SetSimulationTemp (SimulationContext
*sc
, double temp
);
208 MAN sim_AddSimulationTechnoFile
211 sim_AddSimulationTechnoFile adds a technology file in list of technology files used to
212 parametrize the electrical simulation.
218 extern void sim_AddSimulationTechnoFile (SimulationContext
*sc
, char *tech_file
);
221 MAN sim_SetSimulationCall
224 sim_SetSimulationCall sets the string which will be called to run the electrical simulator.
230 extern void sim_SetSimulationCall (SimulationContext
*sc
, char *sim_call
);
233 MAN sim_NoiseSetAnalyseType
236 sim_NoiseSetAnalyseType sets the type of noise analysis. Allowed values are SIM_MIN and SIM_MAX.
242 extern void sim_NoiseSetAnalyseType (SimulationContext
*sc
, char noise_type
);
245 MAN sim_SetSimulationOutputFile
248 sim_SetSimulationOutputFile specifies the extension of the file generated by the electrical simulator.
254 extern void sim_SetSimulationOutputFile (SimulationContext
*sc
, char *output_file
);
256 //*************************************
257 // Input PWL - DC values
258 //*************************************
261 MAN sim_AddStuckLevel
264 sim_AddStuckLevel stucks the node to VDD if level is 1, to GND if level is 0.
270 extern void sim_AddStuckLevel (SimulationContext
*sc
, char *node
, int level
);
273 MAN sim_AddStuckLevelVector
276 sim_AddStuckLevelVector stucks the input bit vector to the hexadecimal value (VDD
277 if the bit value is 1, GND if the bit value is 0).
283 extern void sim_AddStuckLevelVector (SimulationContext
*sc
, char *node
, char *level
);
286 MAN sim_AddStuckVoltage
289 sim_AddStuckVoltage stucks the input to the value.
295 extern void sim_AddStuckVoltage (SimulationContext
*sc
, char *node
, double voltage
);
301 sim_AddSlope sets a rising slope on the input if sense is 'U', a falling slope
308 extern void sim_AddSlope (SimulationContext
*sc
, char *node
, double start_time
, double transition_time
, char sense
);
314 sim_AddSlope sets a rising slope on the input (an internal signal) if sense is 'U', a falling slope
321 extern void sim_AddSignalSlope (SimulationContext
*sc
, char *node
, double start_time
, double transition_time
, char sense
);
323 PwlFunction
*sim_builtin_tanh ();
324 PwlFunction
*sim_builtin_ramp ();
327 MAN sim_SetExternalCapacitance
330 sim_SetExternalCapacitance sets a capacitance {value} on the toplevel connector {node}.
337 void sim_SetExternalCapacitance(SimulationContext
*sc
, char *node
, double value
);
344 sim_AddWaveForm sets rising and falling transitions on the node, according to the string 'pattern'.
345 Specifying 1 in 'pattern' sets rising slope, 0 a falling slope.
351 extern void sim_AddWaveForm (SimulationContext
*sc
, char *node
, double trise
, double tfall
, double periode
, char *pattern
);
353 //*************************************
355 //*************************************
360 sim_AddInitLevel initialize a node voltage to VDD if level = 1, to GND if level = 0.
366 extern void sim_AddInitLevel (SimulationContext
*sc
, char *node
, int level
);
369 MAN sim_AddInitVoltage
372 sim_AddInitVoltage initialize a node voltage to the value voltage.
378 extern void sim_AddInitVoltage (SimulationContext
*sc
, char *node
, double voltage
);
385 sim_AddOutLoad adds the capacitance 'load' on the specified 'node' output connector.
391 void sim_AddOutLoad (SimulationContext
*sc
, char *node
, double load
);
393 //*************************************
394 // Mesure PRINT points
395 //*************************************
400 sim_AddMeasure prints the signal voltage to the simulator output file.
401 This function is needed to compute timing.
407 extern void sim_AddMeasure (SimulationContext
*sc
, char *node
);
410 MAN sim_AddMeasureCurrent
413 sim_AddMeasureCurrent prints the node current to the simulator output file.
419 extern void sim_AddMeasureCurrent (SimulationContext
*sc
, char *node
);
421 //*************************************
422 // Simulation primitives
423 //*************************************
425 MAN sim_RunSimulation
428 sim_RunSimulation launches the electrical simulation.
434 extern void sim_RunSimulation (SimulationContext
*sc
, char *sim_call
);
436 //*************************************
437 // Computing primitives
438 //*************************************
441 MAN sim_ExtractMinSlope
444 After a simulation run, sim_ExtractMinSlope extracts the minimum slope of a node.
446 sim_ExtractMinSlope returns the computed slope.
450 extern double sim_ExtractMinSlope (SimulationContext
*sc
, char *node
);
453 MAN sim_ExtractMaxSlope
456 After a simulation run, sim_ExtractMaxSlope extracts the minimum slope of a node.
458 sim_ExtractMaxSlope returns the computed slope.
462 extern double sim_ExtractMaxSlope (SimulationContext
*sc
, char *node
);
466 MAN sim_ExtractMinDelay
469 After a simulation run, sim_ExtractMinDelay extracts the minimum delay between two nodes.
471 sim_ExtractMinDelay returns the computed delay.
475 extern double sim_ExtractMinDelay (SimulationContext
*sc
, char *node_a
,char *node_b
);
478 MAN sim_ExtractMaxDelay
481 After a simulation run, sim_ExtractMaxDelay gets the maximum delay between two nodes.
483 sim_ExtractMaxDelay returns the computed delay.
487 extern double sim_ExtractMaxDelay (SimulationContext
*sc
, char *node_a
,char *node_b
);
490 MAN sim_ComputeAllDelay
493 After a simulation run, sim_ComputeAllDelay computes all the delays between two nodes.
495 sim_ComputeAllDelay returns the list of computed delays.
499 extern Timing
*sim_ExtractAllTimings (SimulationContext
*sc
, char *node_a
,char *node_b
);
502 MAN sim_ExtractMinTransitionDelay
505 After a simulation run, sim_ExtractMinTransitionDelay extracts the mininum delay between two nodes, see sim_ExtractMinDelay.
506 Parameter 'transition' can be for example "U1D2". In this configuration, delay will be extracted between the second
507 rise transition of 'node_a' and the third falling transition of 'node_b'.
509 sim_ExtractMinTransitionDelay returns a delay.
513 extern double sim_ExtractMinTransitionDelay (SimulationContext
*sc
, char *node_a
,char *node_b
,char *transition
);
516 MAN sim_ExtractMaxTransitionDelay
519 After a simulation run, sim_ExtractMaxTransitionDelay extracts the maximum delay between two nodes, see sim_ExtractMaxDelay.
520 Parameter 'transition' can be for example "U1D2". In this configuration, delay will be extracted between the second
521 rise transition of 'node_a' and the third falling transition of 'node_b'.
523 sim_ExtractMaxTransitionDelay returns a delay.
527 extern double sim_ExtractMaxTransitionDelay (SimulationContext
*sc
, char *node_a
,char *node_b
,char *transition
);
530 MAN sim_ExtractMinTransitionSlope
533 After a simulation run, sim_ExtractMinTransitionSlope extracts the minimum slope of a node.
534 Parameter 'transition' can be for example "U1". In this configuration, slope will be extracted from the
535 second rising transition of the node.
537 sim_ExtractMaxTransitionDelay returns a slope.
541 extern double sim_ExtractMinTransitionSlope (SimulationContext
*sc
, char *node
,char *transition
);
544 MAN sim_ExtractMaxTransitionSlope
547 After a simulation run, sim_ExtractMaxTransitionSlope extracts the maximum slope of a node.
548 Parameter 'transition' can be for example "D2". In this configuration, slope will be extracted from the third falling transition of the node.
550 sim_ExtractMaxTransitionSlope returns a slope.
554 extern double sim_ExtractMaxTransitionSlope (SimulationContext
*sc
, char *node
,char *transition
);
560 sim_ComputeSetup computes the setup time of 'data' relatively to 'command'. Setup time is computed by
561 observing the latest 'data' transition, relatively to 'command', that generates a transition on
563 data : name of the data
564 tstart_d : start time of the pulse on data
565 tslope_d : slope of the pulse on data
566 sens_d : transition of the data : 'U' for rising, 'D' for falling
567 cmd : name of the command
568 tstart_min : minimum starting time of the pulse on cmd
569 tstart_max : maximum starting time of the pulse on cmd
570 tslope_c : slope of the pulse on cmd
571 sens_c : transition of the cmd : 'U' for rising, 'D' for falling
572 mem : name of the memory point
573 data_val : expected value on mem : 1 for VDD, 0 for VSS
575 sim_ComputeSetup returns the setup computed.
579 extern double sim_ComputeSetup (SimulationContext
*sc
, char *data
,double tstart_d
,double tslope_d
, char sense_d
, char *cmd
,double t_start_min_c
, double t_start_max_c
, double tslope_c
,char sense_c
, char *mem
, int data_val
);
586 sim_ComputeHold computes the hold time of 'data' relatively to 'command'. Hold time is computed by observing
587 the latest 'data' transition, relatively to command, that doesn't generate
588 any transition on the memory point.
589 data : name of the data
590 tstart_d : start time of the pulse on data
591 tslope_d : slope of the pulse on data
592 sens_d : transition of the data : 'U' for rising, 'D' for falling
593 cmd : name of the command
594 tstart_min : minimum starting time of the pulse on cmd
595 tstart_max : maximum starting time of the pulse on cmd
596 tslope_c : slope of the pulse on cmd
597 sens_c : transition of the cmd : 'U' for rising, 'D' for falling
598 mem : name of the memory point
599 data_val : expected value on mem : 1 for VDD, 0 for VSS
601 sim_ComputeHold returns the setup computed.
605 extern double sim_ComputeHold (SimulationContext
*sc
, char *data
, double tstart_d
,double tslope_d
, char sense_d
, char *cmd
,double t_start_min_c
, double t_start_max_c
, double tslope_c
,char sense_c
, char *mem
, int data_val
);
608 MAN sim_ComputeAccess
611 sim_ComputeAccess gives the access time of 'dout' relatively to 'command'. Access time is computed by observing
612 the delay between the transition on 'command' and the transition on 'dout'.
614 sim_ComputeAccess returns the access computed.
618 extern double sim_ComputeAccess (SimulationContext
*sc
, char *dout
, int dout_val
,char *cmd
, double tstart_c
, double tslope_c
, char sens_c
, char *mem
, int mem_val
, double *out_slope
);
621 MAN elp_GetCapaFromConnector
624 elp_GetCapaFromConnector gives the capacitance of a transistor's connector.
626 elp_GetCapaFromConnector returns a capacitance in F.
630 extern double elp_GetCapaFromConnector (SimulationContext
*sc
, Connector
*locon
);
636 sim_ComputeDelay gives a list of delays between a constant input and a list of outputs.
638 sim_ComputeDelay returns a list of delays.
642 extern List
*sim_ComputeDelay (SimulationContext
*sc
, char *input
, char sens
, List
*list_output
);
645 MAN sim_ComputeMaxDelayTransition
648 sim_ComputeMaxDelayTransition gives the maximum delay corresponding to a transition between the input and the output.
650 sim_ComputeMaxDelayTransition returns a delay.
654 extern double sim_ComputeMaxDelayTransition (SimulationContext
*sc
, char *input
, double input_start
, double input_slope
,char *output
, char *transition
);
657 MAN sim_ComputeMinDelayTransition
660 sim_ComputeMinDelayTransition gives the minimum delay corresponding to a transition between the input and the output.
662 sim_ComputeMinDelayTransition returns a delay.
666 extern double sim_ComputeMinDelayTransition (SimulationContext
*sc
, char *input
, double input_start
, double input_slope
,char *output
, char *transition
);
669 MAN sim_GetTimingFromList
672 sim_GetTimingFromList gives a timing object corresponding to a list.
674 sim_GetTimingFromList returns a timing object.
678 extern Timing
*sim_GetTimingFromList (List
*list
);
681 MAN sim_GetTimingNext
684 sim_GetTimingNext gives the next timing object.
686 sim_GetTimingNext returns a timing object.
690 extern Timing
*sim_GetTimingNext (Timing
*timing
);
696 sim_GetTiming retrieves the timing between the root node name 'rootname' and the destination node name 'nodename'.
698 sim_GetTiming returns the pointer on the timing, NULL if this corresponding timing doesn't exist.
702 extern Timing
*sim_GetTiming (char *root
,char *node
);
705 MAN sim_GetTimingByEvent
708 sim_GetTimingByEvent retrieves the timing between the root node name 'rootname' and the destination node name 'nodename'.
709 This timing must respect the good event on 'rootname' and 'nodename'.
710 Event is the expected event from root to node, it can be 'U' (rising) or 'D' (falling) and can be followed by an integer.
712 sim_GetTimingByEvent returns the pointer on the timing, NULL if this corresponding timing doesn't exist.
716 extern Timing
*sim_GetTimingByEvent (char *root
,char *node
,char *event
);
719 MAN sim_GetTimingDelay
722 sim_GetTimingDelay gets the delay corresponding to the timing.
724 sim_GetTimingDelay returns a delay.
728 extern double sim_GetTimingDelay (Timing
*timing
);
731 MAN sim_GetTimingMinDelay
734 sim_GetTimingMinDelay gets the minimun delay corresponding to the timing.
736 sim_GetTimingMinDelay returns a delay.
740 extern double sim_GetTimingMinDelay (Timing
*timing
);
743 MAN sim_GetTimingMaxDelay
746 sim_GetTimingMaxDelay gets the maximun delay corresponding to the timing.
748 sim_GetTimingMaxDelay returns a delay.
752 extern double sim_GetTimingMaxDelay (Timing
*timing
);
755 MAN sim_GetTimingSlope
758 sim_GetTimingSlope gets the slope corresponding to the timing.
760 sim_GetTimingSlope returns a slope.
764 extern double sim_GetTimingSlope (Timing
*timing
);
767 MAN sim_GetTimingMinSlope
770 sim_GetTimingMinSlope gets the minimum slope corresponding to the timing.
772 sim_GetTimingMinSlope returns a slope.
776 extern double sim_GetTimingMinSlope (Timing
*timing
);
779 MAN sim_GetTimingMaxSlope
782 sim_GetTimingMaxSlope gets the maximum slope corresponding to the timing.
784 sim_GetTimingMaxSlope returns a slope.
788 extern double sim_GetTimingMaxSlope (Timing
*timing
);
791 MAN sim_GetTimingRoot
794 sim_GetTimingRoot gets the name of the root node corresponding to the timing.
796 sim_GetTimingRoot returns a name.
800 extern char *sim_GetTimingRoot (Timing
*timing
);
803 MAN sim_GetTimingNode
806 sim_GetTimingNode gets the name of the node (destination) corresponding to the timing.
808 sim_GetTimingNode returns a name.
812 extern char *sim_GetTimingNode (Timing
*timing
);
815 MAN sim_GetTimingRootInNetlist
818 sim_GetTimingRootInNetlist gets the name of the root node in the netlist corresponding to the timing.
820 sim_GetTimingRootInNetlist returns a name.
824 extern char *sim_GetTimingRootInNetlist (Timing
*timing
);
827 MAN sim_GetTimingNodeInNetlist
830 sim_GetTimingNodeInNetlist gets the name of node (destination) in the netlist corresponding to the timing.
832 sim_GetTimingNodeInNetlist returns a name.
836 extern char *sim_GetTimingNodeInNetlist (Timing
*timing
);
839 MAN sim_GetTimingRootEvent
842 sim_GetTimingRootEvent gets the event of the root node corresponding to the timing.
843 Event is SIM_FALL or SIM_RISE.
845 sim_GetTimingRootEvent returns an event.
849 extern char sim_GetTimingRootEvent (Timing
*timing
);
852 MAN sim_GetTimingNodeEvent
855 sim_GetTimingNodeEvent gets the event of the node (destination) corresponding to the timing.
856 Event is SIM_FALL or SIM_RISE.
858 sim_GetTimingNodeEvent returns an event.
862 extern char sim_GetTimingNodeEvent (Timing
*timing
);
868 After a simulation run, sim_NoiseExtract extracts the maximum noise on a node between
870 The initial time (tinit) and the tfinal time (tfinal) represent the timing bounds
872 vthnoise is the threshold voltage to extract noise (percentage of vdd).
878 extern void sim_NoiseExtract (SimulationContext
*sc
, char *node
, double vthnoise
, double tinit
, double tfinal
);
884 sim_NoiseGetVth gets the noise threshold voltage on the node 'name'.
890 extern double sim_NoiseGetVth (SimulationContext
*sc
, char *name
);
893 MAN sim_NoiseGetPeakList
896 sim_NoiseGetPeakList gets a list of peaks relatively to node 'name'.
898 sim_NoiseGetPeakList returns a 'List'.
902 extern List
*sim_NoiseGetPeakList (SimulationContext
*sc
, char *name
);
905 MAN sim_NoiseGetMomentList
908 sim_NoiseGetMomentList gets a list of moment of passage on noise threshold
909 voltage relatively to node 'name'.
911 sim_NoiseGetMomentList returns a 'List'.
915 extern List
*sim_NoiseGetMomentList (SimulationContext
*sc
, char *name
);
918 MAN sim_NoiseGetMoment
921 sim_NoiseGetMoment gets a the moment of passage on noise threshold
922 voltage from a pointer on a pointer list returned by sim_NoiseGetMomentList.
924 sim_NoiseGetMoment returns a moment.
928 extern double sim_NoiseGetMoment (SimulationContext
*sc
, List
*noise_tclist
);
931 MAN sim_NoiseGetPeakValue
934 sim_NoiseGetPeakValue gets the peak value (voltage) relatively to the node 'name' and a pointer
935 on a List returned by sim_NoiseGetPeakList.
937 sim_NoiseGetPeakValue returns a voltage.
941 extern double sim_NoiseGetPeakValue (SimulationContext
*sc
, char *name
,List
*noise_peaklist
);
944 MAN sim_NoiseGetPeakMoment
947 sim_NoiseGetPeakMoment gets the peak moment relatively to a pointer
948 on a List returned by sim_NoiseGetPeakList.
950 sim_NoiseGetPeakMoment returns a moment (time).
954 extern double sim_NoiseGetPeakMoment (SimulationContext
*sc
, List
*noise_peaklist
);
957 MAN sim_NoiseExtractMaxPeakValue
960 sim_NoiseExtractMaxPeakValue gets the maximum peak value relatively to the node 'name'.
962 sim_NoiseExtractMaxPeakValue returns a voltage.
966 extern double sim_NoiseExtractMaxPeakValue (SimulationContext
*sc
, char *name
);
969 MAN sim_NoiseExtractMinPeakValue
972 sim_NoiseExtractMinPeakValue gets the minimum peak value relatively to the node 'name'.
974 sim_NoiseExtractMinPeakValue returns a voltage.
978 extern double sim_NoiseExtractMinPeakValue (SimulationContext
*sc
, char *name
);
981 MAN sim_NoiseExtractMaxPeakMoment
984 sim_NoiseExtractMaxPeakMoment gets the moment of the maximum peak relatively to the node 'name'.
986 sim_NoiseExtractMaxPeakMoment returns a moment.
990 extern double sim_NoiseExtractMaxPeakMoment (SimulationContext
*sc
, char *name
);
993 MAN sim_NoiseExtractMinPeakMoment
996 sim_NoiseExtractMinPeakMoment gets the moment of the minimum peak relatively to the node 'name'.
998 sim_NoiseExtractMinPeakMoment returns a moment.
1002 extern double sim_NoiseExtractMinPeakMoment (SimulationContext
*sc
, char *name
);
1005 MAN sim_NoiseGetMomentBeforePeak
1008 sim_NoiseGetMomentBeforePeak gets the moment of passage on noise threshold voltage
1009 relatively to node 'name' and before a peak which is a pointer on a List returned by sim_NoiseGetPeakList.
1011 sim_NoiseGetMomentBeforePeak returns a moment.
1015 extern double sim_NoiseGetMomentBeforePeak (SimulationContext
*sc
, char *name
,List
*peak
);
1018 MAN sim_NoiseGetMomentAfterPeak
1021 sim_NoiseGetMomentAfterPeak gets the moment of passage on noise threshold voltage
1022 relatively to node 'name' and after a peak which is a pointer on a List returned by sim_NoiseGetPeakList.
1024 sim_NoiseGetMomentAfterPeak returns a moment.
1028 extern double sim_NoiseGetMomentAfterPeak (SimulationContext
*sc
, char *name
,List
*peak
);
1031 MAN sim_NoiseGetPeakDuration.
1034 sim_NoiseGetPeakDuration gets the duration of a peak which is a pointer on a
1035 List returned by sim_NoiseGetPeakList.
1037 sim_NoiseGetPeakDuration returns a duration.
1041 extern double sim_NoiseGetPeakDuration (SimulationContext
*sc
, char *name
,List
*peak
);
1044 MAN sim_NoiseExtractMomentBeforeMaxPeak.
1047 sim_NoiseExtractMomentBeforeMaxPeak extracts the moment of passage on noise threshold voltage
1048 before the maximum peak relatively to node 'name'.
1050 sim_NoiseExtractMomentBeforeMaxPeak returns a moment.
1054 extern double sim_NoiseExtractMomentBeforeMaxPeak (SimulationContext
*sc
, char *name
);
1057 MAN sim_NoiseExtractMomentBeforeMinPeak.
1060 sim_NoiseExtractMomentBeforeMinPeak extracts the moment of passage on noise threshold voltage
1061 before the minimum peak relatively to node 'name'.
1063 sim_NoiseExtractMomentBeforeMinPeak returns a moment.
1067 extern double sim_NoiseExtractMomentBeforeMinPeak (SimulationContext
*sc
, char *name
);
1070 MAN sim_NoiseExtractMomentAfterMaxPeak.
1073 sim_NoiseExtractMomentAfterMaxPeak extracts the moment of passage on noise threshold voltage
1074 after the maximum peak relatively to node 'name'.
1076 sim_NoiseExtractMomentAfterMaxPeak returns a moment.
1080 extern double sim_NoiseExtractMomentAfterMaxPeak (SimulationContext
*sc
, char *name
);
1083 MAN sim_NoiseExtractMomentAfterMinPeak.
1086 sim_NoiseExtractMomentAfterMinPeak extracts the moment of passage on noise threshold voltage
1087 after the minimum peak relatively to node 'name'.
1089 sim_NoiseExtractMomentAfterMinPeak returns a moment.
1093 extern double sim_NoiseExtractMomentAfterMinPeak (SimulationContext
*sc
, char *name
);
1096 MAN sim_NoiseExtractMaxPeakDuration.
1099 sim_NoiseExtractMaxPeakDuration extracts the duration of the maximum peak relatively to node 'name'.
1101 sim_NoiseExtractMaxPeakDuration returns a duration.
1105 extern double sim_NoiseExtractMaxPeakDuration (SimulationContext
*sc
, char *name
);
1108 MAN sim_NoiseExtractMinPeakDuration.
1111 sim_NoiseExtractMinPeakDuration extracts the duration of the minimum peak relatively to node 'name'.
1113 sim_NoiseExtractMinPeakDuration returns a duration.
1117 extern double sim_NoiseExtractMinPeakDuration (SimulationContext
*sc
, char *name
);
1123 sim_DriveLut drives a look up table of delays, X-axis correspond to slew variations and
1124 Y-axis correspond to load variations.
1125 'lcin' is the name of the input connector, 'lcout' is the name of the output connector.
1126 'transition' is the expected transition between 'lcin' and 'lcout'.
1127 'slew_range' is a list of slew, 'load_range' is a list of load.
1133 //extern void sim_DriveLut (SimulationContext *sc, char *lcin, char *lcout, char *transition, List *slew_range, List *load_range);
1136 MAN sim_DriveNodeState
1139 sim_DriveNodeState drives successives states of the 'node_state2drive' in the file 'filename'
1140 (which also contains file's extension). 'node_ref' is the node reference, 'type' can be
1141 SIM_RISE or SIM_FALL and represents the event on 'node_ref' which will sample 'node_state2drive'.
1147 extern void sim_DriveNodeState (SimulationContext
*sc
, char *filename
,char *node_ref
,char *node_state2drive
,char type
);
1150 MAN sim_ExtractCommutInstant
1153 sim_ExtractCommutInstant extract the first instant when the node reach the
1154 voltage value 'voltage'.
1160 extern double sim_ExtractCommutInstant (SimulationContext
*sc
, char *node
,double voltage
);
1164 MAN sim_DriveTransistorAsInstance
1167 sim_DriveTransistorAsInstance(<context>, <mode>) indicates is the transistor should be driven as instances.
1169 eg. M124 src grid drain bulk ... => XM124 src grid drain bulk ...
1171 the value for mode is 'y' to enable the transformation else 'n'
1177 extern void sim_DriveTransistorAsInstance (SimulationContext
*sc
, char mode
);
1179 extern Netlist
*sim_GetNetlist (char *name
);
1186 sim_SaveContext(<context>, <label>) duplicate the <context> so the simulation initial conditions can be stored for automatic resimulations. The resulting simulation context is generaly used when creation timing lines who can be recomputed dynamically during a stability analysis process for instance. If label!=NULL, it can be used to retrieve the saved simulation context.
1188 returns a `SimulationContext *'.
1192 sim_GetSavedContext, sim_AddAlias
1194 //extern SimulationContext *sim_SaveContext (SimulationContext *sc, char *label);
1198 MAN sim_GetSavedContext
1201 sim_GetSavedContext(<context>, <label>) returns a previously saved simulation context. If the context if not found, NULL is returned.
1203 returns a `SimulationContext *'.
1207 sim_SaveContext, sim_AddAlias
1209 //extern SimulationContext *sim_GetSavedContext(SimulationContext *src, char *label);
1216 sim_AddAlias(<context>, <src>, <dest>) create a signal alias. The effect is to translate all the simulation delay or slope computation from one signal to another. This function is very usefull when only one simulation is used to compute the delay or slope for a range of signal. When automatically recomputing the timing line delay for com(2) for instance, is com(2) is aliased to com(1), com(1) will be used to compute the delay or slope.
1224 //void sim_AddAlias(SimulationContext *sc, char *source, char *destination);
1227 void SET_CONTEXT(SimulationContext
*sc
);
1228 SimulationContext
*GET_CONTEXT();
1232 MAN sim_AddSpiceMeasure
1241 void sim_AddSpiceMeasure(SimulationContext
*sc
, char *delay
, char *slope
, char *sig1
, char *sig2
, char *transition
, char delay_type
);
1243 MAN sim_AddSpiceMeasureSlope
1246 Add a slope measure of sig that can be extracted by the
1248 Transition is a string containing the transition of sig.
1249 Tolerated transition are 'U' and 'D'.
1250 The <delay_type> can be SIM_MIN or SIM_MAX meaning the node choosen to compute the delay or the slope
1251 is the closer or the farther one.
1258 void sim_AddSpiceMeasureSlope(SimulationContext
*sc
, char *slope
, char *sig
, char *transition
, char delay_type
);
1260 MAN sim_AddSpiceMeasureDelay
1263 Add a measure of delay between sig1 and sig2 that can be extracted by the
1265 Transition is a string containing the transition of sig1 and sig2.
1266 The <delay_type> can be SIM_MIN or SIM_MAX meaning the node choosen to compute the delay or the slope
1267 is the closer or the farther one.
1268 Tolerated transition are 'U' and 'D'.
1275 void sim_AddSpiceMeasureDelay(SimulationContext
*sc
, char *delay
, char *sig1
, char *sig2
, char *transition
, char delay_type
);
1280 Reads the simulation results from {filename} and return the value corresponding to the measure {label}.
1281 On failure, returns {-1}.
1283 returns -1 on failure.
1288 double sim_ReadMeasure(char *filename
, char *label
);
1291 MAN sim_ResetMeasures
1294 Resets all the measures set in the simulation context.
1296 void sim_ResetMeasures(SimulationContext
*model
);
1298 //int sim_GetSpiceMeasure(SimulationContext *sc, char *label, double *value);
1300 MAN sim_GetSpiceMeasureSlope
1303 Returns the slope computed for the label, 0.0 if slope has not been computed.
1309 double sim_GetSpiceMeasureSlope(SimulationContext
*model
, char *label
);
1311 MAN sim_GetSpiceMeasureDelay
1314 Returns the delay computed for the label, 0.0 if delay has not been computed.
1322 double sim_GetSpiceMeasureDelay(SimulationContext
*model
, char *label
);
1325 MAN sim_SpiceMeasure
1328 Add a delay measure between sig1 and sig2 that can be extracted by the
1330 Add a slope measure of sig that can be extracted by the
1332 Transition is a string containing the transition of sig1 and sig2.
1333 Tolerated transition are 'U' and 'D'.
1334 The <delay_type> can be SIM_MIN or SIM_MAX meaning the node choosen to compute the delay or the slope
1335 is the closer or the farther one.
1336 After simulation completed get the delay and the slope computed
1337 for each label and store it into the adress pointed by valued(delay)
1344 sim_SpiceMeasureDelay, sim_SpiceMeasureSlope
1346 void sim_SpiceMeasure(SimulationContext
*model
, char *delay
, double *valued
, char *slope
, double *values
, char *sig1
, char *sig2
, char *transition
, char delay_type
);
1349 MAN sim_SpiceMeasureDelay
1352 Add a measure of delay between sig1 and sig2 that can be extracted by the
1354 Transition is a string containing the transition of sig1 and sig2.
1355 Tolerated transition are 'U' and 'D'.
1356 The <delay_type> can be SIM_MIN or SIM_MAX meaning the node choosen to compute the delay or the slope
1357 is the closer or the farther one.
1358 After simulation completed get the delay computed for the label
1359 and store it into the adress pointed by value.
1366 void sim_SpiceMeasureDelay(SimulationContext
*model
, char *delay
, double *value
, char *sig1
, char *sig2
, char *transition
, char delay_type
);
1369 MAN sim_SpiceMeasureSlope
1372 Add a slope measure of sig that can be extracted by the
1374 Transition is a string containing the transition of sig.
1375 Tolerated transition are 'U' and 'D'.
1376 The <delay_type> can be SIM_MIN or SIM_MAX meaning the node choosen to compute the delay or the slope
1377 is the closer or the farther one.
1378 After simulation completed get the slope computed for the label
1379 and store it into the adress pointed by value.
1386 void sim_SpiceMeasureSlope(SimulationContext
*model
, char *slope
, double *value
, char *sig
, char *transition
, char delay_type
);
1388 void sim_DumpDelayDetail(SimulationContext
*model
, char *name1
, char *name2
, char *transition
, FILE *f
);
1390 void sim_RenameModel(SimulationContext
*sc
, char *name
);
1392 double sim_SpreadRC(SimulationContext
*sc
, char *input
, char *output
, char *dir
, double input_delay
, double delta_delay
);
1395 MAN sim_DefineInclude
1398 Sets the filename containing the netlist to apply the pattern to. When this option is used, the gns rule netlist won't be used for the simulation. It will be replaced by the external file given in <filename> at the simulation time.
1402 void sim_DefineInclude(SimulationContext
*sc
, char *filename
);
1405 MAN cpe_DefineCorrelation
1408 cpe_DefineCorrelation <net1> <relation> <net2>\$
1410 Defines the relation between 2 signals to help computing propagation condition for simulations.
1412 net1 % First net name.
1413 relation % Value '{=}' means {net1}={net2}\$ Value '{!=}' means {net1}=not({net2})
1414 net2 % Second net name.
1415 EXAMPLE % {cpe_DefineCorrelation clk != clkb}
1417 void cpe_DefineCorrelation(void);