nextpnr/fpga_interchange/examples/tests/counter/counter.v
Alessandro Comodi 490ca794c5 interchange: tests: counter: emit carries for xc7
Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
2021-06-11 11:19:01 +02:00

18 lines
290 B
Verilog

module top(input clk, input rst, output [7:4] io_led);
localparam SIZE = 32;
reg [SIZE-1:0] counter = SIZE'b0;
assign io_led = {counter[SIZE-1], counter[25:23]};
always @(posedge clk)
begin
if(rst)
counter <= SIZE'b0;
else
counter <= counter + 1;
end
endmodule