当前位置:网站首页>(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边栏推荐
- All you want to know about large screen visualization is here
- Construction and management practice of ByteDance buried point data flow
- Oracle概念二
- leetcode 92. Reverse linked list II
- Array represents a collection of several intervals. Please merge all overlapping intervals and return a non overlapping interval array. The array must exactly cover all the intervals in the input. 【Le
- Yyds dry inventory brief chrome V8 engine garbage collection
- 2/14 preliminary calculation geometry
- Etcd visualization tool: kstone deployment (I), rapid deployment based on Helm
- 深耕数字化,引领云原生,服务更多开发者
- EMQ helps Qingdao Yanbo build a smart water platform
猜你喜欢

After the mobile phone, it was reported that Samsung also cut the output of TV and other home appliance product lines

Oracle concept II

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

Halcon: discrete digital OCR recognition

阿里云刘珅孜:云游戏带来的启发——端上创新

电子智慧套装教程

智慧风电 | 图扑软件数字孪生风机设备,3D 可视化智能运维

Raspberry pie preliminary use

Leetcode 33. Search rotation sort array

Use pyinstaller to package py files into exe. Precautions and error typeerror:_ get_ sysconfigdata_ name() missing 1...‘ check_ Solutions to exists'
随机推荐
10 minutes to master the installation steps of MySQL
About how vs2019c # establishes the login interface, the user name and password entered must match the records in the access database
SQLite net (SQLite is used by unity, WPF and WinForm)
leetcode 82. Delete duplicate Element II in the sorting linked list
Defiato is an innovation that combines user-friendly features of a centralized platform with defi services
国家食品安全风险评估中心:不要盲目片面追捧标签为“零添加”“纯天然”食品
[qt learning notes]qt uses MFC compilation to generate DLL libraries. The problem that DLL cannot be loaded occurs on computers without programming environment
C système de gestion de la charge de travail des enseignants en langues
C语言课程设计
Solving Poisson equation by tensorflow
Under the influence of external factors, how to manage internal resources and reduce costs is the key
Raspberry pie preliminary use
锚文本大量丢失的问题
Handling of difficult and miscellaneous problems during the installation and configuration of qt5.5.1 desktop version (configuring arm compilation Kit)
LACP details
428-二叉树(501.二叉搜索树中的众数、701.二叉搜索树中的插入操作、450.删除二叉搜索树中的节点、669. 修剪二叉搜索树)
Ti Click: quickly set up tidb online laboratory through browser | ti- team interview can be conducted immediately
Smart wind power | Tupu software digital twin wind turbine equipment, 3D visual intelligent operation and maintenance
[the way of programmer training] - 3 Character count statistics
2/14 preliminary calculation geometry