File: app0.v

package info (click to toggle)
fpga-icestorm 0~20250207git7fbf8c0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,440 kB
  • sloc: python: 28,401; cpp: 4,970; sh: 2,594; ansic: 1,206; makefile: 697; xml: 16
file content (28 lines) | stat: -rw-r--r-- 470 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module top (
	input  clk,
	output LED1, LED2, LED3, LED4, LED5
);
	localparam LOG2DELAY = 22;

	reg [LOG2DELAY-1:0] counter = 0;
	reg [3:0] counter2 = 0;
	reg state = 0;

	always @(posedge clk) begin
		counter <= counter + 1;
		counter2 <= counter2 + !counter;
		state <= state ^ !counter;
	end

	assign LED1 = state;
	assign LED2 = 0;
	assign LED3 = 0;
	assign LED4 = 0;
	assign LED5 = 1;

	SB_WARMBOOT WB (
		.BOOT(&counter2),
		.S1(1'b 0),
		.S0(1'b 1)
	);
endmodule