草庐IT

8.5 Verilog ACC 子程序列表

runoob 2023-03-28 原文

为保证子程序的原汁原味,避免拉跨拙劣的翻译水平,所有子程序列表均保留英文说明。这里也没有对所有的子程序都进行验证,由于版本或抄写问题,可能会有所疏漏,欢迎指正。建议使用时再仔细研究对应类型的子程序,多多参考其他例子中参数的类型及设置。

ACC 子程序主要分为 5 大类:句柄(handle)、后继(next)、值变链接(VCL)、取值(fetch)、杂项(miscellaneous)、修改(modify)。

句柄子程序

返回类型调用格式及说明
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)
◆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 or function call.

后继子程序

返回类型调用格式及说明
handle◆acc_next(int object_type_array, handle reference, handle object)
 Get handles to objects of each type specified in an array within the reference scope.
handle◆acc_next_bit(handle reference, handle current_bit)
 Get handles to bits in a port or expanded vector.
handle◆acc_next_cell(handle reference, hand current_cell)
 Get handles to cell instances within a region that includes the entire hierarchy below a module.
handle◆acc_next_cell_load(handle reference, hand current_cell_load)
 Get handles for cell loads on a net.
handle◆acc_next_child(handle reference, handle current_child)
 Get handles for children of a module.
handle◆acc_next_driver(handle reference, handle current_driver)
 Get handles to primitive terminals that drive a net.
handle◆acc_next_hiconn(handle referenct, handle current_net)
 Get handles for hierarchically higher net connections to a module port.
handle◆acc_next_input (handle reference, handle current_terminal)
 Get handles to input path terminals of a module path, source terminals of a data path, or the terminals of a timing check.
handle◆acc_next_load(handle reference, handle current_load)
 Get handles to primitive terminals driven by a net.
handle◆acc_next_loconn(handle reference, handle current_net)
 Get handles to hierarchically lower net connections to a port of a module.
handle◆acc_next_modpath(handle reference, handle path)
 Get handles to module paths of a module.
handle◆acc_next_net(handle reference, handle curretn_net)
 Get handles to nets in a module.
handle◆acc_next_output(handle reference, handle current_terminal)
 Get handles to output path terminals of a module path or data path.
handle◆acc_next_parameter(handle reference, handle current_parameter)
 Get handles to parameters within a module.
handle◆acc_next_port(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◆acc_next_portout(handle reference, handle current_port)
 Get handles to output or inout ports of a module.
handle◆acc_next_primitive(handle reference, handle current_primitive)
 Get handles to gates, switches, or user-defined primitives (UDPs) within a module.
handle◆acc_next_scope(handle reference, handle current_scope)
 Get handles to hierarchy scopes within a scope.
handle◆acc_next_specparam(handle reference, handle current_specparam)
 Get handles to specify block parameters within a module.
handle◆acc_next_tchk(handle reference, handle timing_check)
 Get handles to timing checks within a module.
handle◆acc_next_terminal(handle reference, handle terminal)
 Get handles to terminals of a gate, switch, or user-defined primitive.
handle◆acc_next_topmod(handle top_module)
 Get handles to top-level modules.

值变链接子程序

返回类型调用格式及说明
void◆acc_vcl_add(handle object, C_function unquoted name, char *user_data, 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◆acc_vcl_delete(handle object, C_function consumer_routine() , char *user_data, int vcl_flag)
 Removes a VCL callback monitor.
consumer_routine() is the unquoted name of a C function to be called.

取值子程序

返回类型调用格式及说明
int◆acc_fetch_argc()
 Get the number of command-line arguments supplied with a Verilog software tool invocation.
char *◆acc_fetch_argv()
 Get an array of character pointers that make up the command-line arguments for a Verilog software product invocation.
double◆acc_fetch_attribute(handle object, char *attribute, double default)
 Get the value of a parameter or specparam named as an attribute in the Verilog source description.
int◆acc_fetch_attribute_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 *◆acc_fetch_attribute_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 *◆acc_fetch_defname(handle object)
 Get the definition name of a module instance or primitive instance.
int◆acc_fetch_delay_mode(handle module)
 Get the delay mode of a module instance.
int◆acc_fetch_delays(handle object, double *rise_delay, double *fall_delay, double *trunoff_delay)
◆acc_fetch_delays(handle object, double *rise_delay, 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.
int◆acc_fetch_direction(handle object)
 Get the direction of a port or terminal
int◆acc_fetch_edge(handle pathio)
 Get the edge specifier of a module path or timing check terminal.
char *◆acc_fetch_fullname(handle object)
 Get the full hierarchical name of any named object or module path.
int◆acc_fetch_fulltype(handle object)
 Get the fulltype of an object.
int◆acc_fetch_index(handle object)
 Get the index number for a port or terminal.
int◆acc_fetch_location(p_location loc_p, handle object)
 Get the location of an object in a Verilog-HDL source file.
p_location is a data structure, defined in acc_user.h.
char *◆acc_fetch_name(handle object)
 Get the instance name of any named object or module path.
int◆acc_fetch_paramtype(handle parameter)
 Get the data type of a parameter or specparam.
double◆acc_fetch_paramval(handle parameter)
 Get the value of a parameter or specparam.
int◆acc_fetch_polarity(handle path)
 Get the polarity of a path.
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)
◆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)
◆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)
◆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.
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
s_acc_value is a data structure, defined in acc_user.h.

杂项子程序

返回类型调用格式及说明
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.
char *◆acc_version()
 Get a pointer to a character string that indicates version number of the ACC routine software.

修改子程序

返回类型调用格式及说明
int◆acc_append_delays(handle object, double *rise_delay, double *fall_delay, double *trunoff_delay)
◆acc_append_delays(handle object, double *d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12)
◆acc_append_delays(handle object, double limit)
 Add delays to existing delay on primitives, module paths, intermodule paths, timing checks, and module input ports.
int◆acc_append_pulsere(handle object, double *r1, double *e1, double *r2, double *e2, ......, double *r12, double *e12)
 Add delays to existing pulse handling reject_limit and e_limit for a module path, intermodule path or module input port.
int◆acc_release_object(handle object)
 Deallocate memory allocated by calls to acc_next_input() and acc_next_output().
int◆acc_replace_delays(handle object, double *rise_delay, double *fall_delay, double *trunoff_delay)
◆acc_replace_delays(handle object, double *d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12)
◆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.
p_setval_value and p_setval_delay are data structure, defined in acc_user.h.

结构体

下面对 ACC 子程序设计的一些结构体进行说明。

涉及的函数结构体
acc_fetch_locationtypedef struct t_location
{
PLI_INT32 line_no;
PLI_BYTE8 *filename;
} s_location, *p_location;
p_timescale_infotypedef struct t_timescale_info
{
PLI_INT16 unit;
PLI_INT16 precision;
} s_timescale_info, *p_timescale_info;
acc_fetch_value
acc_set_value
typedef struct t_setval_value
{
PLI_INT32 format;
union
{
PLI_BYTE8    *str;
PLI_INT32      scalar;
PLI_INT32      integer;
double        real;
p_acc_vecval vector;
} value;
} s_setval_value, *p_setval_value, s_acc_value, *p_acc_value;
acc_set_valuetypedef struct t_setval_delay
{
s_acc_time time;
PLI_INT32  model;
} s_setval_delay, *p_setval_delay;

有关8.5 Verilog ACC 子程序列表的更多相关文章

  1. ruby - 在 Ruby 程序执行时阻止 Windows 7 PC 进入休眠状态 - 2

    我需要在客户计算机上运行Ruby应用程序。通常需要几天才能完成(复制大备份文件)。问题是如果启用sleep,它会中断应用程序。否则,计算机将持续运行数周,直到我下次访问为止。有什么方法可以防止执行期间休眠并让Windows在执行后休眠吗?欢迎任何疯狂的想法;-) 最佳答案 Here建议使用SetThreadExecutionStateWinAPI函数,使应用程序能够通知系统它正在使用中,从而防止系统在应用程序运行时进入休眠状态或关闭显示。像这样的东西:require'Win32API'ES_AWAYMODE_REQUIRED=0x0

  2. ruby - 如何指定 Rack 处理程序 - 2

    Rackup通过Rack的默认处理程序成功运行任何Rack应用程序。例如:classRackAppdefcall(environment)['200',{'Content-Type'=>'text/html'},["Helloworld"]]endendrunRackApp.new但是当最后一行更改为使用Rack的内置CGI处理程序时,rackup给出“NoMethodErrorat/undefinedmethod`call'fornil:NilClass”:Rack::Handler::CGI.runRackApp.newRack的其他内置处理程序也提出了同样的反对意见。例如Rack

  3. ruby - 在 Ruby 中编写命令行实用程序 - 2

    我想用ruby​​编写一个小的命令行实用程序并将其作为gem分发。我知道安装后,Guard、Sass和Thor等某些gem可以从命令行自行运行。为了让gem像二进制文件一样可用,我需要在我的gemspec中指定什么。 最佳答案 Gem::Specification.newdo|s|...s.executable='name_of_executable'...endhttp://docs.rubygems.org/read/chapter/20 关于ruby-在Ruby中编写命令行实用程序

  4. ruby-on-rails - Rails 应用程序之间的通信 - 2

    我构建了两个需要相互通信和发送文件的Rails应用程序。例如,一个Rails应用程序会发送请求以查看其他应用程序数据库中的表。然后另一个应用程序将呈现该表的json并将其发回。我还希望一个应用程序将存储在其公共(public)目录中的文本文件发送到另一个应用程序的公共(public)目录。我从来没有做过这样的事情,所以我什至不知道从哪里开始。任何帮助,将不胜感激。谢谢! 最佳答案 无论Rails是什么,几乎所有Web应用程序都有您的要求,大多数现代Web应用程序都需要相互通信。但是有一个小小的理解需要你坚持下去,网站不应直接访问彼此

  5. ruby - 无法运行 Rails 2.x 应用程序 - 2

    我尝试运行2.x应用程序。我使用rvm并为此应用程序设置其他版本的ruby​​:$rvmuseree-1.8.7-head我尝试运行服务器,然后出现很多错误:$script/serverNOTE:Gem.source_indexisdeprecated,useSpecification.Itwillberemovedonorafter2011-11-01.Gem.source_indexcalledfrom/Users/serg/rails_projects_terminal/work_proj/spohelp/config/../vendor/rails/railties/lib/r

  6. ruby-on-rails - Rails 应用程序中的 Rails : How are you using application_controller. rb 是新手吗? - 2

    刚入门rails,开始慢慢理解。有人可以解释或给我一些关于在application_controller中编码的好处或时间和原因的想法吗?有哪些用例。您如何为Rails应用程序使用应用程序Controller?我不想在那里放太多代码,因为据我了解,每个请求都会调用此Controller。这是真的? 最佳答案 ApplicationController实际上是您应用程序中的每个其他Controller都将从中继承的类(尽管这不是强制性的)。我同意不要用太多代码弄乱它并保持干净整洁的态度,尽管在某些情况下ApplicationContr

  7. ruby - RVM 使用列表[0] - 2

    是否有类似“RVMuse1”或“RVMuselist[0]”之类的内容而不是键入整个版本号。在任何时候,我们都会看到一个可能包含5个或更多ruby的列表,我们可以轻松地键入一个数字而不是X.X.X。这也有助于rvmgemset。 最佳答案 这在RVM2.0中是可能的=>https://docs.google.com/document/d/1xW9GeEpLOWPcddDg_hOPvK4oeLxJmU3Q5FiCNT7nTAc/edit?usp=sharing-知道链接的任何人都可以发表评论

  8. ruby-on-rails - 如何在我的 Rails 应用程序 View 中打印 ruby​​ 变量的内容? - 2

    我是一个Rails初学者,但我想从我的RailsView(html.haml文件)中查看Ruby变量的内容。我试图在ruby​​中打印出变量(认为它会在终端中出现),但没有得到任何结果。有什么建议吗?我知道Rails调试器,但更喜欢使用inspect来打印我的变量。 最佳答案 您可以在View中使用puts方法将信息输出到服务器控制台。您应该能够在View中的任何位置使用Haml执行以下操作:-puts@my_variable.inspect 关于ruby-on-rails-如何在我的R

  9. ruby - 检查是否通过 require 执行或导入了 Ruby 程序 - 2

    如何检查Ruby文件是否是通过“require”或“load”导入的,而不是简单地从命令行执行的?例如:foo.rb的内容:puts"Hello"bar.rb的内容require'foo'输出:$./foo.rbHello$./bar.rbHello基本上,我想调用bar.rb以不执行puts调用。 最佳答案 将foo.rb改为:if__FILE__==$0puts"Hello"end检查__FILE__-当前ruby​​文件的名称-与$0-正在运行的脚本的名称。 关于ruby-检查是否

  10. ruby-on-rails - 如何在 Gem 中获取 Rails 应用程序的根目录 - 2

    是否可以在应用程序中包含的gem代码中知道应用程序的Rails文件系统根目录?这是gem来源的示例:moduleMyGemdefself.included(base)putsRails.root#returnnilendendActionController::Base.send:include,MyGem谢谢,抱歉我的英语不好 最佳答案 我发现解决类似问题的解决方案是使用railtie初始化程序包含我的模块。所以,在你的/lib/mygem/railtie.rbmoduleMyGemclassRailtie使用此代码,您的模块将在

随机推荐