简单的Verilog测试模板结构
这里记录一下曾经用到的简单的测试模板,如下所示:
//timescale
`timescale 1ns/1ns
module tb_module();
//the Internal motivation variable(register) and output wire //the External motivation storage variable //Sub module signal,example: wire [1:0] xxx == xxx_inst.xxx_inst.xxx; // Global variable initialization ,such as 'clk'、'rst_n'
initial begin
# rst_n = ;
clk = ;
# rst_n = ;
end //Internal motivation variable initialization
//initial begin
//end //cloclk signal generation
always # clk = ~clk ; //Cases of sub module xxxx xxxx_inst(.(),.(), ... ,.()); // Internal motivation variable assignment using task or random
/* example
task data_assign(xx); | task rand_bit();
integer xx,xx,...; | integer i;
begin | begin
for( ; ; )begin | for(i=0; i<255; i=i+1)begin
@(posedge clock) | @(posedge sclk);
Internal motivation variable <= xxxxx; | Internal motivation variable <={$random} %2;
end | end
end | end
endtask | endtask
*/ endmodule
整个测试模块(结构)很简单,并没有结果捕捉模块,因此如果有错的话,并不会打印出来,需要在波形中查看,仅限于简单模块使用。
另外一个简单的verilog测试模板结构如下所示:
module tb_module;
//drive the input port with reg type //sample the output with the wire type //task1 create the instance //task2 clock and reset generator
parameter CLK_PERIOD = ;
reg clk ,rst_n;
initial begin
clk = ;
forever begin
#(CLK_PERIOD/) clk = ~clk ;
end
end initial begin
rst_n = ;
#
rst_n = ;
end //task3 drive the stimulus and capture the response
//testcase //task4 check the result //task5 dump waveform with the compile option -debug_all,for the VCS
initial begin
$vcdpluson;
end endmodule
这些结构都没有给出具体的内容。有空补上一个简单的例子。
简单的Verilog测试模板结构的更多相关文章
- junit测试模板 unit-test
一个项目能否发布上线,重要的环节就是测试.经过集成测试.性能测试.压力测试等不断循环的测试过后依据测试报告来确定上线.这些由专业的测试人员来完成,因此会导致程序开发者对自身的单元测试的弱化.若在代码中 ...
- flask模板结构组织(局部模板、宏、模板继承)
模板结构组织 除了使用函数.过滤器等工具控制模板的输出外,jinja2还提供了一些工具来在宏观上组织模板内容. 局部模板 在Web程序中,我们通常会为每一类页面编写一个独立的模板.比如主页模板.用户资 ...
- WeCenter二次开发教程(一):熟悉模板结构
<1>程序文件目录介绍: app – 应用目录 models – 模型目录 plugins – 插件目录 static – 静态文件 system – 系统目录 views – 模板目录 ...
- 云优化的概念、Entity Framework 7.0、简单吞吐量压力测试
云优化的概念.Entity Framework 7.0.简单吞吐量压力测试 继续上一篇<开发 ASP.NET vNext 初步总结(使用Visual Studio 2014 CTP1)>之 ...
- SQLSERVER2012 列存储索引的简单研究和测试
SQLSERVER2012 列存储索引的简单研究和测试 SQLSERVER2012 列存储索引的简单研究和测试 看这篇文章之前可以先看一下下面这两篇文章: 列存储索引 http://www.cnblo ...
- Jmeter教程 简单的压力测试
Jmeter教程 简单的压力测试:http://www.cnblogs.com/TankXiao/p/4059378.html
- Aurelia – 模块化,简单,可测试的 JS 框架
Aurelia 是下一代 JavaScript 客户端框架,利用简单的约定来激发你的创造力.凭借其强大的专注于开发经验, Aurelia 可以使您不仅创造惊人的应用程序,同时也享受这个过程.它经过精心 ...
- Octopus系列之重新规范了模板结构,大家快来看啊
模板结构我是这样来设计的:大家请看,下面四个关键字 frontend[前段]backend[后端]member[会员]widget[部件] 前段页面包括 _Frontend_header_1.html ...
- 一个简单的Spring测试的例子
在做测试的时候我们用到Junit Case,当我们的项目中使用了Sring的时候,我们应该怎么使用spring容器去管理我的测试用例呢?现在我们用一个简单的例子来展示这个过程. 1 首先我们新建一个普 ...
随机推荐
- C_关于递归算法的几个例子
1.递归算法的定义: 2.递归与迭代的优劣 eg1:斐波那契数列:斐波那契数列(Fibonacci sequence),又称黄金分割数列.因数学家列昂纳多·斐波那契(Leonardoda Fibona ...
- 转 asp.net mvc 身份验证中返回绝对路径的ReturnUrl
原文:http://www.cnblogs.com/hyl8218/archive/2011/11/22/2259116.html 从HttpUnauthorizedResult的源码可以看出,Htt ...
- 安装istio v1.0 详细过程和步骤
创建 istio 目录 [root@centos-110 ~]# mkdir istio [root@centos-110 ~]# cd istio 方案一: # 去下面的地址下载压缩包 # ...
- Sqoop找不到主类 Error: Could not find or load main class org.apache.sqoop.Sqoop
最近由于要使用Sqoop来到出数据到hdfs,可是发现Sqoop1.4.5跟hadoop2.X不兼容,需要对Sqoop1.4.5进行编译,编译的具体方法见:http://my.codeweblog.c ...
- java解决手机上传竖拍照片旋转90\180\270度问题
<dependency> <groupId>com.drewnoakes</groupId> <artifactId>metadata-extracto ...
- Unity3D性能优化最佳实践(四)资源审查
Asset auditing - 资源审查 许多项目发生效能问题的真正原因只是由于人员操作不当或是试东试西,而不小心改到导入设定影响到导入的资源.(例如最近的gitlab惨案) 对于较大规模的项目,最 ...
- .Net:System.Guid
ylbtech-.Net:System.Guid 1.返回顶部 1.public static Guid NewGuid(); // // 摘要: // 初始化 System.Guid 结构的新实例. ...
- linux apache2部署php
apache2 doc http://blog.csdn.net/actor1999/article/details/44802519 #apache sudo apt-get install apa ...
- 一步步教你轻松学主成分分析PCA降维算法
一步步教你轻松学主成分分析PCA降维算法 (白宁超 2018年10月22日10:14:18) 摘要:主成分分析(英语:Principal components analysis,PCA)是一种分析.简 ...
- springboot项目logback配置文件示例
logback-spring.xml <?xml version="1.0" encoding="UTF-8"?> <configuratio ...