问题标签 [uvm]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1243 浏览

verilog - Systemverilog 动态转换问题

我的测试台中有如下代码片段

当我运行它时,我得到 uvm_error 为“无法投射”。我不确定为什么 $cast 没有返回 1。如您所见,我在使用 uvm_info 进行转换后打印出扩展类数据项。我可以看到它正在正确投射。如果我不使用带有 if 条件的 $cast,我不会收到任何运行时错误。总是使用 if 和动态转换来检查 $cast 是否返回 1 不是一个好的编码习惯吗?

在上述情况下 cast 不返回 1 的原因可能是什么?

0 投票
2 回答
2365 浏览

verilog - System Verilog interface with different inputs

I have defined an interface for my DUT as such:

The reason I did this is because my DUT has separate ports for x_msb and x_lsb and I want to explicitly show which bits of signal x I am connecting to these ports. For example, when instantiating the DUT:

Now the issue is I have 2 drivers in my agent:

Driver A: When driving the interface from Driver A, I would like to drive signal x and not x_lsb, x_msb.

Driver B: When driving the interface from Driver B, I would like to drive signal x_lsb and x_msb individually.

I would think that my solution would split up signal x in my interface into x_lsb and x_msb. In DriverA, I can just drive this signal x. Also, for driver B the interface would be ok with me accessing the bits individually and everything would work just fine... not!

The assign causes signal x to be "X - unknown value". I have to drive x_msb and x_lsb individually for DriverA. Or other option is to

This means DriverA would work, but would run into same problem from DriverB (when trying to drive x_lsb and x_msb).

Is there a solution to this? Thanks

0 投票
3 回答
3165 浏览

system-verilog - 您如何定义跨两个寄存器的字段的后门访问?

我有一个寄存器映射,它有 16 位宽的寄存器。我有一个大于 16 位宽的字段,所以它必须跨越两个地址。如何定义对该字段的后门访问?

这是我为我的领域尝试的test_pattern[23:0]

这失败并出现此错误:

错误:VPI TYPERR vpi_handle_by_name() 无法获取部件选择的句柄。

目前尚不清楚这是否是我的工具的限制,或者 UVM 代码如何使用 VPI。在 UVM 代码中四处寻找之后,我看到了应该处理部分选择的代码,但它在#ifdef QUESTA指令内部,所以我认为这是一个工具约束。

有什么好的解决方法吗?

0 投票
3 回答
628 浏览

system-verilog - 通过任务设置 uvm_reg 值时出现警告

我正在创建一个框架,我的验证团队和我可以轻松地编写 uvm 测试用例。基本思想是我的基本(uvm_)序列在其主体任务中仅包含一行:

从我的个人 (uvm_) 测试中,我可以使用方便的辅助函数设置寄存器值。例如,我的测试将包含:

现在我意识到 end_of_elaboration 阶段可能不是设置寄存器的最佳位置。我的编译器给了我警告,上面写着“警告:在任务“end_of_elaboration”中调用任务“set_registerA”。所以我将其更改为在我的run_phase中执行:

我不确定这是否是我想要做的正确方法?调用 super.run_phase 会导致问题吗?我没有看到其他地方这样做过。

0 投票
1 回答
1218 浏览

verilog - 在 Systemverilog 中使用进程间同步

我需要在 systemverilog 中对我的硬件的某些部分进行建模,它看起来如下所示:

我可以让两个踏板 -(SV 任务)并行运行。

两个线程做同样的工作。我正在考虑使用信号量。我以前从未使用过它。线程将在第 5 行阻塞是一个有效的假设/事实吗?我想要实现的是,thread1 将通过在第 4 行中使用信号量 put() 将资源放弃给 thread2 -> 线程 2 将获取该资源并完成它的工作并最终使用 put 释放它。在这期间,thread1 将在第 5 行等待阻塞 get() 调用。

0 投票
1 回答
759 浏览

system-verilog - UVM print_config 不显示值

我正在尝试调试一些遗留的 UVM 代码,但无法弄清楚发生了什么。无论如何,在我努力的过程中,我遇到了这个函数——print_config(1),它应该递归地打印出配置数据库。出于某种原因,当我得到层次结构时,打印输出没有显示存储的值。我只得到:

为什么我会得到?而不是实际值?

编辑:所以我遇到的基本问题是在尝试读取“testset_name”字段时我得到不同的值。所以这是它的结构:

基础测试:set_config_string (" ", testset_name, "ABC") 子测试:set_config_string (" ", testset_name, "JFK") 孙子测试:set_config_string ("*", testset_name, "XYZ")

现在,当我尝试从序列中访问此变量时,我得到“ABC”。如果我取出孙子测试“set_config_string”,我会得到“JFK”。

我不应该得到“XYZ”吗?

更奇怪的是 print_config 打印输出:

为什么同一组件下有 2 个测试集名称条目???

0 投票
1 回答
1171 浏览

system-verilog - do_compare has a result of 1 however .compare return value is 0

I'm following http://cluelogic.com/2013/01/uvm-tutorial-for-candy-lovers-do-hooks/ and https://verificationacademy.com/cookbook/transaction/methods to implement compare the only difference is instead of big logical AND (&&) I'm using

However returned value always comes out to be 0 for e.g. consider sequences

I've been trying to debug why temp is always 0 but couldn't figure out. Can anyone point me in right direction

0 投票
1 回答
977 浏览

system-verilog - uvm_sequence 的参数化 uvm_events

在我的验证环境中,我设置了一些通用序列以实现可重用性:

我想创建类似的东西,我可以在其中传递一个事件。

我会从我的测试中设置这个事件如下:

我收到编译错误: common_sequence_with_event#(my_sequence, my_event) 行的类专业化参数必须是常量

我想这意味着传递给类的参数必须是一个常量。那么,在这种情况下,为什么它接受也作为参数传入的reset_sequence。

另外,有没有更好的方法来做我想要实现的目标?

0 投票
1 回答
2034 浏览

verilog - Systemverilog 代码错误:“gmii_interface”附近:语法错误,意外 IDENTIFIER,期待类

我看到一个编译错误:

当我编译以下 testcase.sv 代码时,在 Model SIM 中:

对应的interface.sv文件代码如下:

我是 SV 初学者,任何帮助将不胜感激。

0 投票
2 回答
1519 浏览

system-verilog - UVM:通过接口驱动时钟

我希望能够控制 UVC 接口上的时钟/数据对。控制数据相对简单。我在车轴上缠身的地方是时钟。

如何控制接口中的时钟,使其可以关闭/打开?虚拟接口时钟分配到参考时钟应该在驱动程序中处理,还是在其他地方处理?

我发现时钟分配是在 get_and_drive 任​​务中处理的,时钟分配不会发生。

我已经完成了通常的研究,但到目前为止,都一无所获。