diff options
author | Clifford Wolf <clifford@clifford.at> | 2016-12-29 13:46:20 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2016-12-29 13:47:36 +0100 |
commit | 47d28bff1206fb007238b16fe4ad9fea76970002 (patch) | |
tree | 25ebfec188a9e4ebb8af3a7e0e53efaa64835300 /examples/icezum/example.v | |
parent | 7d8337a138fef3417b9f41cc6635c9562f4d9b4a (diff) | |
download | icestorm-47d28bff1206fb007238b16fe4ad9fea76970002.tar.gz icestorm-47d28bff1206fb007238b16fe4ad9fea76970002.tar.bz2 icestorm-47d28bff1206fb007238b16fe4ad9fea76970002.zip |
Added iCEZUM example
Diffstat (limited to 'examples/icezum/example.v')
-rw-r--r-- | examples/icezum/example.v | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/examples/icezum/example.v b/examples/icezum/example.v new file mode 100644 index 0000000..9bdf587 --- /dev/null +++ b/examples/icezum/example.v @@ -0,0 +1,25 @@ +module top ( + input clk, + output LED0, + output LED1, + output LED2, + output LED3, + output LED4, + output LED5, + output LED6, + output LED7 +); + + localparam BITS = 3; + localparam LOG2DELAY = 20; + + reg [BITS+LOG2DELAY-1:0] counter = 0; + reg [BITS-1:0] outcnt; + + always@(posedge clk) begin + counter <= counter + 1; + outcnt <= counter >> LOG2DELAY; + end + + assign {LED7, LED6, LED5, LED4, LED3, LED2, LED1, LED0} = 1 << outcnt; +endmodule |