8.5 Verilog ACC Subroutine List
Classification Verilog Tutorial Advanced Chapter
To ensure the authenticity of the subroutines and to avoid the poor translation quality, all the subroutine lists are kept in English. Not all subroutines have been verified here, and there may be omissions due to version or transcription issues. Corrections are welcome. It is recommended to carefully study the corresponding type of subroutine when using it, and to refer to the types and settings of parameters in other examples.
ACC subroutines are mainly divided into 5 major categories: handle, next, value change link (VCL), fetch, miscellaneous, and modify.
Handle Subroutines
Return Type | Call Format and Description |
---|---|
handle | ◆acc_handle_by_name(char *name, handle scope) |
Get the handle to any named object based on its name and scope | |
handle | ◆acc_handle_calling_mod_m() |
Get a handle to the module containing the instance of the user-defined system task or function that called the PLI application. | |
handle | ◆acc_handle_condition(handle object) |
Get a handle to the conditional expression of a module path, data path, or timing check terminal | |
handle | ◆acc_handle_conn(handle terminal) |
Get the handle to the net connected to a primitive terminal, path terminal, or timing check terminal. | |
handle | ◆acc_handle_datapath(handle modpath) |
Get a handle to a data path for an edge-sensitive module path. | |
handle | ◆acc_handle_hiconn(handle port) |
Get the hierarchically higher net connection to a scalar module port or a bit-select of a vector port. | |
handle | ◆acc_handle_interactive_scope() |
Get a handle to the current interactive scope of the software tool. | |
handle | ◆acc_handle_loconn(handle port) |
Gets the hierarchically lower net connection to a scalar module port or a bit-select of a vector port. | |
handle | ◆acc_handle_modpath(handle module, char *source, char *dest, handle source, handle dest) |
Gets a handle to a module path whose source are specified. | |
handle | ◆acc_handle_notifier(handle tchk) |
Get the notifier reg associated with a particular timing check. | |
handle | ◆acc_handle_object(char *name) |
Get a handle for any named object. | |
handle | ◆acc_handle_parent(handle object) |
Get a handle for the parent primitive instance or module instance of an object. | |
handle | ◆acc_handle_path(handle output, handle input) |
Get a handle to an intermodule path that represents the connection from an output or inout port to an input or inout port. | |
handle | ◆acc_handle_pathin(handle path) |
Get a handle for the first net connected to a module path source. | |
handle | ◆acc_handle_pathout(handle path) |
Get a handle for the first net connected to a module path destination. | |
handle | ◆acc_handle_port(handle module, int port_index) |
Get a handle for a module port, based on the position of the port. | |
handle | ◆acc_handle_scope(handle object) |
Get a handle to the scope that contains an object. | |
handle | ◆acc_handle_simulated_net(handle collapsed_net_handle) |
Get the simulated net associated with the collapsed net passed as an argument. | |
handle | ◆acc_handle_tchk(handle module, int tchk_type, char *conn_name1, int edge_type1, char *conn_name2, int edge_type2, handle conn_name1_handle, handle conn_name2_handle) |
Get a handle for the specified timing check of a module (or cell). | |
handle | ◆acc_handle_tchkarg1(handle tchk) |
Get a handle for the timing check terminal connected to the first argument of a timing check. | |
handle | ◆acc_handle_tchkarg2(handle tchk) |
Get a handle for the timing check terminal connected to the second argument of a timing check. | |
handle | ◆acc_handle_terminal(handle primitive, int terminal_index) |
Get a handle for a primitive terminal based on the position of the primitive terminal. | |
handle | ◆acc_handle_tfarg(int arg_num) <br> ◆acc_handle_itfarg(int arg_num, handle instance) |
Get a handle for the specified argument of a user-defined system task or function that invokes the PLI routine. | |
handle | ◆acc_handle_tfinst() |
Get a handle to the current user-defined system task |
Obtain handles to the input path terminals of a module path, source terminals of a data path, or the terminals of a timing check.
Function | Description |
---|---|
handle | accnextload(handle reference, handle current_load) |
Obtain handles to primitive terminals driven by a net. | |
handle | accnextloconn(handle reference, handle current_net) |
Obtain handles to hierarchically lower net connections to a port of a module. | |
handle | accnextmodpath(handle reference, handle path) |
Obtain handles to module paths of a module. | |
handle | accnextnet(handle reference, handle curretn_net) |
Obtain handles to nets in a module. | |
handle | accnextoutput(handle reference, handle current_terminal) |
Obtain handles to output path terminals of a module path or data path. | |
handle | accnextparameter(handle reference, handle current_parameter) |
Obtain handles to parameters within a module. | |
handle | accnextport(handle reference, handle current_port) |
Gets handles to the ports of a module, or to ports which are connected to a given net or reg. | |
handle | accnextportout(handle reference, handle current_port) |
Obtain handles to output or inout ports of a module. | |
handle | accnextprimitive(handle reference, handle current_primitive) |
Obtain handles to gates, switches, or user-defined primitives (UDPs) within a module. | |
handle | accnextscope(handle reference, handle current_scope) |
Obtain handles to hierarchy scopes within a scope. | |
handle | accnextspecparam(handle reference, handle current_specparam) |
Obtain handles to specify block parameters within a module. | |
handle | accnexttchk(handle reference, handle timing_check) |
Obtain handles to timing checks within a module. | |
handle | accnextterminal(handle reference, handle terminal) |
Obtain handles to terminals of a gate, switch, or user-defined primitive. | |
handle | accnexttopmod(handle top_module) |
Obtain handles to top-level modules. |
Value Change Link Subprograms
Return Type | Call Format and Description |
---|---|
void | accvcladd(handle object, Cfunction unquoted name, char *userdata, int vcl_flag) |
Set a callback to a consumer routine with value change information whenever an object changes value. consumer_routine() is the unquoted name of a C function to be called. | |
void | accvcldelete(handle object, Cfunction consumerroutine() , char *userdata, int vclflag) |
Removes a VCL callback monitor. consumer_routine() is the unquoted name of a C function to be called. |
Value Fetching Subprograms
Return Type | Call Format and Description |
---|---|
int | accfetchargc() |
Get the number of command-line arguments supplied with a Verilog software tool invocation. | |
char * | accfetchargv() |
Get an array of character pointers that make up the command-line arguments for a Verilog software product invocation. | |
double | accfetchattribute(handle object, char *attribute, double default) |
Get the value of a parameter or specparam named as an attribute in the Verilog source description. | |
int | accfetchattribute_int(handle object, char *attribute, int default) |
Get the integer value of a parameter or specparam named as an attribute in the Verilog source description. | |
char * | accfetchattribute_str(handle object, char *attribute, char *default) |
Get the value of a parameter or specparam named as an attribute in the Verilog source description. | |
char * | accfetchdefname(handle object) |
Get the definition name of a module instance or primitive instance. | |
int | accfetchdelay_mode(handle module) |
Get the delay mode of a module instance. | |
int | accfetchdelays(handle object, double *risedelay, double *falldelay, double *trunoffdelay) <br> accfetchdelays(handle object, double *risedelay, double *d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12) |
Get existing delays for primitives, module paths, timing checks, module input ports, and intermodule paths | |
Return Type | Function Call and Description |
--- | --- |
int | ◆acc_fetch_precision() |
Get the smallest time precision argument specified in all `timescale compiler directives in a given design. | |
int | ◆acc_fetch_pulsere(handle object, double *r1, double *e1, double *r2, double *e2, ......, double *r12, double *e12) |
Get current pulse handling reject_limit and e_limit for a module path, intermodule path, or module input port. | |
int | ◆acc_fetch_range(handle vector, int *msb, int *lsb) |
Get the most significant bit and least significant bit range values for a vector. | |
int | ◆acc_fetch_size(handle object) |
Get the bit size of a net, reg, integer, time, real, or port. | |
double | ◆acc_fetch_tfarg(int arg_number) <br> ◆acc_fetch_itfarg(int arg_number, handle tfinst) |
Get the value of the specified argument of the system task or function associated with the PLI application; the value is returned as a double-precision number. | |
int | ◆acc_fetch_tfarg_int(int arg_number) <br> ◆acc_fetch_itfarg_int(int arg_number, handle tfinst) |
Get the value of the specified argument of the system task or function associated with the PLI application; the value is returned as an integer number. | |
char * | ◆acc_fetch_tfarg_str(int arg_number) <br> ◆acc_fetch_itfarg_str(int arg_number, handle tfinst) |
Get the value of the specified argument of the system task or function associated with the PLI application; the value is returned as a pointer to a character string. | |
void | ◆acc_fetch_timescale_info(handle object, p_timescale_info timescale_p) |
Get timescale information for an object or for an active $timeformat system task invocation. <br> p_timescale_info is a data structure, defined in acc_user.h. | |
int | ◆acc_fetch_type(handle object) |
Get the type of an object. | |
char * | ◆acc_fetch_type_str(int type) |
Get a string that indicates the type of its argument. | |
char * | ◆acc_fetch_value(handle object, char *format, s_acc_value *value) |
Get the logic or strength value of a net, reg, or variable. <br> s_acc_value is a data structure, defined in acc_user.h. |
Miscellaneous Subprograms
Return Type | Function Call and Description |
---|---|
void | ◆acc_close() |
Free internal memory used by ACC routines; reset all configuration parameters to default values. | |
handle * | ◆acc_collect(handle *next_routine, handle object, int num_of_objects) |
Obtain an array of handles for all objects related to a particular reference object; get the number of objects collected. | |
int | ◆acc_compare_handles(handle object1, handle object2) |
Determine if two handles refer to the same object. | |
int | ◆acc_configure(int config_param, char *config_value) |
Set parameters that control the operation of various ACC routines. | |
int | ◆acc_count(handle *next_routine, handle object) |
Count the number of objects related to a particular reference object. | |
int | ◆acc_initialize() |
Initializes the environment for ACC routines. | |
int | ◆acc_object_in_typelist(handle object, int object_type_array[]) |
Determine whether an object fits a type or fulltype, or special property, as specified in an input array. | |
int | ◆acc_object_of_type(handle object, int object_type) |
Determine whether an object fits a specified type or fulltype, or special property. | |
int | ◆acc_product_type() |
Get the software product type that is calling the PLI application. | |
char * | ◆acc_product_version() |
Get the version of the software product that is linked to the ACC routines. | |
int | ◆acc_release_object(handle object) |
Deallocate memory allocated by calls to acc_next_input() and acc_next_output(). | |
void | ◆acc_reset_buffer() |
Reset the string buffer to the beginning. | |
handle | ◆acc_set_interactive_scope(handle scope, int callback_flag) |
Set the interactive scope of a software tool. | |
char* | ◆acc_set_scope(handle module, char *module_name) |
Set a scope for acc_handle_object() to use when searching in the design hierarchy. | |
This is a Chinese to English translation, please provide the English translation for this text. Do not provide any explanations or text apart from the translation.
English: | int | ◆acc_replace_delays(handle object, double *rise_delay, double *fall_delay, double *trunoff_delay) <br> ◆acc_replace_delays(handle object, double *d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12) <br> ◆acc_replace_delays(handle object, double limit) | | | Replace existing delays for primitives, module paths, timing checks, module input ports, and inter-module paths. | | int | ◆acc_replace_pulsere(handle object, double *r1, double *e1, double *r2, double *e2, ......, double *r12, double *e12) | | | Replace existing pulse handling reject_limit and e_limit for a module path, intermodule path or module input port. | | int | ◆acc_set_pulsere(handle path, double reject_percentage, double e_percentage) | | | Set the pulse handling values for a module path, intermodule path or module input port as a percentage of the delay. | | int | ◆acc_set_value(handle object, p_setval_value value_p, p_setval_delay delay_p) | | | Set and propagate a value on a reg, variable, user-defined system function or a sequential UDP; procedurally assign a reg or variable; force a reg, variable, or net. <br> p_setval_value and p_setval_delay are data structures, defined in acc_user.h. |
Structures
Below is an explanation of some structures designed for ACC subroutines.
Function Involved | Structure |
---|---|
acc_fetch_location | typedef struct t_location <br> { <br> PLI_INT32 line_no; <br> PLI_BYTE8 *filename; <br> } s_location, *p_location; |
p_timescale_info | typedef struct t_timescale_info <br> { <br> PLI_INT16 unit; <br> PLI_INT16 precision; <br> } s_timescale_info, *p_timescale_info; |
acc_fetch_value <br> acc_set_value | typedef struct t_setval_value <br> { <br> PLI_INT32 format; <br> union <br> { <br> PLI_BYTE8 *str; <br> PLI_INT32 scalar; <br> PLI_INT32 integer; <br> double real; <br> p_acc_vecval vector; <br> } value; <br> } s_setval_value, *p_setval_value, s_acc_value, *p_acc_value; |
acc_set_value | typedef struct t_setval_delay <br> { <br> s_acc_time time; <br> PLI_INT32 model; <br> } s_setval_delay, *p_setval_delay; |
-1.2 Verilog Switch-Level Modeling
-2.1 Fundamentals of Verilog UDP
-2.2 Verilog Combinational Logic UDP
-2.3 Verilog Sequential Logic UDP
-3.2 Verilog Specify Block Statements
-3.3 Verilog Setup and Hold Times
-3.5 Verilog Delay Back-annotation
-4.1 Synchronization and Asynchrony in Verilog
-4.2 Verilog Cross-Clock Domain Transfer: Slow to Fast
-4.3 Verilog Cross-Clock Domain Transfer: Fast to Slow
-[5.1