mirror of
https://github.com/aolofsson/oh.git
synced 2025-02-07 06:44:09 +08:00
36 lines
1.0 KiB
Verilog
36 lines
1.0 KiB
Verilog
//#############################################################################
|
|
//# Function: Low power clock gate circuit #
|
|
//#############################################################################
|
|
//# Author: Andreas Olofsson #
|
|
//# License: MIT (see LICENSE file in OH! repository) #
|
|
//#############################################################################
|
|
|
|
module oh_clockgate (
|
|
input clk, // clock input
|
|
input te, // test enable
|
|
input en, // enable (from positive edge FF)
|
|
output eclk // enabled clock output
|
|
);
|
|
|
|
`ifdef CFG_ASIC
|
|
asic_icg icg (.en(en),
|
|
.te(te),
|
|
.clk(clk),
|
|
.eclk(eclk));
|
|
`else
|
|
wire en_sh;
|
|
wire en_sl;
|
|
//Stable low/valid rising edge enable
|
|
assign en_sl = en | te;
|
|
//Stable high enable signal
|
|
oh_lat0 lat0 (.out (en_sh),
|
|
.in (en_sl),
|
|
.clk (clk));
|
|
|
|
assign eclk = clk & en_sh;
|
|
`endif // !`ifdef CFG_ASIC
|
|
|
|
endmodule // oh_clockgate
|
|
|
|
|