mirror of
https://github.com/aolofsson/oh.git
synced 2025-01-17 20:02:53 +08:00
Removing delay + clock gating
- delay could hide bad designs.. - clock gating was hard to handle from outside
This commit is contained in:
parent
8f37435d95
commit
2a22cd6ff8
@ -39,12 +39,10 @@ module oh_iddr (/*AUTOARG*/
|
||||
|
||||
// falling edge sample
|
||||
always @ (negedge clk)
|
||||
if(ce)
|
||||
q2_sh[DW-1:0] <= din[DW-1:0];
|
||||
|
||||
// pipeline for alignment
|
||||
always @ (posedge clk)
|
||||
if(ce)
|
||||
begin
|
||||
q1[DW-1:0] <= q1_sl[DW-1:0];
|
||||
q2[DW-1:0] <= q2_sh[DW-1:0];
|
||||
|
@ -31,13 +31,14 @@ module oh_oddr (/*AUTOARG*/
|
||||
|
||||
//Generate different logic based on parameters
|
||||
always @ (posedge clk)
|
||||
if (ce)
|
||||
begin
|
||||
q1_sl[DW-1:0] <= #(0.1) din1[DW-1:0];
|
||||
q2_sl[DW-1:0] <= #(0.1) din2[DW-1:0];
|
||||
q1_sl[DW-1:0] <= din1[DW-1:0];
|
||||
q2_sl[DW-1:0] <= din2[DW-1:0];
|
||||
end
|
||||
|
||||
always @ (negedge clk)
|
||||
q2_sh[DW-1:0] <= #(0.1) q2_sl[DW-1:0];
|
||||
q2_sh[DW-1:0] <= q2_sl[DW-1:0];
|
||||
|
||||
assign out[DW-1:0] = clk ? q1_sl[DW-1:0] :
|
||||
q2_sh[DW-1:0];
|
||||
|
Loading…
x
Reference in New Issue
Block a user