File tree 1 file changed +11
-8
lines changed
1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change 35
35
36
36
/* --- INSTANTIATION TEMPLATE BEGIN ---
37
37
38
- cdc_strobe_v2 cdc_wr_req (
38
+ cdc_strobe cdc_wr_req (
39
39
.arst( 1'b0 ),
40
40
41
41
.clk1( clk1 ),
@@ -77,19 +77,22 @@ module cdc_strobe (
77
77
// strb1 edge detector
78
78
// prevents secondary strobe generation in case strb1 is not one-cycle-high
79
79
logic strb1_ed;
80
- assign strb1_ed = (~ strb1_b && strb1) && ~ arst;
81
-
80
+ assign strb1_ed = ( ~ strb1_b && strb1 );
82
81
83
82
// 2 bit gray counter, it must NEVER be reset
84
83
logic [1 : 0 ] gc_FP_ATTR = '0 ;
85
- always @ (posedge clk1) begin
86
- if ( strb1_ed ) begin
87
- gc_FP_ATTR[1 : 0 ] <= { gc_FP_ATTR[0 ],~ gc_FP_ATTR[1 ]} ; // incrementing counter
84
+ always @ (posedge clk1 or posedge arst) begin
85
+ if ( arst ) begin
86
+ // nop
87
+ end else begin
88
+ if ( strb1_ed ) begin
89
+ gc_FP_ATTR[1 : 0 ] <= { gc_FP_ATTR[0 ],~ gc_FP_ATTR[1 ]} ; // incrementing counter
90
+ end
88
91
end
89
92
end
90
93
91
94
// buffering counter value on clk2
92
- // gray counter does not need a synchronizer
95
+ // gray counter doesnt need a synchronizer
93
96
logic [1 : 0 ][1 : 0 ] gc_b = '0 ;
94
97
always @ (posedge clk2 or posedge arst) begin
95
98
if ( arst ) begin
@@ -102,7 +105,7 @@ module cdc_strobe (
102
105
end
103
106
104
107
// gray_bit_b edge detector
105
- assign strb2 = (gc_b[1 ][1 : 0 ] != gc_b[0 ][1 : 0 ] ) && ~ arst ;
108
+ assign strb2 = ( gc_b[1 ][1 : 0 ] != gc_b[0 ][1 : 0 ] );
106
109
107
110
108
111
endmodule
You can’t perform that action at this time.
0 commit comments