mirror of
https://github.com/aolofsson/oh.git
synced 2025-01-30 02:32:53 +08:00
Fix datagate bug!
-Was not turned on at all! Alwats on
This commit is contained in:
parent
069681ca6a
commit
4f0f81997e
@ -4,9 +4,10 @@
|
||||
//# Author: Andreas Olofsson #
|
||||
//# License: MIT (see LICENSE file in OH! repository) #
|
||||
//#############################################################################
|
||||
//
|
||||
|
||||
module oh_datagate #(parameter DW = 32, // width of data inputs
|
||||
parameter PS = 3 // min quiet time before shutdown
|
||||
parameter N = 3 // min quiet time before shutdown
|
||||
)
|
||||
(
|
||||
input clk, // clock
|
||||
@ -15,14 +16,13 @@ module oh_datagate #(parameter DW = 32, // width of data inputs
|
||||
output [DW-1:0] dout // data output
|
||||
);
|
||||
|
||||
|
||||
reg [PS-1:0] enable_pipe;
|
||||
wire enable;
|
||||
reg [N-1:0] enable_pipe;
|
||||
|
||||
always @ (posedge clk)
|
||||
enable_pipe[PS-1:0] <= {enable_pipe[PS-2:0],en};
|
||||
|
||||
assign enable = {enable_pipe[PS-1:0],en};
|
||||
//Mask to 0 if no valid for last N cycles
|
||||
assign enable = en | (|enable_pipe[N-1:0]);
|
||||
|
||||
assign dout[DW-1:0] = {(DW){enable}} & din[DW-1:0];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user