aboutsummaryrefslogtreecommitdiffstats
path: root/machxo2/examples/tinyfpga.v
diff options
context:
space:
mode:
authorWilliam D. Jones <thor0505@comcast.net>2021-01-31 22:42:15 -0500
committergatecat <gatecat@ds0.me>2021-02-12 10:36:59 +0000
commitd0b822c0365c52a8a8439094f2268cfa0c461b5e (patch)
tree93d3c3df26a501ff3b05fd7ff416c4315f9fd8b9 /machxo2/examples/tinyfpga.v
parent0250aaaddd499bce9a6739823f5511859ec57232 (diff)
downloadnextpnr-d0b822c0365c52a8a8439094f2268cfa0c461b5e.tar.gz
nextpnr-d0b822c0365c52a8a8439094f2268cfa0c461b5e.tar.bz2
nextpnr-d0b822c0365c52a8a8439094f2268cfa0c461b5e.zip
machxo2: Add demo.sh TinyFPGA Ax example.
Diffstat (limited to 'machxo2/examples/tinyfpga.v')
-rw-r--r--machxo2/examples/tinyfpga.v28
1 files changed, 28 insertions, 0 deletions
diff --git a/machxo2/examples/tinyfpga.v b/machxo2/examples/tinyfpga.v
new file mode 100644
index 00000000..dfc2710d
--- /dev/null
+++ b/machxo2/examples/tinyfpga.v
@@ -0,0 +1,28 @@
+// Modified from:
+// https://github.com/tinyfpga/TinyFPGA-A-Series/tree/master/template_a2
+// https://tinyfpga.com/a-series-guide.html used as a basis.
+
+module TinyFPGA_A2 (
+ (* LOC="13" *)
+ inout pin1
+);
+
+
+ wire clk;
+
+ OSCH #(
+ .NOM_FREQ("16.63")
+ ) internal_oscillator_inst (
+ .STDBY(1'b0),
+ .OSC(clk)
+ );
+
+ reg [23:0] led_timer;
+
+ always @(posedge clk) begin
+ led_timer <= led_timer + 1;
+ end
+
+ // left side of board
+ assign pin1 = led_timer[23];
+endmodule