• 2024-06-22用verilog/systemverilog 设计fifo (2)
    目录异步fifo实现中要解决的问题信号同步到那个时钟域读写指针转化为格雷码格雷码表示的读写地址如何判断空满?异步fifoverilog代码异步fifo实现中要解决的问题异步fifo和同步fifo功能相似,但是它的读写由两个时钟信号控制,所以它的设计和同步fifo不同,需要考虑更多的因素。信号
  • 2024-06-14用verilog/systemverilog 设计fifo (1)
    目录fifo的基本原理基于计数器的同步fifo实现(1)基于计数器的同步fifo实现(2)基于高位补偿法的fifo实现fifo的基本原理FIFO(firstinfirstout),即先进先出存储器,功能与数据结构中的队列相似。在IC设计中,FIFO常用来缓冲突发数据,流式数据与块数据的转换等等。比如上图中,在两个
  • 2024-06-08搭建verilog/systemverilog学习环境
    目录仿真软件选择使用iverilog的基本步骤仿真软件选择学习verilog或者systemverilog过程中,使用那种仿真软件?当然最好是使用synopsys的vcs+verdi的组合,功能强大,而且大部分公司也使用synopsys的eda软件,如果熟练掌握vcs+verdi对以后工作中使用它们也是有很大帮助。但是这两个软件
  • 2024-06-08SystemC & TLM-2.0 - SystemC vs SystemVerilog
    WhatisthedifferencebetweenSystemCandSystemVerilogSystemCisusedprimarilyasamodelinglanguageparticularlyforvirtualplatformmodelingwhereassystemverilogisusedmainly50chableHardwareverification.I'mgoingtodivedowninto
  • 2024-05-13SystemVerilog -- 3.2 SystemVerilog Threads --> fork join_any
    forkjoin_any在一个简单的SystemVerilog中,mainthread会等到所有childthread都完成执行。这意味着如果任何childthread永远运行并且永远不会完成,则fork将挂起模拟。SystemVerilog还提供了带有forkjoin和forkjoin_any的原始版和变体。如果任何一个childthread完成,则允许ma
  • 2024-05-13SystemVerilog -- 3.1 SystemVerilog Threads --> fork join
    forkjoinSystemVerilog通过构造提供对并行或并发threads的支持。可以使用fork和join同时生成多个proceduralblocks。有一些变体允许mainthread根据childthread何时完成继续执行其余语句。Syntaxfork//Thread1//Thread2//...//Thread3joinforkjoin
  • 2024-05-12SystemVerilog -- 3.0 SystemVerilog Threads
    SystemVerilogThreadsWhatareSystemVerilogthreadsorprocesses?thread或process是作为单独实体执行的任何一段代码。在verilog中,每个initial和always块都作为单独的thread生成,这些threads从0time开始并行运行。block还会创建并运行的不同threads。forkjo
  • 2024-05-12SystemVerilog -- 10.2 SystemVerilog Coverpoint Bins
    SystemVerilogCoverpointBins该构造允许在coverpoint变量的给定可能值范围内为每个值创建一个单独的bin。binUsagecoverpointmode{//Manuallycreateaseparatebinforeachvaluebinszero={0};binsone={1};//AllowSystemVerilogtoautomatic
  • 2024-05-11SystemVerilog -- 10.1 SystemVerilog Covergroup and Coverpoint
    SystemVerilogCovergroupandCoverpointSystemVerilog是一种用户定义的类型,用于封装覆盖率模型的规范。它们可以定义一次,并通过函数在不同位置实例化多次。covergroupnewcovergroup可以在包、模块、程序、接口类中定义,通常封装以下信息:AsetofcoveragepointsCrosscov
  • 2024-05-11SystemVerilog -- 10.0 SystemVerilog Functional Coverage
    SystemVerilogFunctionalCoverageWhatisfunctionalcoverage?functionalcoverage是测试对设计的哪些功能/特性的衡量。这在约束随机验证(CRV)中非常有用,可以了解回归中的一组测试涵盖了哪些特征。Whatareitslimitations?这仅与为它编写的代码一样好。假设您在设计文档
  • 2024-05-09SystemVerilog -- 11.2 SystemVerilog Concurrent Assertions
    SystemVerilogConcurrentAssertionsConcurrentAssertions描述了跨越仿真时间的行为,并且仅在时钟边沿发生时进行评估。SystemVerilogConcurrentAssertions语句可以在与其它语句同时运行的模块、接口或程序块中指定。以下是ConcurrentAssertions的属性:根据采样变量中的值
  • 2024-05-08SystemVerilog -- 11.1 SystemVerilog Immediate Assertions
    SystemVerilogImmediateAssertionsImmediateAssertions基于模拟事件语义执行,并且需要在过程块中指定。在模拟过程中,它的处理方式与语句中的表达式相同。if如果表达式在执行语句时为true,则ImmediateAssertions将通过,如果表达式的计算结果为false(X、Z或0),则ImmediateAsserti
  • 2024-05-06SystemVerilog -- 3.10 SystemVerilog Functions
    SystemVerilogFunctionsSystemVerilog函数具有与Verilog中的function相同的特征。Functionsa的主要用途是返回一个可在表达式中使用且不能消耗模拟时间的值。functionfunction不能具有时间控制语句,如@#forkjoinwaitfunction无法启动task,因为允许task消耗模拟时间。AN
  • 2024-05-05SystemVerilog -- 3.8 SystemVerilog case
    SystemVerilogcaseSystemVerilog语句检查表达式是否与多个表达式和分支中的一个匹配。该行为与Verilog中的行为相同。caseunique,unique0case所有case语句都可以由or关键字限定,以执行违规检查,就像我们在if-else-if构造中看到的那样。uniqueunique0unique并确保没有重叠的
  • 2024-05-05SystemVerilog -- 3.7 SystemVerilog 'unique' and 'priority' if-else
    SystemVerilog'unique'and'priority'if-else条件语句用于决定是否执行语句。ifelseSystemVerilog引入了一下用于违规检查的构造。ifelseunique-ifunique0-ifpriority-ifunique-if,unique0-ifunique-if按任意顺序评估条件,并执行以下操作:当所有条件都不匹配时,报
  • 2024-05-05SystemVerilog -- 3.6 SystemVerilog 'break' and 'continue'
    breakmoduletb;initialbegin//Thisforloopincrementsifrom0to9andexitfor(inti=0;i<10;i++)begin$display("Iteration[%0d]",i);//Let'screateaconditionsuchthattheforloopexitswheni
  • 2024-05-05SystemVerilog -- 3.5 SystemVerilog repeat
    一组给定的语句可以使用构造执行N次。repeatSyntaxrepeat(<number>)//SingleStatementrepeat(<number>)begin//MultipleStatementsendExample#1moduletb;initialbeginrepeat(5)begin$display("Repeatthisstatement");e
  • 2024-05-05SystemVerilog -- 3.4 SystemVerilog forever loop
    SystemVerilogforeverloop循环永远运行,或者无限时间运行。foreverSyntaxforever//Singlestatementforeverbegin//Multiplestatementsend循环类似于下面Verilog中所示的代码。两者都运行无限的仿真时间,并且在它们内部有一个延迟元件很重要。foreverAn
  • 2024-05-05SystemVerilog -- 3.3 SystemVerilog for loop
    SystemVerilogforloopSystemVerilog中的循环多次重复一组给定的语句,直到不满足给定的表达式。与所有其他过程块一样,循环中需要多个语句被for和forbeginend关键字括起来。SyntaxFor循环使用三步方法控制其语句的执行:初始化影响循环运行次数的变量在执行循环之前,请检查条
  • 2024-05-05SystemVerilog -- 3.2 SystemVerilog foreach loop
    SystemVerilogforeachloopSystemVerilog数组是允许在单个变量中存储多个值的数据结构。循环仅用于遍历此类数组,并且是执行此操作的最简单和最简单的方法。foreachSyntax循环从0开始循环访问每个索引。如果循环中有多个语句,则必须像所有其他过程块一样用foreach和foreachbegi
  • 2024-05-05SystemVerilog -- 3.1 SystemVerilog while and do-while loop
    SystemVerilogwhileanddo-whileloop两者都是循环构造,只要给定条件为真,就会执行给定的语句集。whiledowhile循环首先检查条件是否为true,如果条件为true,则执行语句。如果条件被证明是假的,则循环就在哪里结束。while循环首先执行一次语句,然后检查条件是否为true。如果条件为
  • 2024-05-03SystemVerilog -- 3.0 SystemVerilog Loops
    SystemVerilogLoopsWhatareloops?loop是一段不断执行的代码。条件语句通常包含在循环中,以便在条件变为真时终止。如果loop永远运行,那么模拟将无限期挂起。下表给出了SystemVerilog中不同类型的循环构造。\\foreverRunsthegivensetofstatementsforever
  • 2024-05-03SystemVerilog -- 2.21 Data Types ~ SystemVerilog typedef and alias
    SystemVerilogtypedefandaliasTypedef在复杂的测试平台中,某些变量声明可能具有更长的数据类型规范,后者需要在测试平台的多个位置使用。在这种情况下,我们可以使用a为现有数据类型提供用户定义的名称。然后,可以在整个代码中使用新的数据类型,因此如果需要,无需在多个位置进行编
  • 2024-05-03SystemVerilog -- 2.20 Data Types ~ SystemVerilog Structure
    SystemVerilogStructureStructure可以包含不同数据类型的元素,这些元素可以作为一个整体引用,也可以通过其名称单独引用。这些元素具有相同数据类型的数组完全不同。//Normalarrays->acollectionofvariablesofsamedatatypeintarray[10];//allelements
  • 2024-05-03SystemVerilog -- 2.8 Data Types ~ SystemVerilog Array Manipulation
    SystemVerilogArrayManipulationSystemVerilog中有许多内置方法,可帮助数组搜索和排序。数组操作方法只需循环访问数组元素,每个元素都用于计算子句指定的表达式。迭代器参数指定一个局部变量,该变量可在表达式中用于引用迭代中的当前元素。如果未提供参数,item是默认使用的名称