OpenFPGA/openfpga_flow/benchmarks/micro_benchmark/clk_gate/clk_gate.v

29 lines
543 B
Coq
Raw Normal View History

/////////////////////////////////////////
// Functionality: Use clock to gate the output of an AND2 gate
// This is to test if LUTs can be mapped as wires
// Author: Xifan Tang
////////////////////////////////////////
`timescale 1ns / 1ps
module clk_gate(
2022-09-29 17:32:31 -05:00
rst_i,
clk_i,
data_i,
data_o);
2022-09-29 17:32:31 -05:00
input wire rst_i;
input wire clk_i;
input wire data_i;
output wire data_o;
reg q;
always @(posedge clk_i) begin
2022-09-29 17:32:31 -05:00
if (rst_i) begin
q <= 0;
end else begin
q <= 1;
end
end
assign data_o = data_i & q;
endmodule