summaryrefslogtreecommitdiff
path: root/playground/led_toggle_nonwork.v
diff options
context:
space:
mode:
authoruvok2026-01-09 15:18:23 +0100
committeruvok2026-01-09 15:18:23 +0100
commit6c83fd8730e55de8b1daaac1deb111d3d9bd408e (patch)
tree33a3dbc4fd87011b657b193224c3f39c5de6b766 /playground/led_toggle_nonwork.v
parent678cb2d2d752bbac7625ba9b287762b3acabf116 (diff)
move stuff around
Diffstat (limited to 'playground/led_toggle_nonwork.v')
-rw-r--r--playground/led_toggle_nonwork.v26
1 files changed, 26 insertions, 0 deletions
diff --git a/playground/led_toggle_nonwork.v b/playground/led_toggle_nonwork.v
new file mode 100644
index 0000000..5fe458f
--- /dev/null
+++ b/playground/led_toggle_nonwork.v
@@ -0,0 +1,26 @@
+`timescale 1us/1us
+
+//
+// NON-WORKING
+// LED toggle example
+// probably because LED is controlled by two blocks
+//
+
+module led_toggle_nonwork(
+ input clk_i,
+ input key_i,
+ input rst_i,
+ output reg [5:0] led
+);
+
+always @(negedge rst_i) begin
+ if (!rst_i)
+ led <= 6'b111111;
+end
+
+always @(negedge key_i) begin
+ if (!key_i)
+ led[0] <= ~led[0];
+end
+
+endmodule