nextpnr/fpga_interchange/examples/counter/counter.v
Keith Rothman 9cbfd0b967 Add counter test.
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
2021-02-26 11:01:22 -08:00

16 lines
239 B
Verilog

module top(input clk, input rst, output [7:4] io_led);
reg [31:0] counter = 32'b0;
assign io_led = counter >> 22;
always @(posedge clk)
begin
if(rst)
counter <= 32'b0;
else
counter <= counter + 1;
end
endmodule