summary refs log tree commit diff
path: root/src/Blinker.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Blinker.hs')
-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