当前位置:网站首页>[Verilog advanced challenge of Niuke network question brushing series] ~ multi bit MUX synchronizer
[Verilog advanced challenge of Niuke network question brushing series] ~ multi bit MUX synchronizer
2022-07-07 19:18:00 【AI is very good】
Catalog :
0. Preface
I haven't updated Niu Ke's blog for a few days , I'm busy recently , I can only try to do one watch every day !!! Brush the questions at the same time , Make it small on one side demo, Keep on learning .
Today's problem is mainly a multi bit data transmission across the clock domain , It is also a common question type , It works , How to deal with cross clock domain , You can move to a blog I wrote before , Portal
1. VL48 many bit MUX synchronizer
1.1 Title Description
stay data_en For the high period ,data_in Will remain unchanged ,data_en Keep at least 3 individual B Clock cycle . indicate , When data_en For the high time , Data can be synchronized .
In this question data_in The frequency of data change at the end is very low , The change between two adjacent data , At least at intervals 10 individual B Clock cycle .
1.1.1 Signal schematic diagram


1.1.2 Waveform diagram
nothing
1.1.3 Input description
input clk_a ,
input clk_b ,
input arstn ,
input brstn ,
input [3:0] data_in ,
input data_en
1.1.4 Output description
output reg [3:0] dataout
1.2 Their thinking
According to the meaning of the topic, the general framework is as follows :
among , The red box indicates data temporary storage as well as Enable temporary storage ; The blue box indicates cross clock domain processing , Use the shape of two beats to complete ; The green box indicates MUX Select and temporarily output the results .
1.3 Code implementation
`timescale 1ns/1ns
module mux(
input clk_a ,
input clk_b ,
input arstn ,
input brstn ,
input [3:0] data_in ,
input data_en ,
output reg [3:0] dataout
);
// The staging data_en
reg data_en_reg;
always @ (posedge clk_a or negedge arstn) begin
if(!arstn) begin
data_en_reg <= 1'b0;
end
else begin
data_en_reg <= data_en;
end
end
//data_in
reg [3:0] data_in_reg;
always @ (posedge clk_a or negedge arstn) begin
if(!arstn) begin
data_in_reg <= 4'd0;
end
else begin
data_in_reg <= data_in;
end
end
// Two beats , Transition across clock domains
reg data_en_ab1, data_en_ab2;
always @ (posedge clk_b or negedge brstn) begin
if(!brstn) begin
data_en_ab1 <= 1'b0;
data_en_ab2 <= 1'b0;
end
else begin
data_en_ab1 <= data_en_reg;
data_en_ab2 <= data_en_ab1;
end
end
// MUX
always @ (posedge clk_b or negedge brstn) begin
if(!brstn) begin
dataout <= 4'd0;
end
else begin
dataout <= data_en_ab2 ? data_in_reg : dataout;
end
end
endmodule
1.4 The test file
To be updated ...
1.5 Simulation waveform
To be updated ...
Statement
All my series of articles , Just for learning , Not for commercial use , If there is any infringement , Please inform , To delete !!!
I mainly record the learning process , For myself to review , Then it is to provide reference for future generations , No joy, no spray. !!!
If it's useful to you , Remember to collect + Comment on !!!
边栏推荐
- IP netns command (memo)
- 如何选择合适的自动化测试工具?
- How to implement safety practice in software development stage
- Experiment 1 of Compilation Principle: automatic implementation of lexical analyzer (Lex lexical analysis)
- Numpy——2. Shape of array
- In the first half of 2022, I found 10 books that have been passed around by my circle of friends
- Short selling, overprinting and stock keeping, Oriental selection actually sold 2.66 million books in Tiktok in one month
- Redis publishing and subscription
- 从39个kaggle竞赛中总结出来的图像分割的Tips和Tricks
- Hutool - lightweight DB operation solution
猜你喜欢

Desci: is decentralized science the new trend of Web3.0?

RISCV64

Three forms of multimedia technology commonly used in enterprise exhibition hall design

前首富,沉迷种田

微信网页调试8.0.19换掉X5内核,改用xweb,所以x5调试方式已经不能用了,现在有了解决方案

Numpy——axis
![Jerry's headphones with the same channel are not allowed to pair [article]](/img/7d/3dcd9c7df583944e1d765b67543eb1.png)
Jerry's headphones with the same channel are not allowed to pair [article]

App capture of charles+postern

Wechat web debugging 8.0.19 replace the X5 kernel with xweb, so the X5 debugging method can no longer be used. Now there is a solution

从39个kaggle竞赛中总结出来的图像分割的Tips和Tricks
随机推荐
App capture of charles+drony
ES6 note 1
Zhong Xuegao wants to remain innocent in the world
编译原理 实验一:词法分析器的自动实现(Lex词法分析)
高温火烧浑不怕,钟薛高想留清白在人间
【牛客网刷题系列 之 Verilog进阶挑战】~ 多bit MUX同步器
Desci: is decentralized science the new trend of Web3.0?
杰理之快速配对,不支持取消配对【篇】
2022.07.04
L1-028 judging prime number (Lua)
Complete e-commerce system
99% of people don't know that privatized deployment is also a permanently free instant messaging software!
AI写首诗
Interview vipshop internship testing post, Tiktok internship testing post [true submission]
App capture of charles+postern
Reuse of data validation framework Apache bval
Numpy——2. Shape of array
Command mode - unity
[Blue Bridge Cup training 100 questions] sort scratch from small to large. Blue Bridge Cup scratch competition special prediction programming question centralized training simulation exercise question
Number - number (Lua)