diff options
author | Clifford Wolf <clifford@clifford.at> | 2017-09-14 19:09:52 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2017-09-14 19:09:52 +0200 |
commit | 5c4d4db08d39673b98ce953f1ab1d1368eeb2f44 (patch) | |
tree | 4f449b7cf9b88b48156ee503f14d486845b8bbdb /examples/icemulti/app1.v | |
parent | d0f5b2ee8efd4c6babab101f68087f8339138317 (diff) | |
download | icestorm-5c4d4db08d39673b98ce953f1ab1d1368eeb2f44.tar.gz icestorm-5c4d4db08d39673b98ce953f1ab1d1368eeb2f44.tar.bz2 icestorm-5c4d4db08d39673b98ce953f1ab1d1368eeb2f44.zip |
Add icemulti example
Diffstat (limited to 'examples/icemulti/app1.v')
-rw-r--r-- | examples/icemulti/app1.v | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/examples/icemulti/app1.v b/examples/icemulti/app1.v new file mode 100644 index 0000000..ac863ce --- /dev/null +++ b/examples/icemulti/app1.v @@ -0,0 +1,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 = 0; + assign LED2 = state; + assign LED3 = 0; + assign LED4 = 0; + assign LED5 = 1; + + SB_WARMBOOT WB ( + .BOOT(&counter2), + .S1(1'b 1), + .S0(1'b 0) + ); +endmodule |