1 多时钟域的异步复位同步释放
当外部输入的复位信号只有一个,但是时钟域有多个时,使用每个时钟搭建自己的复位同步器即可,如下所示。
verilog代码如下:
module CLOCK_RESET( input rst_n, input aclk, input bclk, input cclk, output reg arst_n, output reg brst_n, output reg crst_n );
reg arst_n0,arst_n1;reg brst_n0,brst_n1;reg crst_n0,crst_n1;
always @(posedge aclk or negedge rst_n) if(rst_n==0) begin arst_n0《=1‘b1; arst_n1《=1’b0; arst_n《=1‘b0; end else begin arst_n《=arst_n1; arst_n1《=arst_n0; end always @(posedge bclk or negedge rst_n) if(rst_n==0) begin brst_n0《=1’b1; brst_n1《=1‘b0; brst_n《=1’b0; end else begin brst_n《=brst_n1; brst_n1《=brst_n0; end always @(posedge cclk or negedge rst_n) if(rst_n==0) begin crst_n0《=1‘b1; crst_n1《=1’b0; crst_n《=1‘b0; end else begin crst_n《=crst_n1; crst_n1《=crst_n0; end endmodule
2 多时钟域的按顺序复位释放
当多个时钟域之间对复位释放的时间有顺序要求时,将复位同步器级联起来就可以构成多个时钟域按顺序的复位释放(实际上就是延迟两拍)。
verilog代码:
module CLOCK_RESET( input rst_n, input aclk, input bclk, input cclk, output reg arst_n, output reg brst_n, output reg crst_n );
reg arst_n0,arst_n1;reg brst_n0,brst_n1;reg crst_n0,crst_n1;
always @(posedge aclk or negedge rst_n) if(rst_n==0) begin arst_n0《=1’b1; arst_n1《=1‘b0; arst_n《=1’b0; end else begin arst_n《=arst_n1; arst_n1《=arst_n0; end always @(posedge bclk or negedge rst_n) if(rst_n==0) begin brst_n1《=1‘b0; brst_n《=1’b0; end else begin brst_n《=brst_n1; brst_n1《=arst_n; end always @(posedge cclk or negedge rst_n) if(rst_n==0) begin crst_n1《=1‘b0; crst_n《=1’b0; end else begin crst_n《=crst_n1; crst_n1《=brst_n; end endmodule
原文标题:RTL设计- 多时钟域按顺序复位释放
文章出处:【微信公众号:FPGA开源工作室】欢迎添加关注!文章转载请注明出处。
责任编辑:haq
-
时钟
+关注
关注
11文章
1749浏览量
131897 -
RTL
+关注
关注
1文章
385浏览量
60014
原文标题:RTL设计- 多时钟域按顺序复位释放
文章出处:【微信号:leezym0317,微信公众号:FPGA开源工作室】欢迎添加关注!文章转载请注明出处。
发布评论请先 登录
相关推荐
FPGA复位的8种技巧
![FPGA<b class='flag-5'>复位</b>的8种技巧](https://file1.elecfans.com/web1/M00/F5/38/wKgaoWc4ATOAbcWyAAASgM8ghVE065.jpg)
怎么判断同步清零和异步清零
异步置零和同步置零的区别在哪里
同步电路和异步电路怎么判断正负极
同步电路和异步电路的优缺点
同步电路和异步电路的优缺点有哪些
FPGA同步复位和异步复位
FPGA异步信号处理方法
L431采用PLL异步时钟,复位后ADC采样值发生偏差的原因?
verilog同步和异步的区别 verilog阻塞赋值和非阻塞赋值的区别
什么是复位同步电路 reset synchronizer?
![什么是<b class='flag-5'>复位</b><b class='flag-5'>同步</b>电路 reset synchronizer?](https://file1.elecfans.com/web2/M00/C1/07/wKgaomXSrhGAfPFtAAAVEFTgyYI591.png)
评论