当前位置:网站首页>(5) SPI application design and simulation verification 3 - verification code implementation
(5) SPI application design and simulation verification 3 - verification code implementation
2022-06-27 17:21:00 【Shaoqing is not in Dali Temple】
( 3、 ... and ) Verification code
Design finished Master End sum Slave End code , We need to validate the function block , Check if it works properly .Testbanch The design of is mainly divided into several main parts :
① Declare the port type ( Input and output variables of the module );
② Generate clock , According to what you set , Here we use 200Mhz Of clk, So a cycle is 5ns, Then every time 2.5ns A numerical inversion is required ;
③ Generate driver ( Give the data ), First reset The initial value and then the value , Here we need to define some task, To generate values in the desired format ;
④ Definition task, This is in uart There are also ;
⑤ Define the detection module , Judge what you read read_data Whether it is consistent with the entered value , To judge SPI Whether the overall design OK;
⑥ Instantiation master and slave
1) Code implementation
module test;
reg clk_200mhz;
reg rstn;
reg[11:0] cmd_in;
reg cmd_valid;
wire cmd_ready;
wire sclk,csn,mosi,miso;
wire read_data;
//(1)reset clk&rstn
initial begin
clk_200mhz = 0;
rstn = 0;
#10;
rstn = 1;
end
//(2)generate clk
always #2.5 clk边栏推荐
- d3dx9_ How to repair 32.dll? d3dx9_ Solution to 32.dll missing
- EMQ helps Qingdao Yanbo build a smart water platform
- leetcode 19. Delete the penultimate node of the linked list
- Mihayou sued Minmetals trust, which was exposed to product thunderstorms
- Oracle concept II
- 黑马程序员-软件测试基础班-02-30-45工具代开浏览器运行代码,音、视频、测试点,音视频标签,布局标签。超链接语法进阶,绝对路径,相对路径
- 电子智慧套装教程
- Handwritten promise series - all
- P4251 [scoi2015] small convex play matrix (still a little confused)
- 深耕数字化,引领云原生,服务更多开发者
猜你喜欢

LeetCode每日一练(两数之和)

09 route guard authenticates URL

Why should string be designed to be immutable?

模拟进程调度

Use pyinstaller to package py files into exe. Precautions and error typeerror:_ get_ sysconfigdata_ name() missing 1...‘ check_ Solutions to exists'

软件测试基础-软件测试历史流程,分类,好处,限制

数据中心表格报表实现定制统计加班请假汇总记录分享
![[qt learning notes]qt uses MFC compilation to generate DLL libraries. The problem that DLL cannot be loaded occurs on computers without programming environment](/img/fb/4cf7013687973a7214e51faf3358c0.jpg)
[qt learning notes]qt uses MFC compilation to generate DLL libraries. The problem that DLL cannot be loaded occurs on computers without programming environment

Cesium realizes satellite orbit detour
P. Simple application of a.r.a method in Siyuan (friendly testing)
随机推荐
数组表示若干个区间的集合,请你合并所有重叠的区间,并返回 一个不重叠的区间数组,该数组需恰好覆盖输入中的所有区间 。【LeetCodeHot100】
C语言课程设计
华为云DevCloud重磅发布四大新能力,创下国内两项第一
d3dx9_ How to repair 33.dll? d3dx9_ What if 33.dll is lost?
ROS "topic" programming implementation
智慧风电 | 图扑软件数字孪生风机设备,3D 可视化智能运维
d3dx9_ How to repair 25.dll? d3dx9_ 25.dll where to download
[fxcg] today's market analysis
Autodesk NavisWorks 2022 software installation package download and installation tutorial
Leetcode 46 Full Permutation
09 route guard authenticates URL
继手机之后 报道称三星也削减了电视等家电产品线的产量
Redis installation
电子智慧套装教程
Oracle concept 3
#yyds干货盘点# 解决剑指offer:二叉树中和为某一值的路径(三)
Part 30 supplement (30) ECMAScript object
07. Express routing
LeetCode每日一练(两数之和)
Alibaba cloud liupeizi: Inspiration from cloud games - innovation on the end