当前位置:网站首页>(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边栏推荐
- Deeply digitise, lead cloud nativity and serve more developers
- Leetcode 704. Binary search
- Use pyinstaller to package py files into exe. Precautions and error typeerror:_ get_ sysconfigdata_ name() missing 1...‘ check_ Solutions to exists'
- Community sharing jumpserver in the eyes of senior open source users: a fortress machine for "Crazy" iteration
- P4251 [scoi2015] small convex play matrix (still a little confused)
- #yyds干货盘点#简述chromeV8引擎垃圾回收
- Impressive questions
- 软件测试学习-黑马程序员,软件测试学习大纲
- Yyds dry inventory brief chrome V8 engine garbage collection
- tensorflow求解泊松方程
猜你喜欢

Oracle概念二

Synchronization mechanism of dual namenodes

Unity 阴影——阴影平坠(Shadow pancaking)

Oracle concept II

leetcode 92. Reverse linked list II

当发布/订阅模式遇上.NET

Missing d3d10 How to repair DLL files? Where can I download d3d10.dll

Community sharing jumpserver in the eyes of senior open source users: a fortress machine for "Crazy" iteration

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

# Cesium实现卫星在轨绕行
随机推荐
After the mobile phone, it was reported that Samsung also cut the output of TV and other home appliance product lines
Etcd可视化工具:Kstone部署(一),基于Helm快速部署
Software testing learning - dark horse programmer, software testing learning outline
模拟进程调度
Special function calculator
Detailed explanation of various GPIO input and output modes (push-pull, open drain, quasi bidirectional port)
Kubernetes basic self-study series | introduction to ingress API
About how vs2019c # establishes the login interface, the user name and password entered must match the records in the access database
d3dx9_ 39.dll how to repair -d3dx9_ 39.dll missing file download
Missing d3d10 How to repair DLL files? Where can I download d3d10.dll
How to modify / display GPIO status through ADB shell
Hierarchical clustering and case analysis
智慧风电 | 图扑软件数字孪生风机设备,3D 可视化智能运维
Related configuration commands of Huawei LACP
Performance problems caused by redis cache invalidation and competitive loading
特殊函数计算器
Determine the maximum number of specific words in a string
Yyds dry inventory brief chrome V8 engine garbage collection
软件测试学习-黑马程序员,软件测试学习大纲
leetcode 200. Number of islands