简单的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 首先我们新建一个普 ...
随机推荐
- poj2393 Yogurt factory(贪心,思考)
https://vjudge.net/problem/POJ-2393 因为仓储费是不变的. 对于每一周,要么用当周生产的,要么接着上一周使用的价格(不一定是输入的)加上固定的仓储费用. 应该算是用到 ...
- flask之信号和mateclass元类
本篇导航: flask实例化参数 信号 metaclass元类解析 一.flask实例化参数 instance_path和instance_relative_config是配合来用的:这两个参数是用来 ...
- set non-stop on
# Enable the async interface. set target-async 1 # If using the CLI, pagination breaks non-stop. set ...
- Spring Boot @Autowired 没法自动注入的问题
Application 启动类: @SpringBootApplication @EnableConfigurationProperties @ComponentScan(basePackages = ...
- Python3 与 NetCore 基础语法对比(Function专栏)
Jupyter最新排版:https://www.cnblogs.com/dotnetcrazy/p/9175950.html 昨晚开始写大纲做demo,今天牺牲中午休息时间码文一篇,希望大家点点赞 O ...
- python3 读取dbf文件报错 UnicodeDecodeError: 'gbk' codec can't decode
在读取dbf文件时由于编码问题报错:UnicodeDecodeError: 'gbk' codec can't decode byte 0xb5 in position 49: incomplete ...
- 通过Nginx反向代理之后客户端验证码session不一致造成无法验证通过的问题解决
location / { proxy_pass http://127.0.0.1:9080/app/; proxy_cookie_path /app/ /; proxy_cookie_path /ap ...
- C#模拟客户端发送数据示例
在给一些客户端做服务器端支持时,发现他们提交上来的数据大都不是http请求格式,因而使用Request.Form获取不到内容,今天用C#做下模拟,并演示下数据接收. 1.发送文本 1).客户端发送 ...
- appium 报错
2018-11-27 18:05:56:313 - [Logcat] Logcat terminated with code 0, signal null 2018-11-27 18:05:56:31 ...
- Spark 公共篇-InterfaceStability
本章内容: 1.源码 InterfaceStability 类包含三个注解,用于说明被他们注解的类型的稳定性. /** * Annotation to inform users of how much ...