首页 > 其他分享 >SystemVerilog -- 3.4 SystemVerilog forever loop

SystemVerilog -- 3.4 SystemVerilog forever loop

时间:2024-05-05 19:33:05浏览次数:12  
标签:forever vif -- always begin 3.4 end SystemVerilog

SystemVerilog forever loop

循环永远运行,或者无限时间运行。forever

Syntax

forever
  // Single statement

forever begin
  // Multiple statements
end

循环类似于下面Verilog中所示的代码。两者都运行无限的仿真时间,并且在它们内部有一个延迟元件很重要。forever

An always or forever block without a delay element will hang in simulation!
always
  // Single statement

always begin
  // Multiple statements
end

在SystemVerilog中,block不能放置在类和其他SystemVerilog过程块中。相反,我们可以使用循环来达到相同的效果。always forever

下面显示的伪代码模拟了testbench中监视器的功能,只要它监视的总线上有活动,该监视器就会启动并允许运行。

class Monitor;
  virtual task run();
    forever begin
      @ (posedge vif.clk)
        if (vif.write & vif.sel)
          // Capture write data
        if (!vif.write & vif.sel)
          // Capture read data
    end
  endtask
endclass

module tb;
   Monitor mon;

   // Start the monitor task and allow it to continue as long as there is activity on the bus
   initial begin
     fork
       mon.run();
     join_none
   end
endmodule

标签:forever,vif,--,always,begin,3.4,end,SystemVerilog
From: https://www.cnblogs.com/sys-123456/p/18173761

相关文章

  • C. Game on Permutation
    链接:https://codeforces.com/problemset/problem/1860/C洛谷链接:https://www.luogu.com.cn/problem/CF1860C相关知识点复习:LIS最长上升子序列链接:https://blog.csdn.net/lxt_Lucia/article/details/81206439关键:这题的思路在于找到LIS长度为2的点,比如13254那么显然3,2是......
  • 0505一般质疑
    一般质疑底层逻辑质疑方式无论据有结论A和非A的矛盾有理由的得出相反的结论有论据有结论--近似看成A=》B-和A且非B矛盾绝大多数肯定论据得出相反结论--得不出该结论......
  • SystemVerilog -- 3.3 SystemVerilog for loop
    SystemVerilogforloopSystemVerilog中的循环多次重复一组给定的语句,直到不满足给定的表达式。与所有其他过程块一样,循环中需要多个语句被for和forbeginend关键字括起来。SyntaxFor循环使用三步方法控制其语句的执行:初始化影响循环运行次数的变量在执行循环之前,请检查条......
  • @FixMethodOrder(MethodSorters.NAME_ASCENDING)的作用
    importorg.junit.*;importstaticorg.junit.Assert.*;importorg.junit.Test;importorg.junit.runners.MethodSorters;/***UserService测试类*///TODO填写顺序执行的代码@FixMethodOrder(MethodSorters.NAME_ASCENDING)publicclassUserServiceTest{staticUserServ......
  • 高级C语言1
    一、程序的内存分段:(进程映像)​ 当执行程序的运行命令后,操作系统会给程序分配它所需要的内存,并划分成以下内存段供程序使用:text代码段:​ C代码被翻译成二进制指令后存储在可执行文件中,当可执行文件被操作系统执行时,它会把里面的二进制指令(编译后的代码)加载到这个内存段,它里面......
  • Camunda 整合SpringBoot基本Api
    代码实现:需要接口@AutowiredprivateRuntimeServiceruntimeService;@AutowiredprivateRepositoryServicerepositoryService;@AutowiredprivateTaskServicetaskService;发布流程:@GetMapping("/deploy")publicObjectdeploy(){......
  • Direct3D 11(D3D11)是Microsoft DirectX API 中的一部分,Direct3D 12(D3D12)是微软开发的一
    Direct3D11编程指南-Win32apps|MicrosoftLearn什么是Direct3D12-Win32apps|MicrosoftLearnDirect3D12编程指南-Win32apps|MicrosoftLearn你可以使用以下命令来查询系统是否支持D3D12:CopyCodedxdiag运行此命令将打开DirectX诊断工具,你可以在其中......
  • 快速入门一篇搞定RocketMq-实现微服务实战落地
    1、RocketMq介绍RocketMQ起源于阿里巴巴,最初是为了解决邮件系统的高可靠性和高性能而设计的。在2016年开源分布式消息中间件,并逐渐成为Apache顶级项目。现在是Apache的一个顶级项目,在阿里内部使用非常广泛,已经经过了"双11"这种万亿级的消息流转,性能稳定、高效。官网地址:https://......
  • Apache Shiro 721反序列化漏洞Padding Oracle Attack
    目录漏洞原理复现修复方式漏洞原理Shiro的RememberMeCookie使用的是AES-128-CBC模式加密。其中128表示密钥长度为128位,CBC代表CipherBlockChaining,这种AES算法模式的主要特点是将明文分成固定长度的块,然后利用前一个块的密文对当前块的明文进行加密处理。这种模式的加......
  • Camunda 流程执行错误处理ERROR BOUNDARY EVENT
     ERRORBOUNDARYEVENT:在任务发生异常时候会触发走,在代码中必须显式抛出thrownewBpmnError("error.....");publicvoidexecute(DelegateExecutiondelegateExecution)throwsException{System.out.println("进来了>>>>>>>>>>>>&......