quasar/soc/vsrc/gated_latch.sv

15 lines
246 B
Systemverilog
Raw Permalink Normal View History

2022-03-10 11:56:21 +08:00
module gated_latch
(
input logic SE, EN, CK,
output Q
);
logic en_ff;
logic enable;
assign enable = EN | SE;
always @(CK, enable) begin
if(!CK)
en_ff = enable;
end
assign Q = CK & en_ff;
endmodule