systemverilog 之interface/timing region/program
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
最新文章
- android The connection to adb is down 错误信息
- GraphicsMagick为图片添加水印
- MyBatis 配置sql语句输出
- 使用NPOI操纵Excle,并输入到客户端
- Codevs 1958 刺激
- 粗谈pcap_next_ex()
- Java 获取到配置文件信息
- 201521123040《Java程序设计》第2周学习总结
- C3垂直居中均分
- 第一章&#183; Redis入门部署及持久化介绍
- Android智能指针SP WP使用方法介绍
- Baby Coins
- nginx指定文件路径有两种方式root和alias
- PHP 判断浏览器语言
- mongodb crud
- Eclipse安装lombok
- chorme 浏览器记住密码后input黄色背景处理
- 字符串匹配--扩展KMP模板
- 《精通Python设计模式》学习结构型之代理模式
- ref:Manual SQL injection discovery tips
热门文章
- shell学习(1)
- [題解](最短路)luogu_P1119災後重建
- POP页面暂时不销毁
- 简单总结ConcurrentHashMap
- VMware的linux虚拟机实现和windows的文件共享
- Unity Shader入门精要学习笔记 - 第10章 高级纹理
- Function ereg() is deprecated in
- Linux-软件安装(一) —— jdk/tomact 安装(普通安装)
- deepin15.2无线网无法使用
- [转](不理想)Ubuntu下更改主显示器