The gen_builtin_funtions API provides a set of basic functions useful in GNS actions which need to generate output files.
char *char_to_string(int size, char caract) |
|
char_to_string create a string which length is 'size'. The string is filled with
the caracter 'caract'.
|
|
|
|
char *onehot_to_bit(int size, int bitnum) |
|
onehot_to_bit(size, bitnum) returns a binary string whose length is 'size'. The
string represents a binary value where bit number 'bitnum' is set to 1 and the others
to 0. The 'bitnum' is little endian oriented.
|
|
|
|
char *onehot_to_hexa(int size, int bitnum) |
|
onehot_to_hexa(size, bitnum) returns a hexadecimal string whose length is 'size'.
The string represents a hexadecimal value where bit number 'bitnum' is set to 1 and
the others to 0. The 'bitnum' is little endian oriented.
|
|
|
|
char *onehot_to_octa(int size, int bitnum) |
|
onehot_to_octa(size, bitnum) returns an octal string whose length is 'size'. The
string represents an octal value where bit number 'bitnum' is set to 1 and the others
to 0. The 'bitnum' is little endian oriented.
|
|
|
|
char *onecold_to_bit(int size, int bitnum) |
|
onecold_to_bit(size, bitnum) returns a binary string whose length is 'size'. The
string represents a binary value where bit number 'bitnum' is set to 0 and the others
to 1. The 'bitnum' is little endian oriented.
|
|
|
|
char *onecold_to_hexa(int size, int bitnum) |
|
onecold_to_hexa(size, bitnum) returns a hexadecimal string whose length is 'size'.
The string represents a hexadecimal value where bit number 'bitnum' is set to 0 and
the others to 1. The 'bitnum' is little endian oriented.
|
|
|
|
char *onecold_to_octa(int size, int bitnum) |
|
onecold_to_octa(size, bitnum) returns an octal string whose length is 'size'. The
string represents an octal value where bit number 'bitnum' is set to 0 and the others
to 1. The 'bitnum' is little endian oriented.
|
|
|
|
char *genius_date() |
|
genius_date() return a string containing the current date and time.
|
|
|
|
int gns_ModelVisited(char *name) |
|
gns_ModelVisited(<name>) returns 0 if the model <name> has been set as visited thru
the function gns_MarkModelVisited.
|
|
|
|
void gns_MarkModelVisited(char *name) |
|
gns_MarkModelVisited(<name>) adds <name> in the list of model already visited.
|
|
|
The FCL API allows the user to use GNS actions to generate all the transistor netlist markings of the FCL transistor recognition module.
The markings available for the signals are the following ones:
NET_LATCH | |
Signal corresponds to a latch memory-point. | |
NET_FLIPFLOP | |
Signal corresponds to a flip-flop memory-point. | |
NET_MASTER | |
Signal corresponds to the master memory-point of a flip-flop. | |
NET_SLAVE | |
Signal corresponds to the slave memory-point of a flip-flop. | |
NET_MEMSYM | |
Signal corresponds to one side of a symmetric memory. | |
NET_RS | |
Signal corresponds to one side of an RS bistable. | |
NET_VDD | |
Signal corresponds to an alimentation. | |
NET_VSS | |
Signal corresponds to ground. | |
NET_BLOCKER | |
No branch of a cone (see man gns) can go through the signal. | |
NET_STOP | |
Cannot exploit logic beyond this point for functional analysis in the disassembler. | |
NET_BYPASS | |
Signal cannot appear in a timing path. | |
NET_MATCHNAME | |
The signal is only matched if the name in the pattern to recognize and the name in the source netlist are identical. | |
NET_SENSITIVE | |
Marks the signal as a particularly sensitive signal. If a timed behavioral model of this signal is produced then the most precise (but cumbersome) model will be generated. |
The markings available for the transistors are the following ones:
TRANS_BLEEDER | |
Transistor corresponds to a bleeder. | |
TRANS_FEEDBACK | |
Transistor corresponds to a feedback transistor of a memory-point. | |
TRANS_COMMAND | |
Transistor corresponds to a command transistor of a memory-point, i.e driven by command signal. | |
TRANS_NOT_FUNCTIONAL | |
Transistor should be ignored when calculating gate functionality. | |
TRANS_BLOCKER | |
No branch of a cone can contain this transistor unless it is the first transistor of the branch. | |
TRANS_UNUSED | |
No branch of a cone can contain this transistor. | |
TRANS_SHORT | |
The transistor is considered short-circuited, the gate signal no longer contributes to the list of inputs. | |
TRANS_MATCHSIZE | |
The transistor is only matched if the dimensions correspond exactly or to within a given tolerance (see FCL configuration). | |
TRANS_SHARE | |
The transistor can be matched by several patterns. |
int fclMarkCorrespondingSignal(char *signame, char *marks) |
|
fclMarkSignal marks a signal in the circuit according to the given marking string.
|
|
|
|
int fclMarkCorrespondingTransistor(char *transname, char *marks) |
|
fclMarkTransistor marks a transistor in the circuit according to the given marking
string.
|
|
|
|
void fclOrientCorrespondingSignal(char *signame, int level) |
|
fclOrientSignal orients a signal according to the given output level.
|
|
|
|
void fclCmpUpConstraint(StringList *siglist) |
|
Specifies that one and only one of the signals in the list can be high.
|
|
|
|
void fclCmpDnConstraint(StringList *siglist) |
|
Specifies that one and only one of the signals in the list can be low.
|
|
|
|
void fclMuxUpConstraint(StringList *siglist) |
|
Specifies that at most one of the signals in the list can be high.
|
|
|
|
void fclMuxDnConstraint(StringList *siglist) |
|
Specifies that at most one of the signals in the list can be low.
|
|
|
|
void fclAllowShare(Transistor *transistor) |
|
Specifies that the given transistor can be shared with another transistor level
model.
|
|
|
The GEN API provides a set of functions useful in GNS actions which need to obtain correspondence information between the hierarchical netlist generated by the GNS recognition module and the original circuit.
void gns_StripNetlist(Netlist *netlist) |
|
Suppresses all unconnected RC networks. This function is very useful after using netlist
reduction.
|
|
|
|
void gns_StripNetlistFurther(Netlist *netlist) |
|
Suppresses all unconnected RC networks *AND* connectors. This function is very useful
after using netlist reduction.
|
|
|
|
void gns_SetLoad(Netlist *netlist, char *connector, double load) |
|
Sets an additional capacitance on the connector `connector'.
This function should be primarily used for characterization purposes.
Further call of gns_SetLoad overrides previous characterization capacitance setting.
|
|
|
|
Netlist *gns_FlattenNetlist(Netlist *netlist, int rc) |
|
Flattens the given netlist to the transistor level or to a cell level.
The cell levels can be specified by using gns_SetModelAsLeaf(<modelname>) where model
name is the cell name.
The RC information can be added by specifying the flags whose value can be INTERNAL_RC,
IN_RC, OUT_RC, ALL_RC or 0.
Those values can be ORed.
In most cases, the returned netlist must be freed by the user. |
|
|
|
void gns_FreeNetlist(Netlist *netlist) |
|
Deletes a Netlist. It should not be called on a netlist obtained with gns_GetNetlist().
|
|
|
|
Netlist *gns_AddRC(Netlist *netlist, int rc) |
|
Adds the RC information in the current netlist.
The flags whose value can be INTERNAL_RC, IN_RC, OUT_RC, ALL_RC or 0 indicates where
the RC should be added. Those values can be ORed.
In most cases, the returned netlist must be freed by the user. |
|
|
|
void gns_SetModelAsLeaf(char *name) |
|
Adds the model <name> to the list of models for which the flatten process won't flat
the instances to transistor level. In the flattened netlist should appear the instances
whose model is <name>. Beware, the leaf model <name> will be taken into account for
all the flatten process. To clear the list of leaves, use gns_SetModelAsLeaf(NULL).
|
|
|
|
void gns_ReduceInstance(Netlist *netlist, char *ins_name) |
|
Reduces an instance to the corresponding capacitances of its interface pins.
|
|
|
|
void gns_KeepInstance(Netlist *fig, char *ins_name) |
|
Keeps an instance from a reducing process.
|
|
|
|
void gns_AddExternalTransistors(char *str) |
|
Allows the user to choice between two possibilities of representation
of external transistors connected to an output pin. When the parameter 'str' is set
to 'dynamic', capacitances are extracted from the grid, source or drain of the
external transistor, and added into the netlist. When the parameter 'str' is set
to 'transistor', the external transistors are added into the netlist, and the transistor's
connectors that are not connected to the pin, are connected either to 'gnd' or 'vdd',
in a way that they always remain non-passant.
|
|
|
|
void gns_ViewLo(Netlist *ptfig) |
|
Displays debugging information about the netlist. Information
is displayed on stdout.
|
|
|
|
void gns_DriveNetlist(Netlist *ptfig, char *format, char *path, char *name) |
|
Drives the netlist in path with the specified format. <format> can be "spice". The
filename will be <name>.EXT where EXT depends on the <format> and the figure name
in the file will be <name>.
|
|
|
|
Netlist *gns_GetNetlist() |
|
Returns the netlist corresponding with the currently recognized model.
PS: this netlist must not be freed.
|
|
|
|
Netlist *gns_DuplicateNetlist(Netlist *source) |
|
Duplicates the netlist <source>. The copied netlist should be freed later.
|
|
|
|
Netlist *gns_GetInstanceNetlist(char *name) |
|
Returns the netlist corresponding with a recognized instance used in the current hierarchy.
<name> can be hierarchical.
PS: this netlist should be freed.
|
|
|
|
Signal *gns_GetCorrespondingSignal(char *name) |
|
Returns the signal in the circuit corresponding to a
signal in the model.
|
|
|
|
char *gns_GetSignalName(Signal *signal) |
|
Returns the name of a signal. When used with a signal in the
model, there will not be any information about the signal index range in the
returned string.
|
|
|
|
char *gns_GetInstanceName(Instance *instance) |
|
Returns the name of an instance.
|
|
|
|
char *gns_GetInstanceModelName(Instance *instance) |
|
Returns the name of the model of an instance in the
circuit.
|
|
|
|
void gns_GetModelSignalRange(char *name, int *left, int *right) |
|
Returns the index range of a signal in the model. If
left = -1, the signal is not a vector. If <left> < <right> then the signal is
range is left to right else if <left> > <right> then the signal range is left
downto right.
|
|
|
|
List *gns_GetModelConnectorList() |
|
Returns the list of all the interface connectors of the model.
|
|
|
|
Connector *gns_GetInstanceConnector(Instance *instance, char *name) |
|
Returns the connector <name> of <instance> the model.
|
|
|
|
Instance *gns_GetInstance(Netlist *netlist, char *name) |
|
Returns the instance <name> present in <netlist>.
|
|
|
|
double gns_GetConnectorCapa(Connector *lc) |
|
Returns the computed capacitance of the connector `lc'. This
capacitance is the sum of all capacitances corresponding with the drain, grid or
source connectors linked to `lc'.
the model.
|
|
|
|
List *gns_GetConnectorList(Netlist *netlist) |
|
Returns the list of all the interface connectors of the netlist.
|
|
|
|
char *gns_GetConnectorDirection(Connector *connector) |
|
Returns the direction of a connector.
|
|
|
|
char *gns_GetConnectorName(Connector *connector) |
|
Returns the name of a connector.
|
|
|
|
Signal *gns_GetConnectorSignal(Connector *connector) |
|
Returns the signal linked to the connector.
|
|
|
|
List *gns_GetModelSignalList() |
|
Returns the list of all the signal in the model.
|
|
|
|
int gns_IsSignalExternal(Signal *signal) |
|
Returns 1 if the signal is linked to a connector in the
interface, 0 otherwise.
|
|
|
|
char *gns_Vectorize(char *name, int index) |
|
Returns a string containing the name associated with a vector
index : name(index).
|
|
|
|
char *gns_Vectorize2D(char *name, int index0, int index1) |
|
Returns a string containing the name associated
with a 2 vector index : name(index1)(index2).
|
|
|
|
List *gns_GetInstanceConnectorList(Instance *ls) |
|
Returns the list of all the connectors of an instance.
|
|
|
|
List *gns_GetAllCorrespondingInstances() |
|
Returns the list of all the instances in the
circuit used when matching the model.
|
|
|
|
List *gns_GetAllCorrespondingInstanceModels() |
|
Returns the list of all the models in
the circuit used when matching the model.
|
|
|
|
Transistor *gns_GetCorrespondingTransistor(char *name) |
|
Returns the transistor in the circuit corresponding
to a transistor instance in the model.
|
|
|
|
List *gns_GetAllCorrespondingTransistors() |
|
Returns the list of all the transistors in
the circuit used when matching the model.
|
|
|
|
Connector *gns_GetTransistorGrid(Transistor *transistor) |
|
Returns grid connector of a transistor.
|
|
|
|
Connector *gns_GetTransistorDrain(Transistor *transistor) |
|
Returns grid connector of a transistor.
|
|
|
|
Connector *gns_GetTransistorSource(Transistor *transistor) |
|
Returns source connector of a transistor.
|
|
|
|
char gns_GetTransistorType(Transistor *transistor) |
|
Returns the type of a transistor.
|
|
|
|
char *gns_GetTransistorTypeName(Transistor *transistor) |
|
Returns the circuit type of a transistor.
|
|
|
|
double gns_GetTransistorParameter(char *name, Transistor *transistor) |
|
Returns the value of a transistor parameter.
<name> can be "w", "l", "as", "ad", "ps" or "pd".
|
|
|
|
char *gns_GetTransistorName(Transistor *transistor) |
|
Returns the name of a transistor.
|
|
|
|
List *gns_GetAllTransistorsConnectedtoSignal(Signal *signal) |
|
Returns the list of all the transistors
in the circuit connected to the given signal at the current step of genius recognition.
|
|
|
|
int gns_VectorIndex(char *name) |
|
Returns the index in a signal name. If the signal is not
a vector, the value returned is -1.
|
|
|
|
char *gns_VectorRadical(char *name) |
|
Returns the base name of a signal name. The basic action
is to remove the index from a vector name.
|
|
|
|
char *gns_CreateVhdlName(char *name) |
|
Returns transforms <name> so it is suitable for a
VHDL syntaxe.
|
|
|
|
void gns_ChangeInstanceModelName(Instance *instance, char *name) |
|
Changes the model name of a recognized
instance. If instance is NULL, the new name is applied to the current instance.
|
|
|
|
Signal *gns_GetSignal(Netlist *netlist, char *signame) |
|
Retrieves the signal 'signame' in the netlist 'netlist'.
The netlist maybe either flat or hierarchical. To retrieve
a signal in a hierarchical netlist, one must provide a hierarchical name,
i.e containing the successives instances separated with dots.
For example, the signal 'ins1.ins2.sig' describes the signal 'sig' in the
instance 'ins2', the instance 'ins2' being contained in the instance 'ins1'.
|
|
|
|
Connector *gns_GetConnector(Netlist *netlist, char *con_name) |
|
Retrieves the connector 'conname' in the netlist 'netlist'.
|
|
|
|
Transistor *gns_GetTransistor(Netlist *netlist, char *tr_name) |
|
Retrieves the transistor 'con_name' in the netlist 'netlist'.
|
|
|
|
char *gns_AWE_GetWorstInstance(Netlist *netlist, char *insname, Connector *lc, double
vdd) |
|
Retrieves the worst instance (worst AWE delay)
which is connected to the connector 'lc'.
'netlist' is the hierarchical netlist.
'insname' is the generic name of the instance to reduce.
For example, if the netlist contains "mem_cell.0", "mem_cell.1", "mem_cell.2" ...
'insname' is "mem_cell"
'vdd' is the value of power supply needed to compute AWE delays.
|
|
|
|
char *gns_AWE_GetBestInstance(Netlist *netlist, char *insname, Connector *lc, double
vdd) |
|
Retrieves the best instance (worst AWE delay)
which is connected to the connector 'lc'.
'netlist' is the hierarchical netlist.
'insname' is the generic name of the instance to reduce.
|
|
|
|
Netlist *gns_AWE_KeepBestInstance(Netlist *netlist, Netlist *flatnetlist, char *insname,
Connector *lc, double vdd) |
|
Keeps the best instance (best AWE delay)
which is connected to the connector 'lc', the other instance are reduced.
'netlist' is the hierarchical netlist, 'flatnetlist' is the flattened netlist.
'insname' is the generic name of the instance to reduce.
For example, if the netlist contains "mem_cell.0", "mem_cell.1", "mem_cell.2" ...
'insname' is "mem_cell"
'vdd' is the value of power supply needed to compute AWE delays.
|
|
|
|
Netlist *gns_AWE_KeepWorstInstance(Netlist *netlist, Netlist *flatnetlist, char *insname,
Connector *lc, double vdd) |
|
Keeps the worst instance (worst AWE delay)
which is connected to the connector 'lc', the other instance are reduced.
'netlist' is the hierarchical netlist, 'flatnetlist' is the flattened netlist.
'insname' is the generic name of the instance to reduce.
For example, if the netlist contains "mem_cell.0", "mem_cell.1", "mem_cell.2" ...
'insname' is "mem_cell"
'vdd' is the value of power supply needed to compute AWE delays.
|
|
|
|
void gns_AWE_GetOrderedInstanceIndex(Netlist *lofig, char *rule, Connector *connector,
int **tab, int *nb) |
|
Creates and fills an array with the index of the instances on the signal connected
to <connector>. The Instances are ordered with respect to their delay versus connector
<connector>.
The <rule> defines how to retreive the instance index from the instance name. The
'?' in the rule is the number desired. eg. "bitline(?).low(5).latch".
|
|
|
|
int gns_GetInstanceLoopIndex(Instance *ins, char **ptptname) |
|
Returns the index of <instance> and if <radical>!=NULL, fetch <radical> with the name
of the instance in the model.
|
|
|
|
void gns_GetInstanceLoopRange(Netlist *lf, Instance *ins, int *left, int *right) |
|
Returns the <left> and <right> range value of instances in a loop where <instance>
is one of those instances. If <instance> is not in a loop, both <left> and <right>
are assigned -1.
|
|
|
|
CorrespondingInstance *gns_GetCorrespondingInstance(char *name) |
|
Returns the instance in the circuit corresponding to an instance in the model. An
instance in a loop can be referenced using the instance name vectorized. <name> can
be hierarchical.
|
|
|
|
Signal *gns_GetCorrespondingInstanceConnectorSignal(CorrespondingInstance *ins, char
*name) |
|
Returns the signal connected to the connector <name> of <instance>.
|
|
|
|
char *gns_GetCorrespondingInstanceName(CorrespondingInstance *crt) |
|
Returns the name given by YagleGNS to a recognized instance.
|
|
|
|
int gns_GetGeneric(char *name) |
|
Returns the integer value of a generic variable in the current instance.
|
|
|
|
char *gns_GetCurrentArchi() |
|
Returns the architecture name of the current instance.
|
|
|
|
char *gns_GetCurrentModel() |
|
Returns the model name of the current instance.
|
|
|
|
char *gns_GetCurrentInstance() |
|
Returns the name of the current instance.
|
|
|
|
void *callfunc(char *funcname, ... ) |
|
Generates a function call. The number of arguments is variable. When the results of
'callfunc' is used, <funcname> will be called with the given arguments.
|
|
|
|
void gns_DriveSpiceNetlistGroup(List *list, char *filename) |
|
Saves the <list> of netlist in <filename> using the spice format.
|
|
|
|
void gns_AddCapa(Netlist *fig, char *con_name, double capa) |
|
Add <capa> between <con_name> member of <netlist> and the ground.
|
|
|
|
void gns_AddResi(Netlist *fig, char *con1_name, char *con2_name, double resi) |
|
Add <resi> between <con1_name> and <con2_name> member of <netlist>.
|
|
|
|
void gns_AddLineRC(Netlist *fig, char *con1_name, char *con2_name, double resi, double
capa1, double capa2) |
|
Add <resi> between <con1_name> and <con2_name> member of <netlist>. Add <capa(n)>
to <con(n)_name>
|
|
|
|
GNSRun *gns_RunGNS(Netlist *netlist, char *celldir, char *libname) |
|
Initiate a GNS recognition on the specified netlist. <dir> is the directory where
to search for GNS rules and actions. <lib> is the library file describing the rules
and actions to use. If they are set to NULL, befault directory and library file will
be used.
|
|
|
|
void gns_DestroyGNSRun(GNSRun *afg) |
|
Destroys the <gnsrun>.
|
|
|
|
void gns_EnterGNSContext(GNSRun *gnsrun, char *instance) |
|
Changes GNS environment to match the one of <instance_name> in the <gnsrun>. The old
environment is pushed into a stack. It can be retreive (poped) using gns_ExitGNSContext().
|
|
|
|
void gns_ExitGNSContext() |
|
Changes GNS environment to the previous one.
|
|
|
|
Netlist *gns_GetBlackboxNetlist(char *name) |
|
Returns the Netlist <name>. The Netlist is searched in the main netlist.
|
|
|
|
int gns_IsTopLevel() |
|
Indicates if the current instance if a top level of genius recognition.
|
|
|
|
void gns_RenameInstanceFigure(Netlist *lf, char *instance, char *origname, char *newname) |
|
Changes the figure name of <instance> in <netlist>. The <original figure name> is
replaced by <new figure name>. If instance is NULL, all instances will be checked
for a figure name change.
|
|
|
|
void gns_FillBlackBoxes(Netlist *lf, List *morenetlist) |
|
Will try to retreive the blackbox figures from the list of netlist <modellist> then
in the original netlist, flatten the <netlist> blackbox instances to transistor level.
The <modellist> is not freed.
|
|
|
|
void gns_ChangeNetlistName(Netlist *lf, char *name) |
|
Changes the name of the netlist <netlist> by <name>.
|
|
|
|
List *gns_GetGNSTopLevels(GNSRun *gnsrun) |
|
Returns the list of all the instances at the top level of the <gnsrun>. Each element
of the list is a string containing an instance name.
|
|
|
|
Netlist *gns_CutNetlist(GNSRun *gnsrun) |
|
Returns a new netlist where the instances recognized at top level of <gnsrun> are
cut. For each of those instances, a new figure at transistor level is also created
and instanciated in the returned netlist. Concerning the parasitics, all couplings
between blocks are put to ground and depending on the connector direction or user
which, the RC trees are put inside or outside the instances.
|
|
|
|
void gns_ShowOutsideInfo(char *signame, FILE *f) |
|
Drives the connections of signal <signal> outside of the GNS instance. The result
is put in file <file>.
|
|
|
|
void gns_REJECT_INSTANCE() |
|
If called will result in the exclusion of the current instance from the instances
to keep at the top level. This option overrides the GNS LIBRARY file settings.
|
|
|
|
void gns_KEEP_INSTANCE() |
|
If called will result in the inclusion of the current instance in the instances to
keep at the top level. This option overrides the GNS LIBRARY file settings.
|
|
|
|
void gns_REJECT_MODEL() |
|
If called will result in the exclusion of all the instances of the current instance
model from the instances to keep at the top level. This option overrides the GNS LIBRARY
file settings.
|
|
|
|
void gns_KEEP_MODEL() |
|
If called then all the instances of the current instance model are kept at the top
level. This option overrides the GNS LIBRARY file settings.
|
|
|
|
char *gns_GetWorkingFigureName() |
|
Returns the name of the figure the GNS recognition is working on.
|
|
|
|
int gns_IsVss(Signal *sig) |
|
Returns 1 if the signal <sig> is a vss alim signal, 0 otherwise.
|
|
|
|
int gns_IsVdd(Signal *sig) |
|
Returns 1 if the signal <sig> is a vdd alim signal, 0 otherwise.
|
|
|
|
int gns_IsBlackBox() |
|
Returns 1 if the netlist corresponding with the current instance is a blackbox, 0
otherwise.
|
|
|
|
double gns_GetSignalVoltage(char *name) |
|
Returns the value of the voltage source set on the signal name. name is by delault a genius model signal name but if prefixed with 'ext:' the signal is
considered to be in the original netlist.
If no voltage has been set on the signal, value -10000 is returned.
|
|
|
|
int gns_GetSignalVoltageSwing(char *name, double *low, double *high) |
|
Gives the voltage swing of the signal name. low is the lowest voltage possible on the signal and high the highest. name is must genius model signal name.
|
|
|
The MBK API provides a set of utility functions to allow creation and manipulation of chain list and hash table objects.
FILE *fopen(char *name, char *mode) |
|
Opens a file in the specified mode and returns a pointer
|
|
name | Name of the file to be opened |
mode | Available modes are r for reading, w for writing and a for appending |
EXAMPLE | set file [fopen "design.stat" w] |
|
|
int fclose(FILE *f) |
|
closes a file
|
|
f | Pointer on the file to be closed |
EXAMPLE | fclose $file |
|
|
void mbk_Sort(int *index_array, void **value_array, int nbelem) |
|
Sorts the array of values 'value_array' according to the
indexes stored in the array 'index_array'. 'nbelem' is number of elements of
both the arrays 'index_array' and 'value_array'.
|
|
|
|
void mbk_FreeList(List *lst) |
|
Frees a List but not the items of the list.
|
|
|
|
void *mbk_GetListItem(List *lst) |
|
Returns the current list item. The item is a pointer on void
that must be casted to the desired type.
|
|
|
|
List *mbk_AddListItem(List *lst, void *item) |
|
Adds an item at the begining of a list. The new list head is
returned.
|
|
|
|
List *mbk_AppendList(List *lst1, List *lst2) |
|
Appends list <l2> at the end of list <l1>.
The new list head is returned.
NB: <l2> should not be used anymore.
|
|
|
|
List *mbk_GetListNext(List *lst) |
|
Returns the next node of the list.
|
|
|
|
int mbk_EndofList(List *lst) |
|
Returns 0 if lst is not the end of the list else a value different
from 0. The end of the list can also be tested with (lst == NULL).
|
|
|
|
HashTable *mbk_NewHashTable(int size) |
|
Creates a hash table with the initial size 'size'. However, if
the hash table becomes too crowded, it is automatically resized.
|
|
|
|
void mbk_FreeHashTable(HashTable *htable) |
|
Deletes the hash table 'htable'.
|
|
|
|
long mbk_AddHashItem(HashTable *htable, void *key, long value) |
|
Stores the element 'value' in the hash table 'htable', according
to the key 'key'.
|
|
|
|
long mbk_GetHashItem(HashTable *htable, void *key) |
|
Retrieves the element stored according to the key 'key' in the
hash table 'htable'
|
|
|
|
int mbk_IsEmptyHashItem(long value) |
|
Tests the returned value of the functions mbk_AddHashItem and
mbk_GetHashItem.
|
|
|
The database API provides a set of functions to create and manage internal databases. This can be useful as a means of manipulating complex data structures within GNS actions.
int dtb_Load(char *name) |
|
dtb_Load(<database>) creates a new data base named <database>. If the database was
already created, it will be cleaned.
|
|
|
|
void dtb_Save(char *name) |
|
dtb_Save(<database>) saves the <database> to a file. The file name will be .<database>.dtb
and can be found in the current directory.
|
|
|
|
void dtb_Clean(char *name) |
|
dtb_Clean(<database>) removes of entries in the <database>.
|
|
|
|
void dtb_SetChar(char *dbtname, char *name, char value) |
|
dtb_SetChar(<database>, <varname>, <value>) creates or updates the entry <varname>
in the <database> with the value <value> expressed as a character. In case of type
mismatch, the old type will be overriden.
|
|
|
|
void dtb_SetString(char *dbtname, char *name, char *value) |
|
dtb_SetString(<database>, <varname>, <value>) creates or updates the entry <varname>
in the <database> with the value <value> expressed as a string. In case of type mismatch,
the old type will be overriden.
|
|
|
|
void dtb_SetLong(char *dbtname, char *name, long value) |
|
dtb_SetLong(<database>, <varname>, <value>) creates or updates the entry <varname>
in the <database> with the value <value> expressed as a long integer. In case of type
mismatch, the old type will be overriden.
|
|
|
|
void dtb_SetInt(char *dbtname, char *name, int value) |
|
dtb_SetInt(<database>, <varname>, <value>) creates or updates the entry <varname>
in the <database> with the value <value> expressed as an integer. In case of type
mismatch, the old type will be overriden.
|
|
|
|
void dtb_SetDouble(char *dtbname, char *name, double value) |
|
dtb_SetDouble(<database>, <varname>, <value>) creates or updates the entry <varname>
in the <database> with the value <value> expressed as a double. In case of type mismatch,
the old type will be overriden.
|
|
|
|
double dtb_GetDouble(char *dtbname, char *name) |
|
dtb_GetDouble(<database>, <varname>) returns the double value of the entry <varname>
in the <database>. If the entry does not exist or the type mismatchs, 0.0 is returned.
|
|
|
|
int dtb_GetInt(char *dtbname, char *name) |
|
dtb_GetInt(<database>, <varname>) returns the integer value of the entry <varname>
in the <database>. If the entry does not exist or the type mismatchs, 0 is returned.
|
|
|
|
long dtb_GetLong(char *dtbname, char *name) |
|
dtb_GetLong(<database>, <varname>) returns the long integer value of the entry <varname>
in the <database>. If the entry does not exist or the type mismatchs, 0 is returned.
|
|
|
|
char *dtb_GetString(char *dtbname, char *name) |
|
dtb_GetString(<database>, <varname>) returns the string value of the entry <varname>
in the <database>. If the entry does not exist or the type mismatchs, NULL is returned.
|
|
|
|
char dtb_GetChar(char *dtbname, char *name) |
|
dtb_Getchar(<database>, <varname>) returns the character value of the entry <varname>
in the <database>. If the entry does not exist or the type mismatchs, ' ' is returned.
|
|
|
|
void dtb_RemoveEntry(char *dtbname, char *name) |
|
dtb_RemoveEntry(<database>, <varname>) removes the entry <varname> from the <database>.
If the entry does not exist, nothing is done.
|
|
|
|
void dtb_Create(char *name) |
|
dtb_Create(<database>) creates a new database named <database>. If the database already
exits, the function call has no effects.
|
|
|
The SIM API provides a set of functions to perform and take measures from SPICE simulations of internally generated netlists using any external SPICE simulator. Functions are provided to position input waveforms, set simulation parameters, and take measurements of complex properties such as peak noise and setup/hold constraints.
void sim_SetSimulatorType(SimulationContext *sc, char *type) |
|
sim_SetSimulatorType specifies the type of simulator towards whom the simulation
netlists are created. Supported simulators types are 'NGSPICE' and 'ELDO'.
|
|
|
|
SimulationContext *sim_CreateContext(Netlist *netlist) |
|
sim_FreeContext deletes a previously created simulation context. The netlist associated
with the simulation context is not affected.
|
|
|
|
SimulationContext *sim_CreateNetlistContext() |
|
sim_CreateNetlistContext creates a simulation context, relatively to the current
gns netlist which is flattened to transistor level.
|
|
|
|
Netlist *sim_GetContextNetlist(SimulationContext *sc) |
|
sim_GetContextNetlist returns the netlist the simulation context sc is associated to.
|
|
|
|
void sim_SetDelayVTH(SimulationContext *sc, double vth) |
|
sim_SetDelayVTH sets the threshold voltage for delay calculations. Delay is computed
between the vth-crossing ins
|
|
|
|
void sim_SetSimulationSlope(SimulationContext *sc, double slope) |
|
sim_SetSimulationSlope sets the default input slope for electrical simulation.
The unit is the second.
|
|
|
|
void sim_SetSimulationTime(SimulationContext *sc, double time) |
|
sim_SetSimulationTime sets the duration of the electrical simulation.
Unit is SECOND.
|
|
|
|
void sim_SetSimulationStep(SimulationContext *sc, double step) |
|
sim_SetSimulationStep sets the step used during the electrical simulation.
The unit is the second.
|
|
|
|
void sim_SetSimulationSupply(SimulationContext *sc, double v_max) |
|
sim_SetSimulationSupply sets the applied power supply during the electrical simulation.
The unit is the volt.
|
|
|
|
void sim_SetInputSwing(SimulationContext *sc, double v_vss, double v_max) |
|
sets the swing to use for input connector/signal. Those values are used for instance
when setting an input slope on a connector.
|
|
|
|
void sim_SetOutputSwing(SimulationContext *sc, double v_vss, double v_max) |
|
sets the swing to use for output signal when computing a delay to the output signal
or the slope on an output signal.
|
|
|
|
double sim_GetSimulationSupply() |
|
sim_GetSimulationSupply returns the simulation voltage defined for the alimentation
connector.
The unit is the volt.
|
|
|
|
void sim_AddSimulationTechnoFile(SimulationContext *sc, char *tech_file) |
|
sim_AddSimulationTechnoFile adds a technology file in list of technology files used
to
parametrize the electrical simulation.
|
|
|
|
void sim_SetSimulationCall(SimulationContext *sc, char *sim_call) |
|
sim_SetSimulationCall sets the string which will be called to run the electrical
simulator.
|
|
|
|
void sim_NoiseSetAnalyseType(SimulationContext *sc, char noise_type) |
|
sim_NoiseSetAnalyseType sets the type of noise analysis. Allowed values are SIM_MIN
and SIM_MAX.
|
|
|
|
void sim_SetSimulationOutputFile(SimulationContext *sc, char *output_file) |
|
sim_SetSimulationOutputFile specifies the extension of the file generated by the
electrical simulator.
|
|
|
|
void sim_AddStuckLevel(SimulationContext *sc, char *node, int level) |
|
sim_AddStuckLevel stucks the node to VDD if level is 1, to GND if level is 0.
|
|
|
|
void sim_AddStuckLevelVector(SimulationContext *sc, char *node, char *level) |
|
sim_AddStuckLevelVector stucks the input bit vector to the hexadecimal value (VDD
if the bit value is 1, GND if the bit value is 0).
|
|
|
|
void sim_AddStuckVoltage(SimulationContext *sc, char *node, double voltage) |
|
sim_AddStuckVoltage stucks the input to the value.
|
|
|
|
void sim_AddSlope(SimulationContext *sc, char *node, double start_time, double transition_time,
char sense) |
|
sim_AddSlope sets a rising slope on the input (an internal signal) if sense is 'U',
a falling slope
if sense is 'D'.
|
|
|
|
void sim_SetExternalCapacitance(SimulationContext *sc, char *node, double value) |
|
sim_SetExternalCapacitance sets a capacitance value on the toplevel connector node.
|
|
|
|
void sim_AddWaveForm(SimulationContext *sc, char *node, double trise, double tfall,
double periode, char *pattern) |
|
sim_AddWaveForm sets rising and falling transitions on the node, according to the
string 'pattern'.
Specifying 1 in 'pattern' sets rising slope, 0 a falling slope.
|
|
|
|
void sim_AddInitLevel(SimulationContext *sc, char *node, int level) |
|
sim_AddInitLevel initialize a node voltage to VDD if level = 1, to GND if level
= 0.
|
|
|
|
void sim_AddInitVoltage(SimulationContext *sc, char *node, double voltage) |
|
sim_AddInitVoltage initialize a node voltage to the value voltage.
|
|
|
|
void sim_AddOutLoad(SimulationContext *sc, char *node, double load) |
|
sim_AddOutLoad adds the capacitance 'load' on the specified 'node' output connector.
|
|
|
|
void sim_AddMeasure(SimulationContext *sc, char *node) |
|
sim_AddMeasure prints the signal voltage to the simulator output file.
This function is needed to compute timing.
|
|
|
|
void sim_AddMeasureCurrent(SimulationContext *sc, char *node) |
|
sim_AddMeasureCurrent prints the node current to the simulator output file.
|
|
|
|
void sim_RunSimulation(SimulationContext *sc, char *sim_call) |
|
sim_RunSimulation launches the electrical simulation.
|
|
|
|
double sim_ExtractMinSlope(SimulationContext *sc, char *node) |
|
After a simulation run, sim_ExtractMinSlope extracts the minimum slope of a node.
|
|
|
|
double sim_ExtractMaxSlope(SimulationContext *sc, char *node) |
|
After a simulation run, sim_ExtractMaxSlope extracts the minimum slope of a node.
|
|
|
|
double sim_ExtractMinDelay(SimulationContext *sc, char *node_a, char *node_b) |
|
After a simulation run, sim_ExtractMinDelay extracts the minimum delay between two
nodes.
|
|
|
|
double sim_ExtractMaxDelay(SimulationContext *sc, char *node_a, char *node_b) |
|
After a simulation run, sim_ExtractMaxDelay gets the maximum delay between two nodes.
|
|
|
|
double sim_ExtractMinTransitionDelay(SimulationContext *sc, char *node_a, char *node_b,
char *transition) |
|
After a simulation run, sim_ExtractMinTransitionDelay extracts the mininum delay
between two nodes, see sim_ExtractMinDelay.
Parameter 'transition' can be for example "U1D2". In this configuration, delay will
be extracted between the second
rise transition of 'node_a' and the third falling transition of 'node_b'.
|
|
|
|
double sim_ExtractMaxTransitionDelay(SimulationContext *sc, char *node_a, char *node_b,
char *transition) |
|
After a simulation run, sim_ExtractMaxTransitionDelay extracts the maximum delay
between two nodes, see sim_ExtractMaxDelay.
Parameter 'transition' can be for example "U1D2". In this configuration, delay will
be extracted between the second
rise transition of 'node_a' and the third falling transition of 'node_b'.
|
|
|
|
double sim_ExtractMinTransitionSlope(SimulationContext *sc, char *node, char *transition) |
|
After a simulation run, sim_ExtractMinTransitionSlope extracts the minimum slope
of a node.
Parameter 'transition' can be for example "U1". In this configuration, slope will
be extracted from the
second rising transition of the node.
|
|
|
|
double sim_ExtractMaxTransitionSlope(SimulationContext *sc, char *node, char *transition) |
|
After a simulation run, sim_ExtractMaxTransitionSlope extracts the maximum slope
of a node.
Parameter 'transition' can be for example "D2". In this configuration, slope will
be extracted from the third falling transition of the node.
|
|
|
|
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) |
|
sim_ComputeSetup computes the setup time of 'data' relatively to 'command'. Setup
time is computed by
observing the latest 'data' transition, relatively to 'command', that generates a
transition on
the memory point.
data : name of the data
tstart_d : start time of the pulse on data
tslope_d : slope of the pulse on data
sens_d : transition of the data : 'U' for rising, 'D' for falling
cmd : name of the command
tstart_min : minimum starting time of the pulse on cmd
tstart_max : maximum starting time of the pulse on cmd
tslope_c : slope of the pulse on cmd
sens_c : transition of the cmd : 'U' for rising, 'D' for falling
mem : name of the memory point
data_val : expected value on mem : 1 for VDD, 0 for VSS
|
|
|
|
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) |
|
sim_ComputeHold computes the hold time of 'data' relatively to 'command'. Hold time
is computed by observing
the latest 'data' transition, relatively to command, that doesn't generate
any transition on the memory point.
data : name of the data
tstart_d : start time of the pulse on data
tslope_d : slope of the pulse on data
sens_d : transition of the data : 'U' for rising, 'D' for falling
cmd : name of the command
tstart_min : minimum starting time of the pulse on cmd
tstart_max : maximum starting time of the pulse on cmd
tslope_c : slope of the pulse on cmd
sens_c : transition of the cmd : 'U' for rising, 'D' for falling
mem : name of the memory point
data_val : expected value on mem : 1 for VDD, 0 for VSS
|
|
|
|
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) |
|
sim_ComputeAccess gives the access time of 'dout' relatively to 'command'. Access
time is computed by observing
the delay between the transition on 'command' and the transition on 'dout'.
|
|
|
|
double elp_GetCapaFromConnector(SimulationContext *sc, Connector *locon) |
|
elp_GetCapaFromConnector gives the capacitance of a transistor's connector.
|
|
|
|
List *sim_ComputeDelay(SimulationContext *sc, char *input, char sens, List *list_output) |
|
sim_ComputeDelay gives a list of delays between a constant input and a list of outputs.
|
|
|
|
double sim_ComputeMaxDelayTransition(SimulationContext *sc, char *input, double input_start,
double input_slope, char *output, char *transition) |
|
sim_ComputeMaxDelayTransition gives the maximum delay corresponding to a transition
between the input and the output.
|
|
|
|
double sim_ComputeMinDelayTransition(SimulationContext *sc, char *input, double input_start,
double input_slope, char *output, char *transition) |
|
sim_ComputeMinDelayTransition gives the minimum delay corresponding to a transition
between the input and the output.
|
|
|
|
Timing *sim_GetTimingFromList(List *list) |
|
sim_GetTimingFromList gives a timing object corresponding to a list.
|
|
|
|
Timing *sim_GetTimingNext(Timing *timing) |
|
sim_GetTimingNext gives the next timing object.
|
|
|
|
Timing *sim_GetTiming(char *root, char *node) |
|
sim_GetTiming retrieves the timing between the root node name 'rootname' and the
destination node name 'nodename'.
|
|
|
|
Timing *sim_GetTimingByEvent(char *root, char *node, char *event) |
|
sim_GetTimingByEvent retrieves the timing between the root node name 'rootname'
and the destination node name 'nodename'.
This timing must respect the good event on 'rootname' and 'nodename'.
Event is the expected event from root to node, it can be 'U' (rising) or 'D' (falling)
and can be followed by an integer.
|
|
|
|
double sim_GetTimingDelay(Timing *timing) |
|
sim_GetTimingDelay gets the delay corresponding to the timing.
|
|
|
|
double sim_GetTimingMinDelay(Timing *timing) |
|
sim_GetTimingMinDelay gets the minimun delay corresponding to the timing.
|
|
|
|
double sim_GetTimingMaxDelay(Timing *timing) |
|
sim_GetTimingMaxDelay gets the maximun delay corresponding to the timing.
|
|
|
|
double sim_GetTimingSlope(Timing *timing) |
|
sim_GetTimingSlope gets the slope corresponding to the timing.
|
|
|
|
double sim_GetTimingMinSlope(Timing *timing) |
|
sim_GetTimingMinSlope gets the minimum slope corresponding to the timing.
|
|
|
|
double sim_GetTimingMaxSlope(Timing *timing) |
|
sim_GetTimingMaxSlope gets the maximum slope corresponding to the timing.
|
|
|
|
char *sim_GetTimingRoot(Timing *timing) |
|
sim_GetTimingRoot gets the name of the root node corresponding to the timing.
|
|
|
|
char *sim_GetTimingNode(Timing *timing) |
|
sim_GetTimingNode gets the name of the node (destination) corresponding to the timing.
|
|
|
|
char *sim_GetTimingRootInNetlist(Timing *timing) |
|
sim_GetTimingRootInNetlist gets the name of the root node in the netlist corresponding
to the timing.
|
|
|
|
char *sim_GetTimingNodeInNetlist(Timing *timing) |
|
sim_GetTimingNodeInNetlist gets the name of node (destination) in the netlist corresponding
to the timing.
|
|
|
|
char sim_GetTimingRootEvent(Timing *timing) |
|
sim_GetTimingRootEvent gets the event of the root node corresponding to the timing.
Event is SIM_FALL or SIM_RISE.
|
|
|
|
char sim_GetTimingNodeEvent(Timing *timing) |
|
sim_GetTimingNodeEvent gets the event of the node (destination) corresponding to
the timing.
Event is SIM_FALL or SIM_RISE.
|
|
|
|
void sim_NoiseExtract(SimulationContext *sc, char *node, double vthnoise, double tinit,
double tfinal) |
|
After a simulation run, sim_NoiseExtract extracts the maximum noise on a node between
two moments.
The initial time (tinit) and the tfinal time (tfinal) represent the timing bounds
to extract noise.
vthnoise is the threshold voltage to extract noise (percentage of vdd).
|
|
|
|
double sim_NoiseGetVth(SimulationContext *sc, char *name) |
|
sim_NoiseGetVth gets the noise threshold voltage on the node 'name'.
|
|
|
|
List *sim_NoiseGetPeakList(SimulationContext *sc, char *name) |
|
sim_NoiseGetPeakList gets a list of peaks relatively to node 'name'.
|
|
|
|
List *sim_NoiseGetMomentList(SimulationContext *sc, char *name) |
|
sim_NoiseGetMomentList gets a list of moment of passage on noise threshold
voltage relatively to node 'name'.
|
|
|
|
double sim_NoiseGetMoment(SimulationContext *sc, List *noise_tclist) |
|
sim_NoiseGetMoment gets a the moment of passage on noise threshold
voltage from a pointer on a pointer list returned by sim_NoiseGetMomentList.
|
|
|
|
double sim_NoiseGetPeakValue(SimulationContext *sc, char *name, List *noise_peaklist) |
|
sim_NoiseGetPeakValue gets the peak value (voltage) relatively to the node 'name'
and a pointer
on a List returned by sim_NoiseGetPeakList.
|
|
|
|
double sim_NoiseGetPeakMoment(SimulationContext *sc, List *noise_peaklist) |
|
sim_NoiseGetPeakMoment gets the peak moment relatively to a pointer
on a List returned by sim_NoiseGetPeakList.
|
|
|
|
double sim_NoiseExtractMaxPeakValue(SimulationContext *sc, char *name) |
|
sim_NoiseExtractMaxPeakValue gets the maximum peak value relatively to the node
'name'.
|
|
|
|
double sim_NoiseExtractMinPeakValue(SimulationContext *sc, char *name) |
|
sim_NoiseExtractMinPeakValue gets the minimum peak value relatively to the node
'name'.
|
|
|
|
double sim_NoiseExtractMaxPeakMoment(SimulationContext *sc, char *name) |
|
sim_NoiseExtractMaxPeakMoment gets the moment of the maximum peak relatively to
the node 'name'.
|
|
|
|
double sim_NoiseExtractMinPeakMoment(SimulationContext *sc, char *name) |
|
sim_NoiseExtractMinPeakMoment gets the moment of the minimum peak relatively to
the node 'name'.
|
|
|
|
double sim_NoiseGetMomentBeforePeak(SimulationContext *sc, char *name, List *peak) |
|
sim_NoiseGetMomentBeforePeak gets the moment of passage on noise threshold voltage
relatively to node 'name' and before a peak which is a pointer on a List returned
by sim_NoiseGetPeakList.
|
|
|
|
double sim_NoiseGetMomentAfterPeak(SimulationContext *sc, char *name, List *peak) |
|
sim_NoiseGetMomentAfterPeak gets the moment of passage on noise threshold voltage
relatively to node 'name' and after a peak which is a pointer on a List returned by
sim_NoiseGetPeakList.
|
|
|
|
void sim_DriveNodeState(SimulationContext *sc, char *filename, char *node_ref, char
*node_state2drive, char type) |
|
sim_DriveNodeState drives successives states of the 'node_state2drive' in the file
'filename'
(which also contains file's extension). 'node_ref' is the node reference, 'type' can
be
SIM_RISE or SIM_FALL and represents the event on 'node_ref' which will sample 'node_state2drive'.
|
|
|
|
double sim_ExtractCommutInstant(SimulationContext *sc, char *node, double voltage) |
|
sim_ExtractCommutInstant extract the first instant when the node reach the
voltage value 'voltage'.
|
|
|
|
void sim_DriveTransistorAsInstance(SimulationContext *sc, char mode) |
|
sim_DriveTransistorAsInstance(<context>, <mode>) indicates is the transistor should
be driven as instances.
eg. M124 src grid drain bulk ... => XM124 src grid drain bulk ...
the value for mode is 'y' to enable the transformation else 'n'
|
|
|
|
void sim_AddSpiceMeasure(SimulationContext *sc, char *delay, char *slope, char *sig1,
char *sig2, char *transition, char delay_type) |
|
|
|
|
|
void sim_AddSpiceMeasureSlope(SimulationContext *sc, char *slope, char *sig, char
*transition, char delay_type) |
|
Add a slope measure of sig that can be extracted by the
label (slope).
Transition is a string containing the transition of sig.
Tolerated transition are 'U' and 'D'.
The <delay_type> can be SIM_MIN or SIM_MAX meaning the node choosen to compute the
delay or the slope
is the closer or the farther one.
|
|
|
|
void sim_AddSpiceMeasureDelay(SimulationContext *sc, char *delay, char *sig1, char
*sig2, char *transition, char delay_type) |
|
Add a measure of delay between sig1 and sig2 that can be extracted by the
label (delay).
Transition is a string containing the transition of sig1 and sig2.
The <delay_type> can be SIM_MIN or SIM_MAX meaning the node choosen to compute the
delay or the slope
is the closer or the farther one.
Tolerated transition are 'U' and 'D'.
|
|
|
|
double sim_ReadMeasure(char *filename, char *label) |
|
Reads the simulation results from filename and return the value corresponding to the measure label.
On failure, returns -1.
|
|
|
|
void sim_ResetMeasures(SimulationContext *model) |
|
Resets all the measures set in the simulation context.
|
|
|
|
double sim_GetSpiceMeasureSlope(SimulationContext *model, char *label) |
|
Returns the slope computed for the label, 0.0 if slope has not been computed.
|
|
|
|
double sim_GetSpiceMeasureDelay(SimulationContext *model, char *label) |
|
Returns the delay computed for the label, 0.0 if delay has not been computed.
|
|
|
|
void sim_SpiceMeasure(SimulationContext *model, char *delay, double *valued, char
*slope, double *values, char *sig1, char *sig2, char *transition, char delay_type) |
|
Add a delay measure between sig1 and sig2 that can be extracted by the
label (delay).
Add a slope measure of sig that can be extracted by the
label (slope).
Transition is a string containing the transition of sig1 and sig2.
Tolerated transition are 'U' and 'D'.
The <delay_type> can be SIM_MIN or SIM_MAX meaning the node choosen to compute the
delay or the slope
is the closer or the farther one.
After simulation completed get the delay and the slope computed
for each label and store it into the adress pointed by valued(delay)
and values(slope).
|
|
|
|
void sim_SpiceMeasureDelay(SimulationContext *model, char *delay, double *value, char
*sig1, char *sig2, char *transition, char delay_type) |
|
Add a measure of delay between sig1 and sig2 that can be extracted by the
label (delay).
Transition is a string containing the transition of sig1 and sig2.
Tolerated transition are 'U' and 'D'.
The <delay_type> can be SIM_MIN or SIM_MAX meaning the node choosen to compute the
delay or the slope
is the closer or the farther one.
After simulation completed get the delay computed for the label
and store it into the adress pointed by value.
|
|
|
|
void sim_SpiceMeasureSlope(SimulationContext *model, char *slope, double *value, char
*sig, char *transition, char delay_type) |
|
Add a slope measure of sig that can be extracted by the
label (slope).
Transition is a string containing the transition of sig.
Tolerated transition are 'U' and 'D'.
The <delay_type> can be SIM_MIN or SIM_MAX meaning the node choosen to compute the
delay or the slope
is the closer or the farther one.
After simulation completed get the slope computed for the label
and store it into the adress pointed by value.
|
|
|
|
void sim_DefineInclude(SimulationContext *sc, char *filename) |
|
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.
|
|
|
The BEG API provides a set of functions to allow easy generation of behavioral models. These internally compiled models can be automatically compressed using loops and vectors and then used to generate either VHDL or Verilog descriptions.
void begCreateModel(char *name) |
|
Initializes a behavioral model with the given name making it the current model.
|
|
|
|
void begCreatePort(char *name, char direction) |
|
Adds an I/O port to the current model.
|
|
|
|
void begCreateModelFromConnectors(char *name, List *connectors) |
|
Initializes a behavioral model with the given name and interface, making it the
current model.
|
|
|
|
void begCreateModelInterface(char *name) |
|
Initializes a behavioral model with the given name and the physical model interface,
making it the current model.
|
|
|
|
void begCreateInterface() |
|
Initializes a behavioral model and the physical model interface, making it the current
model. The model name will be handled by the API.
|
|
|
|
void begRenameSignalsFromModel() |
|
Rename the behavioral model interface with the name of physical connectors.
If the corresponding signal is not a connector the behavioral name is prefixed
by the behavioral model name.
|
|
|
|
begAssign [-weak|-strong] <name> <value> [delay [delayvar]]
|
|
Creates a simple concurrent assignment in the current model.
|
|
|
|
in C: |
|
Adds a driver to a given bussed signal of the current model, creating the signal
if necessary.
|
|
-normal | In verilog, will force the signal to be assigned in a sequential block. |
-weak or -strong | In verilog, defines the strength of the driver. |
-delays <risedelay> <falldelay> | Specifies different values for rising and falling. No effect if field <delay> is used. |
name | Affected signal name. |
value | Affected expression. |
condition | Condition for the value to be affected. |
delay | Delay of the operation. Default is 0ps. |
delayvar | Delay variable name for defining the delay later. |
|
|
begAddBusElse [-normal] [-weak|-strong] [-delays <risedelay> <falldelay>] <name>
<condition> <value> [delay [delayvar]] |
|
Adds an else alternative to the previous driver of a given bussed signal of the
curent model, creating the signal if necessary.
|
|
-normal | In verilog, will force the signal to be assigned in a sequential block. |
-weak or -strong | In verilog, defines the strength of the driver. |
-delays <risedelay> <falldelay> | Specifies different values for rising and falling. No effect if field <delay> is used. |
name | Affected signal name. |
value | Affected expression. |
condition | Condition for the value to be affected. |
delay | Delay of the operation. Default is 0ps. |
delayvar | Delay variable name for defining the delay later. |
|
|
void begAddBusDriverLoop(char *name, char *condition, char *value, char *loopvar,
int delay, char *delayvar) |
|
Adds a loop driver to a given bussed signal of the current model, creating the signal
if necessary.
|
|
|
|
void begAddBusDriverDoubleLoop(char *name, char *condition, char *value, char *loopvar1,
char *loopvar2, int delay, char *delayvar) |
|
Adds a loop driver to a given bussed signal of the current model, creating the signal
if necessary.
|
|
|
|
in C: |
|
Adds a driver to a given register signal of the curent model, creating the signal
if necessary.
|
|
-normal | In verilog, will force the signal to be assigned in a sequential block. |
-weak or -strong | In verilog, defines the strength of the driver. |
-delays <risedelay> <falldelay> | Specifies different values for rising and falling. No effect if field <delay> is used. |
name | Affected signal name. |
value | Affected expression. |
condition | Condition for the value to be affected. |
delay | Delay of the operation. Default is 0ps. |
delayvar | Delay variable name for defining the delay later. |
|
|
void begAddMemDriverLoop(char *name, char *condition, char *value, char *loopvar,
int delay, char *delayvar) |
|
Adds a loop driver to a given register signal of the curent model, creating the
signal if necessary.
|
|
|
|
void begAddMemDriverDoubleLoop(char *name, char *condition, char *value, char *loopvar1,
char *loopvar2, int delay, char *delayvar) |
|
Adds a loop driver to a given register signal of the curent model, creating the
signal if necessary.
|
|
|
|
begAddMemElse [-normal] [-weak|-strong] [-delays <risedelay> <falldelay>] <name>
<condition> <value> [delay [delayvar]] |
|
Adds an else alternative to the previous driver of a given register signal of the
curent model, creating the signal if necessary.
|
|
-normal | In verilog, will force the signal to be assigned in a sequential block. |
-weak or -strong | In verilog, defines the strength of the driver. |
-delays <risedelay> <falldelay> | Specifies different values for rising and falling. No effect if field <delay> is used. |
name | Affected signal name. |
value | Affected expression. |
condition | Condition for the value to be affected. |
delay | Delay of the operation. Default is 0ps. |
delayvar | Delay variable name for defining the delay later. |
|
|
void begSaveModel() |
|
Saves the current model to disk.
|
|
|
|
void begKeepModel() |
|
Finalize the current custom-built model.
|
|
|
|
void begDestroyModel() |
|
Destroy the current model.
|
|
|
|
char *begVectorize(char *radical, int index) |
|
Generate a name of type toto(n).
|
|
|
|
char *begVarVectorize(char *radical, char *var) |
|
Generate a name of type toto(n).
|
|
|
|
char *begVectorRange(char *radical, int left, int right) |
|
Generate a name of type toto(l:r).
|
|
|
|
void begAddWarningCheck(char *testexpr, char *message) |
|
Add a assertion statement which generates a warning on activation.
|
|
|
|
void begAddErrorCheck(char *testexpr, char *message) |
|
Add a assertion statement which generates an error on activation.
|
|
|
|
void begSort() |
|
Sort the drivers in the current behavioural model.
|
|
|
|
void begCompact() |
|
Compact the current behavioural model by vectorization and loop detection.
|
|
|
|
void begSetDelay(char *varname, int value) |
|
Set the timing delay value associated with a particular delay variable declared
by any of the expression creation functions.
|
|
|
|
void begBuildModel() |
|
Automatically create a standard (nom-compacted) behavioral model for a recognized
structural model.
|
|
|
|
void begBuildCompactModel() |
|
Automatically create a compact behavioral model for a recognized structural model.
|
|
|
|
void begBiterize() |
|
Unvectorise current behavioral model.
|
|
|
|
void begAddSelectDriver(char *name, char *select, char *when, char *value, int delay,
char *delayvar) |
|
Add a with select description.
'select' is the name of the signal selected,
'value' is affected to 'name' when 'when' match to 'select'.
When others is represented by 'when' set to string 'default'.
|
|
|
|
void begExport(char *name) |
|
begExport(<name>) creates a copy of the current behavioural figure. The new figure
gets the name <name>. This function is useful when it is needed to associate a known
user name to a behaviour to easily retreive it knowing it's new name.
|
|
|
|
void begImport(char *name) |
|
begImport(<name>) retreive the behaviour named <name> and merge it into the current
behavioural figure.
|
|
|