当前位置:网站首页>Details of FPGA syntax
Details of FPGA syntax
2022-06-12 05:31:00 【Tiger Mousse】
This paper records some vivado A small experiment in the use process , To help you understand better verilog Language .
List of articles
About data types
The experiment purpose : Explore register data type blocking assignments 、 Register type non blocking assignment 、 The difference between the assignment of network type .
Source file :
module HDMI_preview(
clk,
reset_p,
A,// Enter a number
B,// The output register is non blocking - Sequential logic
C,// The output register is blocked - Sequential logic
B1,// The output register is non blocking - Combinatorial logic
C1,// The output register is blocked - Combinatorial logic
D // Output network type
);
input clk;
input reset_p;
input A;
output reg B;
output reg C;
output reg B1;
output reg C1;
output wire D;
//always Block with clockticks , That is, temporal logic
[email protected](posedge clk or posedge reset_p)begin
B <= A;
C = A;
end
//always Block without clockticks , That is, combinatorial logic
[email protected](*)begin
B1 <= A;
C1 = A;
end
// Network types are all combinatorial logic
assign D = A;
endmodule
Test code :
`timescale 1ns / 1ps
module tb_HDMI_preview();
reg clk;
reg reset_p;
reg A;
wire B;
wire C;
wire B1;
wire C1;
wire D;
HDMI_preview HDMI_preview(
clk,
reset_p,
A,// Enter a number
B,// The output register is non blocking - Sequential logic
C,// The output register is blocked - Sequential logic
B1,// The output register is non blocking - Combinatorial logic
C1,// The output register is blocked - Combinatorial logic
D // Output network type
);
initial clk = 0;
always#4 clk = !clk;
initial begin
reset_p = 0;
A = 0;
repeat(10)begin
#10;
A = !A;
end
$stop;
end
endmodule
experimental result :

The experimental conclusion :
- reg Data types can only be used in always block 、initial Block defines , But it can be non blocking assignment <=, Assignment can also be blocked =. When always Block defines the clock signal , Equivalent to sequential logic ; When always When the block has no clockticks , Equivalent to combinatorial logic , It is no different from the network type . It is equivalent to giving reg Signals provide a representation of combinatorial logic .
- wire Data types do not wait for the clock edge to change , Non blocking assignment is not allowed , Always combinatorial logic .
- stay always There is no difference between blocking assignment and non blocking assignment , Mainly because always The signal in the block will change its value only at the specified edge .
- Clock signal 0s It defaults to an edge .
- Observe B、C Initial value of signal , You can find reg The initial value of the data type signal is an indefinite value .
边栏推荐
- Kubernetes certificate online update
- Introduction to MMS memory optimization of Hisilicon MPP service
- 【js小知识】轻松了解js防抖与节流
- 17. print from 1 to the maximum n digits
- MySQL Linux Installation mysql-5.7.24
- 38. appearance series
- Halcon 3D 1 读取3d数据
- Multi thread learning 4. Sleep, wait, yield, join (), ThreadGroup control the running of threads
- Test work summary - performance test related issues
- UBI details and JFFS2 square FS UBIFS
猜你喜欢

Codis 3. X expansion and contraction

yolov5

Matlab: image rotation and interpolation and comparison of MSE before and after

Development of video preview for main interface of pupanvr-ui

Go 面向接口编程实战

Multi thread learning v. volatile visibility and cache inconsistency, instruction reordering

国企为什么要上市

How long is the company's registered capital subscribed

WebRTC AEC 流程解析

week7
随机推荐
49. ugly number
yolov5
Legal liabilities to be borne by the person in charge of the branch
Deep understanding of asynchronous programming
FPGA语法的细节
Fundamentals of intensive learning openai gym environment construction demo
Analysis of pointer
AddUser add user and mount hard disk
Esp32-who face detection
利用jieba库进行词频统计
Selenium crawler automatically captures TOEFL test position of NEEA website
Redis cluster cluster capacity expansion and data migration
JS how to get the date
How to deploy dolphin scheduler Apache dolphin scheduler 1.2.0 in cdh5.16.2
[getting to the bottom] five minutes to understand the combination evaluation model - fuzzy borde (taking the C question of the 2021 college students' numerical simulation national competition as an e
Lldp protocol
Why can't NAND flash be used as RAM while nor flash can
Deploying a single node kubernetes cluster using rancher-2.5.5
57 - II. Continuous positive sequence with sum s
38. arrangement of strings