1 多時鐘域的異步復(fù)位同步釋放
當外部輸入的復(fù)位信號只有一個,但是時鐘域有多個時,使用每個時鐘搭建自己的復(fù)位同步器即可,如下所示。
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 多時鐘域的按順序復(fù)位釋放
當多個時鐘域之間對復(fù)位釋放的時間有順序要求時,將復(fù)位同步器級聯(lián)起來就可以構(gòu)成多個時鐘域按順序的復(fù)位釋放(實際上就是延遲兩拍)。
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設(shè)計- 多時鐘域按順序復(fù)位釋放
文章出處:【微信公眾號:FPGA開源工作室】歡迎添加關(guān)注!文章轉(zhuǎn)載請注明出處。
責任編輯:haq
-
時鐘
+關(guān)注
關(guān)注
11文章
1898瀏覽量
133192 -
RTL
+關(guān)注
關(guān)注
1文章
389瀏覽量
61063
原文標題:RTL設(shè)計- 多時鐘域按順序復(fù)位釋放
文章出處:【微信號:leezym0317,微信公眾號:FPGA開源工作室】歡迎添加關(guān)注!文章轉(zhuǎn)載請注明出處。
發(fā)布評論請先 登錄
AMD FPGA異步模式與同步模式的對比
跨異步時鐘域處理方法大全

在不同時鐘域下,多片ADS131E08如何實現(xiàn)不間斷的同步采集?
FPGA復(fù)位的8種技巧

評論