aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5/synth/blinky.v
diff options
context:
space:
mode:
Diffstat (limited to 'ecp5/synth/blinky.v')
-rw-r--r--ecp5/synth/blinky.v16
1 files changed, 16 insertions, 0 deletions
diff --git a/ecp5/synth/blinky.v b/ecp5/synth/blinky.v
new file mode 100644
index 00000000..aba58801
--- /dev/null
+++ b/ecp5/synth/blinky.v
@@ -0,0 +1,16 @@
+module top(input clk_pin, output [3:0] led_pin);
+
+ wire clk;
+ wire [3:0] led;
+
+ TRELLIS_IO #(.DIR("INPUT")) clk_buf (.B(clk_pin), .O(clk));
+ TRELLIS_IO #(.DIR("OUTPUT")) led_buf [3:0] (.B(led_pin), .I(led));
+
+ reg [25:0] ctr = 0;
+
+ always@(posedge clk)
+ ctr <= ctr + 1'b1;
+
+ assign led = ctr[25:22];
+
+endmodule