mirror of
https://github.com/aolofsson/oh.git
synced 2025-02-07 06:44:09 +08:00
Adding datagate power saving module
This commit is contained in:
parent
8464c3dcb0
commit
eb8f6c1f51
26
common/hdl/oh_datagate.v
Normal file
26
common/hdl/oh_datagate.v
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
module oh_datagate (/*AUTOARG*/
|
||||||
|
// Outputs
|
||||||
|
dout,
|
||||||
|
// Inputs
|
||||||
|
clk, en, din
|
||||||
|
);
|
||||||
|
|
||||||
|
parameter DW = 32;
|
||||||
|
parameter PS = 3;
|
||||||
|
|
||||||
|
input clk;
|
||||||
|
input en;
|
||||||
|
input [DW-1:0] din;
|
||||||
|
output [DW-1:0] dout;
|
||||||
|
|
||||||
|
reg [PS-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};
|
||||||
|
|
||||||
|
assign dout[DW-1:0] = {(DW){enable}} & din[DW-1:0];
|
||||||
|
|
||||||
|
|
||||||
|
endmodule // oh_datagate
|
Loading…
x
Reference in New Issue
Block a user