3 #define API_USE_REAL_TYPES
6 //_____________________________________________________________________________
8 void *stm_AddCell (char *cellname
)
10 return (timing_cell
*)stm_addcell (cellname
);
13 //_____________________________________________________________________________
15 void *stm_ModCreateTable (char *name
, int nx
, int ny
, char xtype
, char ytype
)
17 return (timing_model
*)stm_mod_create_table (name
,nx
,ny
,xtype
,ytype
);
20 //_____________________________________________________________________________
22 void stm_ModTblSetXrangeVal (void *model
, int xpos
, double value
)
26 table
= ((timing_model
*)model
)->UMODEL
.TABLE
;
27 stm_modtbl_setXrangeval (table
, xpos
, value
);
30 //_____________________________________________________________________________
32 void stm_ModTblSetYrangeVal (void *model
, int ypos
, double value
)
36 table
= ((timing_model
*)model
)->UMODEL
.TABLE
;
37 stm_modtbl_setYrangeval (table
, ypos
, value
);
40 //_____________________________________________________________________________
42 void stm_ModTblSetXrange (void *model
, chain_list
*xrange
)
46 table
= ((timing_model
*)model
)->UMODEL
.TABLE
;
47 stm_modtbl_setXrange (table
, (chain_list
*)xrange
, 1.0);
50 //_____________________________________________________________________________
52 void stm_ModTblSetYrange (void *model
, chain_list
*yrange
)
56 table
= ((timing_model
*)model
)->UMODEL
.TABLE
;
57 stm_modtbl_setXrange (table
, (chain_list
*)yrange
, 1.0);
60 //_____________________________________________________________________________
62 void stm_ModTblSet2Dval (void *model
, int xpos
, int ypos
, double value
)
66 table
= ((timing_model
*)model
)->UMODEL
.TABLE
;
67 stm_modtbl_set2Dval (table
, xpos
, ypos
, value
);
70 //_____________________________________________________________________________
72 char *stm_CellAddModel (void *cell
, void *model
, int noshare
)
74 return stm_cell_addmodel ((timing_cell
*)cell
, (timing_model
*)model
, noshare
);
77 //_____________________________________________________________________________
79 void stm_DriveCell (char *cellname
)
81 stm_drivecell (cellname
);
84 //_____________________________________________________________________________
86 chain_list
*stm_ModTblAddRangeVal (chain_list
*range
, double value
)
90 ptval
= (double*) malloc (sizeof (double));
93 range
= addchain (range
,ptval
);
94 return (chain_list
*)range
;
97 //_____________________________________________________________________________
99 chain_list
*stm_ModTblCreateRange (char *rangevalues
)
105 chain_list
*range
= NULL
;
107 if (!rangevalues
) return NULL
;
108 sprintf (buf
,rangevalues
);
109 val
= strtok (buf
,&separ
);
111 ptval
= (double*) malloc (sizeof (double));
112 *ptval
= (double) atof (val
);
113 range
= addchain (range
,ptval
);
114 while ((val
= strtok(NULL
,&separ
))) {
115 ptval
= (double*) malloc (sizeof (double));
116 *ptval
= (double) atof (val
);
117 range
= addchain (range
,ptval
);
124 //_____________________________________________________________________________
126 void stm_FreeTblRange (chain_list
*range
)
128 chain_list
*chain
= (chain_list
*)range
;
129 chain_list
*chain2free
;
133 while (chain
->NEXT
) {
136 free (chain2free
->DATA
);
138 freechain ((chain_list
*)range
);
144 void SET_DELAY(double value
)
146 stm_set_computed_delay(value
);
151 return stm_get_computed_delay();
154 void SET_SLOPE(double value
)
156 stm_set_computed_slope(value
);
161 return stm_get_computed_slope();
164 double GET_OUTPUT_CAPA()
166 return stm_get_output_load();
169 double GET_INPUT_SLOPE()
171 return stm_get_input_slope();
174 double GET_COMMAND_INPUT_SLOPE()
176 return stm_get_command_slope();
179 void CALL_SIMULATION()
181 stm_call_simulation();
184 void CALL_SIMULATION_ENV()
186 stm_call_simulation_env();