aboutsummaryrefslogtreecommitdiffstats
path: root/examples/icestick/example.v
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2015-12-08 12:54:20 +0100
committerClifford Wolf <clifford@clifford.at>2015-12-08 12:54:20 +0100
commitf7cb6e8e07c9b314e5052c4b0416db422dbdeb7b (patch)
tree28a2a4f556f0b319285c0532c0a084ae5c16b47f /examples/icestick/example.v
parent2696346d6cbde636c24e853c18272d40b38285bf (diff)
downloadicestorm-f7cb6e8e07c9b314e5052c4b0416db422dbdeb7b.tar.gz
icestorm-f7cb6e8e07c9b314e5052c4b0416db422dbdeb7b.tar.bz2
icestorm-f7cb6e8e07c9b314e5052c4b0416db422dbdeb7b.zip
Added icestick and hx8kboard examples
Diffstat (limited to 'examples/icestick/example.v')
-rw-r--r--examples/icestick/example.v22
1 files changed, 22 insertions, 0 deletions
diff --git a/examples/icestick/example.v b/examples/icestick/example.v
new file mode 100644
index 0000000..cb7cfcd
--- /dev/null
+++ b/examples/icestick/example.v
@@ -0,0 +1,22 @@
+module top (
+ input clk,
+ output LED1,
+ output LED2,
+ output LED3,
+ output LED4,
+ output LED5
+);
+
+ localparam BITS = 5;
+ localparam LOG2DELAY = 22;
+
+ reg [BITS+LOG2DELAY-1:0] counter = 0;
+ reg [BITS-1:0] outcnt;
+
+ always@(posedge clk) begin
+ counter <= counter + 1;
+ outcnt <= counter >> LOG2DELAY;
+ end
+
+ assign {LED1, LED2, LED3, LED4, LED5} = outcnt ^ (outcnt >> 1);
+endmodule