summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authortzlil <tzlils@protonmail.com>2023-11-16 19:29:37 +0200
committertzlil <tzlils@protonmail.com>2023-11-16 19:29:37 +0200
commit7be1c699f018d96540d76e67ad7254bafe4caab1 (patch)
treeb2819a19a816e2971426a08c1fa680a8fb3b6614 /src
inital commit
Diffstat (limited to 'src')
-rw-r--r--src/Blinker.hs32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/Blinker.hs b/src/Blinker.hs
new file mode 100644
index 0000000..30e6f0e
--- /dev/null
+++ b/src/Blinker.hs
@@ -0,0 +1,32 @@
+{-# OPTIONS_GHC -fno-warn-orphans #-}
+module Blinker where
+
+import Clash.Prelude
+import Clash.Annotations.SynthesisAttributes
+
+-- Define a synthesis domain with a clock with a period of 20000 /ps/.
+-- i.e. 50 MHz
+-- createDomain vSystem{vName="Input", vPeriod=20000}
+
+-- Define a synthesis domain with a clock with a period of 50000 /ps/.
+-- i.e. 20 MHz
+createDomain vSystem{vName="Dom20MHz", vPeriod=50000}
+
+{-# ANN topEntity
+  (Synthesize
+    { t_name   = "Blinker"
+    , t_inputs = [ PortName "KEY0" ]
+    , t_output = PortName "LED"
+    }) #-}
+topEntity ::
+  Signal Dom20MHz Bit
+    `Annotate` 'StringAttr "chip_pin" "AC9"
+    `Annotate` 'StringAttr
+                "altera_attribute" "-name IO_STANDARD \"3.3-V LVTTL\"" ->
+
+  Signal Dom20MHz Bit
+    `Annotate` 'StringAttr
+                "chip_pin" "F7"
+    `Annotate` 'StringAttr
+                "altera_attribute" "-name IO_STANDARD \"3.3-V LVTTL\""
+topEntity sw = sw
\ No newline at end of file