当前位置:网站首页>(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边栏推荐
- How to modify / display GPIO status through ADB shell
- Introduction to photoswape
- Data center table reports realize customized statistics, overtime leave summary record sharing
- Determine the maximum number of specific words in a string
- A robot is located in the upper left corner of an M x n grid. The robot can only move down or right one step at a time. The robot attempts to reach the lower right corner of the grid. How many differe
- # Cesium实现卫星在轨绕行
- 当发布/订阅模式遇上.NET
- tensorflow求解泊松方程
- 深耕数字化,引领云原生,服务更多开发者
- 医院预约挂号系统-系统结构
猜你喜欢

Alibaba cloud liupeizi: Inspiration from cloud games - innovation on the end

d3dx9_ 39.dll how to repair -d3dx9_ 39.dll missing file download

Hierarchical clustering and case analysis

全面解析零知识证明:消解扩容难题 重新定义「隐私安全」

一个机器人位于一个 m x n 网格的左上角 。机器人每次只能向下或者向右移动一步。机器人试图达到网格的右下角。问总共有多少条不同的路径?【LeetCodeHot100】

树莓派初步使用

How to improve it electronic equipment performance management

米哈游起诉五矿信托,后者曾被曝产品暴雷

继手机之后 报道称三星也削减了电视等家电产品线的产量
#yyds干货盘点#简述chromeV8引擎垃圾回收
随机推荐
LACP details
印象深刻的问题
【多线程】线程通信调度、等待集 wait() 、notify()
Huawei cloud devcloud launched four new capabilities, setting two domestic firsts
09 route guard authenticates URL
Leetcode daily practice (sum of two numbers)
Annual comprehensive analysis of China's audio market in 2022
EMQ 助力青岛研博建设智慧水务平台
Oracle概念三
LeetCode每日一练(两数之和)
2022年中国音频市场年度综合分析
leetcode 69. Square root of X
医院预约挂号系统-系统结构
LeetCode 124. Binary tree maximum path sum - binary tree series question 8
软件测试-测试的概念,单元测试的详细介绍,如何设计测试用例
What do fast fashion brands care more about?
CDH cluster installation
C language teacher workload management system
一个机器人位于一个 m x n 网格的左上角 。机器人每次只能向下或者向右移动一步。机器人试图达到网格的右下角。问总共有多少条不同的路径?【LeetCodeHot100】
C語言教師工作量管理系統