aboutsummaryrefslogtreecommitdiffstats
path: root/examples/anlogic/demo.v
diff options
context:
space:
mode:
authorEddie Hung <eddieh@ece.ubc.ca>2019-03-19 08:52:31 -0700
committerEddie Hung <eddieh@ece.ubc.ca>2019-03-19 08:52:31 -0700
commit02e8dc7ad2e13a43a310d311302c6db8168e6c11 (patch)
treeaf43bf9735fe47b09dbd8807c63fe451eb82aaba /examples/anlogic/demo.v
parent3e89cf68bdc4e9eeb55bd9450121f421bcdc554a (diff)
parent61f37706f93042c2d1f093dd9bfa717390911eb3 (diff)
downloadyosys-02e8dc7ad2e13a43a310d311302c6db8168e6c11.tar.gz
yosys-02e8dc7ad2e13a43a310d311302c6db8168e6c11.tar.bz2
yosys-02e8dc7ad2e13a43a310d311302c6db8168e6c11.zip
Merge https://github.com/YosysHQ/yosys into read_aiger
Diffstat (limited to 'examples/anlogic/demo.v')
-rw-r--r--examples/anlogic/demo.v18
1 files changed, 18 insertions, 0 deletions
diff --git a/examples/anlogic/demo.v b/examples/anlogic/demo.v
new file mode 100644
index 000000000..e17db771e
--- /dev/null
+++ b/examples/anlogic/demo.v
@@ -0,0 +1,18 @@
+module demo (
+ input wire CLK_IN,
+ output wire R_LED
+);
+ parameter time1 = 30'd12_000_000;
+ reg led_state;
+ reg [29:0] count;
+
+ always @(posedge CLK_IN)begin
+ if(count == time1)begin
+ count<= 30'd0;
+ led_state <= ~led_state;
+ end
+ else
+ count <= count + 1'b1;
+ end
+ assign R_LED = led_state;
+endmodule