当前位置:网站首页>Test platform for combinational logic blocks
Test platform for combinational logic blocks
2022-06-22 05:51:00 【Silly boy: CPU】
Test platform for combinational logic blocks
The test platform does not need to be integrated , therefore SystemVerilog All the syntax of can be used to write test platform . The modules of the test platform do not need to declare inputs and outputs , The test platform includes the tested objects 、 The signal source that generates the test excitation and the mechanism for observing or recording the output of the tested object .
The test platform usually implements two functions :1) Generate the input excitation required by the module under test :2) Check the output result of the tested module .
module adder #(parameter N = 4)
(
output logic [N-1:0] Sum,
output logic Count,
input logic [N-1:0] A,B,
input logic Cin
);
always_comb
{Count,Sum} = A + B + Cin;
endmodule
module TestBitAdder;
parameter N = 4;
logic Cin ,Count;
logic [N-1:0] Sum,A,B;
adder #(N) s0(.*);
initial
begin
Cin = '0;
A = 4'b0000;
B = 4'b0000;
#5ns A = 4'b1111;
#5ns Cin = '1;
#5ns A = 4'b0111;
#5ns B = 4'b1111;
#5ns Cin = '0;
end
endmodule
Reference the adder in the instance adder when , Use a parameter (N) And a port that connects the excitation signal to the adder (*). Only when the network and variable names in the test platform are completely consistent with the port names of the modules referenced by the instances , This simplified port connection method is allowed .
Please note that , Time is relative , That is, wait after each assignment 5ns, Then assign the following statement . please remember , With keywords init
边栏推荐
- 代码走查的优化方向(接口请求便捷、动态class判断条件过长、去除无用console、抽离公共方法)
- open source hypervisor
- 错误:note: module requires Go 1.17
- Tensorflow 2.x(keras)源码详解之第十四章:keras中的回调及自定义回调
- 做事方法:3C 方案设计法
- Vulkan 预旋转处理设备方向
- AUTOSAR从入门到精通100讲(150)-SOA架构及应用
- U disk as startup disk to reinstall win10 system (no other software required)
- 以太网UDP帧发包设计
- 为什么说“ CPS联盟营销 ” 是性价比最高的推广方式?
猜你喜欢

AUTOSAR从入门到精通100讲(150)-SOA架构及应用

微信小程序开发 第一周:页面设置、页面跳转、数据绑定

自控原理之系统辨识

EPP (Enhanced Parallel Port 增强型并口)

U disk as startup disk to reinstall win10 system (no other software required)

MinGW下载安装

PID笔记

想投放Facebook广告却不知从何入手?此文带你深入了解

I don't suggest you work too hard

Beifeng helps Nanchang Emergency Management Bureau to build a public-private integrated emergency communication guarantee network
随机推荐
为Cortex-M4编写优化的DSP代码
Vscode remote connection error: server status check failed - waiting and retrying
使用SystemVerilog门模型描述的组合逻辑
以太网通信协议
Machine learning note 7: powerful neural network representation
Global and Chinese carbon conductive filler market demand trend and future prospect report 2022-2027
數據的存儲(進階)
tmux -- ssh terminal can be closed without impact the server process
innosetup判断程序已经运行方法
sourcetree报错ssh失败
Optimization direction of code walk through (convenient interface requests, long dynamic class judgment conditions, removal of useless consoles, separation of public methods)
向量空間視角看高數(1)——系列簡介
Hide symbol of dynamic library
The first week of wechat applet development: page setup, page Jump and data binding
微信小程序开发 第一周:页面设置、页面跳转、数据绑定
MinGW download and installation
Current market situation analysis and investment analysis prospect report of global and Chinese ceramic capacitor industry 2022-2027
Xshell download and installation (solve the problem of expired evaluation)
The "decentralization" mode of independent stations has risen, sweeping the tide of cross-border enterprise transformation
RGB, sRGB and XYZ coordinate conversion