UVM测试结束机制

发布于 2025-01-27 00:28:59 字数 732 浏览 5 评论 0原文

task mabu_scoreboard::main_phase(uvm_phase phase);
forever begin
    # 1ns;
    if(extip_rd_req_cnt - extip_rd_rsp_cnt >= `MABU_READ_OST_NUM) begin
        hit_rd_max_outstanding = 1;
        `uvm_info(get_type_name(),"reach read outstanding threshold!",UVM_NONE);
    end else begin
        hit_rd_max_outstanding = 0;
    end

    if(extip_wr_req_cnt - extip_wr_rsp_cnt >= `MABU_WRITE_OST_NUM) begin
        hit_wr_max_outstanding = 1;
        `uvm_info(get_type_name(),"reach write outstanding threshold!",UVM_NONE);
    end else begin
        hit_wr_max_outstanding = 0;
    end
end  endtask

永远循环是在耗时的阶段执行的(main_phase)。由于main_phase不引起异议,该测试可以正确终止。

task mabu_scoreboard::main_phase(uvm_phase phase);
forever begin
    # 1ns;
    if(extip_rd_req_cnt - extip_rd_rsp_cnt >= `MABU_READ_OST_NUM) begin
        hit_rd_max_outstanding = 1;
        `uvm_info(get_type_name(),"reach read outstanding threshold!",UVM_NONE);
    end else begin
        hit_rd_max_outstanding = 0;
    end

    if(extip_wr_req_cnt - extip_wr_rsp_cnt >= `MABU_WRITE_OST_NUM) begin
        hit_wr_max_outstanding = 1;
        `uvm_info(get_type_name(),"reach write outstanding threshold!",UVM_NONE);
    end else begin
        hit_wr_max_outstanding = 0;
    end
end  endtask

The forever loop is executed in a time-consuming phase (main_phase). The test can get terminated correctly because the main_phase does not raise an objection?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

弃爱 2025-02-03 00:28:59

一个开始耗时的UVM阶段,必须至少提出一个反对意见,以防止该阶段被终止。终止一个阶段意味着所有uvm_component执行该阶段的过程将被杀死。

在您的记分牌示例中,我们必须假设一些其他组件会提出对main_phase的反对,否则forever循环永远不会完成其第一次迭代。最好使用run_phase进行整个测试需要执行的过程。

除了产生时钟外,您的UVM测试台在您的UVM测试台上有任何延迟是不良的做法。 UVM TestBench应该是基于交易的,唯一的延迟应该在于生成时钟。 Forever具有1NS轮询延迟的循环对性能尤其不利。更好的方法是阻止等待活动。

One starting a time-consuming UVM phase, there must be at least one objection raised to prevent that phase from being terminated. Terminating a phase means the process of all uvm_components executing that phase will be killed.

In your scoreboard example, we would have to assume some other component raises an objection to the main_phase, otherwise the forever loop would never complete its first iteration. It's better to use the run_phase for a process that needs to execute for the entire test.

Having any kind of delay in your UVM testbench except for generation of the clock is a bad practice. A UVM testbench is supposed to be transaction based and the only delays should be in generating your clocks. A forever loop with a 1ns polling delay is especially bad for performance. A much better approach is to blocking waiting for an event.

债姬 2025-02-03 00:28:59

是的,这是正确的。由于记分牌中的main_phase未调用rise_objection,因此计分板不会阻止测试结束。

您的大多数测试台组件都不会引起异议。在您的测试中(从uvm_test延长的类)是在其耗时的阶段提出异议。

Yes, that is correct. Since the main_phase in your scoreboard does not call raise_objection, the scoreboard will not prevent the test from ending.

Most of your testbench components will not raise objections. It is common for your test (the class extended from uvm_test) to raise objections in its time-consuming phase.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文