1
0
mirror of https://github.com/aolofsson/oh.git synced 2025-01-30 02:32:53 +08:00
oh/common/hdl/oh_clockor.v

41 lines
1.1 KiB
Coq
Raw Normal View History

2016-06-24 22:11:23 -04:00
//#############################################################################
//# Function: Clock 'OR' gate #
//#############################################################################
//# Author: Andreas Olofsson #
//# License: MIT (see LICENSE file in OH! repository) #
//#############################################################################
module oh_clockor #(parameter N = 1) // number of clock inputs
2016-06-24 22:11:23 -04:00
(
input [N-1:0] clkin,// one hot clock inputs (only one is active!)
output clkout
);
`ifdef CFG_ASIC
2016-06-24 22:11:23 -04:00
generate
if((N==4))
2016-06-24 22:11:23 -04:00
begin : asic
asic_clockor4 ior (/*AUTOINST*/
// Outputs
.clkout (clkout),
// Inputs
.clkin (clkin[3:0]));
end // block: g0
else if((N==2))
begin : asic
asic_clockor2 ior (/*AUTOINST*/
// Outputs
.clkout (clkout),
// Inputs
.clkin (clkin[1:0]));
2016-06-24 22:11:23 -04:00
end
endgenerate
`else
assign clkout = |(clkin[N-1:0]);
`endif
2016-06-24 22:11:23 -04:00
endmodule // oh_clockmux