aboutsummaryrefslogtreecommitdiffstats
path: root/machxo2/examples/tinyfpga.vhd
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-07-01 20:17:02 +0100
committerGitHub <noreply@github.com>2021-07-01 20:17:02 +0100
commitfe38e70dc1cd84a60e2fe05f7153c8deed1c16e9 (patch)
tree5752e4a2be0793539691580c02ea85933544c47f /machxo2/examples/tinyfpga.vhd
parent55c663f7ac63253124cffd1efec8b9b400658a3d (diff)
parent41d09f71871184aabbd7495a485e257fc0450d40 (diff)
downloadnextpnr-fe38e70dc1cd84a60e2fe05f7153c8deed1c16e9.tar.gz
nextpnr-fe38e70dc1cd84a60e2fe05f7153c8deed1c16e9.tar.bz2
nextpnr-fe38e70dc1cd84a60e2fe05f7153c8deed1c16e9.zip
Merge pull request #747 from cr1901/machxo2
MachXO2 Checkpoint 1
Diffstat (limited to 'machxo2/examples/tinyfpga.vhd')
-rw-r--r--machxo2/examples/tinyfpga.vhd38
1 files changed, 38 insertions, 0 deletions
diff --git a/machxo2/examples/tinyfpga.vhd b/machxo2/examples/tinyfpga.vhd
new file mode 100644
index 00000000..29705728
--- /dev/null
+++ b/machxo2/examples/tinyfpga.vhd
@@ -0,0 +1,38 @@
+library ieee ;
+context ieee.ieee_std_context;
+
+use work.components.all;
+
+entity top is
+ port (
+ pin1: out std_logic
+ );
+
+ attribute LOC: string;
+ attribute LOC of pin1: signal is "13";
+end;
+
+architecture arch of top is
+ signal clk: std_logic;
+ signal led_timer: unsigned(23 downto 0) := (others=>'0');
+begin
+
+ internal_oscillator_inst: OSCH
+ generic map (
+ NOM_FREQ => "16.63"
+ )
+ port map (
+ STDBY => '0',
+ OSC => clk
+ );
+
+ process(clk)
+ begin
+ if rising_edge(clk) then
+ led_timer <= led_timer + 1;
+ end if;
+ end process;
+
+ pin1 <= led_timer(led_timer'left);
+
+end;