1.connecting the testbench and the design

2.verilog connection review

3.systemverilog interfaces

4.stimulus timing

5.clocking blocks

6.timing regions

7.program block


Connecting Testbench and Design

1.use the conventional verilog module ports

implicit .* port connections

2.use interface and then instance

interface arb_if(input bit clk);

logic [1:0] grant,request;

logic reset;

endinterface

module top;

bit clk;

always #5 clk =~clk;

arb_if arbif (clk);

arb  a1(arbif);

test t1(arbif);

endmodule:top

module tb(arb_if arbif);

initial begin

@(posedge arbif.clk);

arbif.request <= 2’b01;

$display(“@%0t:Drove req =01”,$time);

repeat(2) @(posedge arbif.clk)

if(arbif.grant != 2’b01)

$display(“@0d:a1:grant !=2’b01”,$time);

$finish;

end

endmodule:test

HOW connecting interfaces and ports

<port_name>.<internal_interface_signal_name>


interface modport

1.modport provide a means to define different views of the   interface signal

2.modport is an abbreviation  for module port

3.an interface can have any number of modport definitions

4.the modport declaration only defines whether the connecting module sees a signal as an input output or bidirectional


STIMULUS TIMING

The timing between the testbench and the design

should be maintained to avoid race contiditions

clocking blocks ===> synchronous signals

default input #1step output #0

1.synchronize to active clock edge specified in clocking block

@arbif.cb;

repeat(3)@arbif.cb;

2.synchronize to any edge of signal

@arbif.cb.grant;

@(posedge arbif.cb.grant);

wait(arbif.cb.grant ==1);

3.wait for N clock cycles with ##n –blocking statment

##2 arbif.cb.request <=0; //wait 2 cycles then assign

3.clocking block signals are referenced by pre-pending the clocking block name to the signal:

all dirves must use non-blocking assigment

arbif.cb.request <= 1; //dirve

value = arbif.cb.grant  ; // sample

4.clocking blocks overview

(1) use in the interface just for testbench

(2)benefits:

synchronous timing domains

race-free if input skew > 0

drive signals always at right time

(3)functionality:

can contain multiple clocking blocks

default input #1step output #0

systemverilog 之interface/timing region/program的更多相关文章

  1. systemverilog interface杂记

    随着IC设计复杂度的提高,模块间互联变得复杂,SV引入接口,代表一捆连线的结构. Systemverilog语法标准,新引入一个重要的数据类型:interface. interface主要作用有两个: ...

  2. Application binary interface and method of interfacing binary application program to digital computer

    An application binary interface includes linkage structures for interfacing a binary application pro ...

  3. [转载]转一篇Systemverilog的一个牛人总结

    原文地址:转一篇Systemverilog的一个牛人总结作者:dreamylife Systemverilog 数据类型 l       合并数组和非合并数组 1)合并数组: 存储方式是连续的,中间没 ...

  4. SystemVerilog基本语法总结(上)

    SystemVerilog基本语法总结(上) 在总结SV的语法之前,先分享一些关于SV的笔试题目,这样更显得具有针对性的总结. a. 验证中,代码覆盖率是指(衡量哪些设计代码在激活触发,而哪一些则一直 ...

  5. Purchase Document Open Interface(PDOI)

    PO模块也有自己的接口表,多用于把其他业务系统在Oracle EBS系统生成采购订单记录. Table Name Description Type PO_HEADERS_INTERFACE This ...

  6. program与module

    program,各方面与module都类似,其中声明的变量在program中都可见, 生命周期也是static类型的, program的结束,也是需要等待其中的所有initial块都执行结束. 与mo ...

  7. JTAG – A technical overview and Timing

    This document provides you with interesting background information about the technology that underpi ...

  8. C#在线更新程序[下载程序、解压缩程序、控制台程序]

    [1]下载文件 using System;using System.Collections.Generic;using System.Linq;using System.Text;using Syst ...

  9. C# rmi例子

    接口定义 实体定义,注意需要序列化 using System; namespace Interface { [Serializable] public class DataEntity { publi ...

随机推荐

  1. [题解](最短路(树))luogu_P5201_short cut

    一开始想着最短路时统计一下到每个点的牛数量,但是没写出来 建最短路树是个不错的想法,正常跑一次最短路,枚举每个点的前驱,如果d[y]==d[x]+w就是树上的一条边,优先连编号小的, 建好树以后做一次 ...

  2. 消息队列介绍、RabbitMQ&Redis的重点介绍与简单应用

    消息队列介绍.RabbitMQ&Redis的重点介绍与简单应用 消息队列介绍.RabbitMQ.Redis 一.什么是消息队列 这个概念我们百度Google能查到一大堆文章,所以我就通俗的讲下 ...

  3. 牛客寒假6-A.出题

    链接:https://ac.nowcoder.com/acm/contest/332/A 题意: 小B准备出模拟赛. 她把题目按难度分为四等,分值分别为6,7,8,9. 已知小B共出了m道题,共n分. ...

  4. hdu6313( 2018 Multi-University Training Contest 2)

    bryce1010模板 http://acm.hdu.edu.cn/showproblem.php?pid=6313 参考dls的讲解: 以5*5的矩阵为例: 后一列分别对前一列+0+1+2+3+4操 ...

  5. 2017"百度之星"程序设计大赛 - 初赛(A)今夕何夕

    Problem Description 今天是2017年8月6日,农历闰六月十五. 小度独自凭栏,望着一轮圆月,发出了“今夕何夕,见此良人”的寂寞感慨. 为了排遣郁结,它决定思考一个数学问题:接下来最 ...

  6. re 模块的重新整理

    RE模块 import  re 的常用操作 查找 1. findall : ret = re.findall('\d+'.'sjkhk172按实际花费928') #正则表达式,待匹配的字符串,flag ...

  7. 模拟IO 读写压力测试

    #### 本实验室通过创建一个测试表myTestTable ,分配在一个足够大小的表空间. ###然后通过 insert select 方式,创建100个后台进程进行读写操作,每个后台进程预计时间20 ...

  8. 神奇的VIM

    1. di'.di".di`.di( .di{ .dt 'abc' ==> '' di' "abc"==> "" di" `ab ...

  9. SQL Server 查看列,添加列,修改列,删除列

    查看表:exec sp_help 表名 查看列: exec sp_columns 表名 查看列:select * from information_schema.columns where table ...

  10. mongodb 文本索引

    启用文本搜索: 最初文本搜索是一个实验性功能,但2.6版本开始,配置是默认启用的.但是,如果使用的是以前 MongoDB 的版本,那么必须启用文本搜索,使用下面的代码: >db.adminCom ...