当前位置:网站首页>(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边栏推荐
- Part 31 supplement (31) ECMAScript conversion to string and number
- P4251 [scoi2015] small convex play matrix (still a little confused)
- Byte + Google super full kotlin learning King fried notes! Kotlin introductory tutorial + Advanced kotlin enhanced actual combat (with demo)
- 2022年中国音频市场年度综合分析
- Sword finger offer 22 The penultimate node in the linked list
- 数组表示若干个区间的集合,请你合并所有重叠的区间,并返回 一个不重叠的区间数组,该数组需恰好覆盖输入中的所有区间 。【LeetCodeHot100】
- National food safety risk assessment center: do not blindly and unilaterally pursue "zero addition" and "pure natural" food
- 428-二叉树(501.二叉搜索树中的众数、701.二叉搜索树中的插入操作、450.删除二叉搜索树中的节点、669. 修剪二叉搜索树)
- Hierarchical clustering and case analysis
- Etcd visualization tool: kstone deployment (I), rapid deployment based on Helm
猜你喜欢

LeetCode每日一练(两数之和)
![[multithreading] thread communication scheduling, waiting set wait(), notify()](/img/4b/b9312fafd1ef1bf438f7aec7665276.png)
[multithreading] thread communication scheduling, waiting set wait(), notify()

Drawing for example study of flashcc

Byte + Google super full kotlin learning King fried notes! Kotlin introductory tutorial + Advanced kotlin enhanced actual combat (with demo)

Hierarchical clustering and case analysis

Ping An technology's practice of migrating from Oracle to ubisql

10分钟掌握mysql的安装步骤

事件监听机制

Raspberry pie preliminary use

leetcode 70. climb stairs
随机推荐
Ti Click: quickly set up tidb online laboratory through browser | ti- team interview can be conducted immediately
Leetcode 704. Binary search
QT5 之信号与槽机制(信号与槽的基本介绍)
National food safety risk assessment center: do not blindly and unilaterally pursue "zero addition" and "pure natural" food
d3dx9_ How to repair 38.dll? d3dx9_ 38. How to download a missing DLL?
IDE Eval reset unlimited trial reset
EMQ 助力青岛研博建设智慧水务平台
国家食品安全风险评估中心:不要盲目片面追捧标签为“零添加”“纯天然”食品
2022年中国音频市场年度综合分析
Detailed explanation of various GPIO input and output modes (push-pull, open drain, quasi bidirectional port)
Alibaba cloud liupeizi: Inspiration from cloud games - innovation on the end
07. Express routing
关于#mysql#的问题:问题遇到的现象和发生背景
d3dx9_ 39.dll how to repair -d3dx9_ 39.dll missing file download
一个机器人位于一个 m x n 网格的左上角 。机器人每次只能向下或者向右移动一步。机器人试图达到网格的右下角。问总共有多少条不同的路径?【LeetCodeHot100】
Oracle concept II
QT5 之信号与槽机制(演示控件自带的信号与槽函数关联)
Missing d3d10 How to repair DLL files? Where can I download d3d10.dll
428-二叉树(501.二叉搜索树中的众数、701.二叉搜索树中的插入操作、450.删除二叉搜索树中的节点、669. 修剪二叉搜索树)
锚文本大量丢失的问题