美文网首页
2.1 dpi/uvm_hdl.svh

2.1 dpi/uvm_hdl.svh

作者: Poisson_Lee | 来源:发表于2020-02-17 18:37 被阅读0次

import "DPI-C" context function int uvm_hdl_check_path(string path);
检查hdl路径是否存在

import "DPI-C" context function int uvm_hdl_deposit(string path, uvm_hdl_data_t value);
给hld路径信号赋值
import "DPI-C" context function int uvm_hdl_force(string path, uvm_hdl_data_t value);
给hld路径信号强制赋值

两者都调用了同一个C函数,传入参数flag参数不一样。

task uvm_hdl_force_time(string path, uvm_hdl_data_t value, time force_time=0);
if (force_time == 0) begin
void'(uvm_hdl_deposit(path, value));
return;
end
if (!uvm_hdl_force(path, value))
return;
#force_time;
void'(uvm_hdl_release_and_read(path, value));
endtask
force hdl信号一个值,一段时间后,release
传入时间参数(参数类型是time)默认值为0,作用与uvm_hdl_deposit一致。

// Function: uvm_hdl_release_and_read
//
// Releases a value previously set with <uvm_hdl_force>.
// Returns 1 if the call succeeded, 0 otherwise. value is set to
// the HDL value after the release. For 'reg', the value will still be
// the forced value until it has bee procedurally reassigned. For 'wire',
// the value will change immediately to the resolved value of its
// continuous drivers, if any. If none, its value remains as forced until
// the next direct assignment.
//
import "DPI-C" context function int uvm_hdl_release_and_read(string path, inout uvm_hdl_data_t value);

// Function: uvm_hdl_release
//
// Releases a value previously set with <uvm_hdl_force>.
// Returns 1 if the call succeeded, 0 otherwise.
//
import "DPI-C" context function int uvm_hdl_release(string path);

uvm_hdl_release_and_read/uvm_hdl_release 是与uvm_hdl_force可以配对使用的function

// Function: uvm_hdl_read()
//
// Gets the value at the given path.
// Returns 1 if the call succeeded, 0 otherwise.
//
import "DPI-C" context function int uvm_hdl_read(string path, output uvm_hdl_data_t value);
读取hdl信号的值 通过 output返回。

相关文章

网友评论

      本文标题:2.1 dpi/uvm_hdl.svh

      本文链接:https://www.haomeiwen.com/subject/gevbfhtx.html