aboutsummaryrefslogtreecommitdiff
path: root/top_simple/src/top_simple.scala
diff options
context:
space:
mode:
authorFriedrich Beckmann <friedrich.beckmann@tha.de>2026-03-28 07:59:30 +0100
committerFriedrich Beckmann <friedrich.beckmann@tha.de>2026-03-28 07:59:30 +0100
commit9d8b7ca4eaf712a3251f985fd1e93a0f0e568c16 (patch)
treeb414a6478771a2aa362d33341671a5bfb24ff20f /top_simple/src/top_simple.scala
init
Diffstat (limited to 'top_simple/src/top_simple.scala')
-rw-r--r--top_simple/src/top_simple.scala27
1 files changed, 27 insertions, 0 deletions
diff --git a/top_simple/src/top_simple.scala b/top_simple/src/top_simple.scala
new file mode 100644
index 0000000..ec43fe8
--- /dev/null
+++ b/top_simple/src/top_simple.scala
@@ -0,0 +1,27 @@
+package top_simple
+
+import spinal.core._
+
+// Hardware definition
+case class top_simple() extends Component {
+ val io = new Bundle {
+ val SW = in Bits(10 bits)
+ val LEDR = out Bits(10 bits)
+ val LEDG = out Bits(8 bits)
+ }
+ // Remove io_ from the port names in generated vhdl code
+ noIoPrefix()
+
+ io.LEDR := io.SW
+ io.LEDG := "00000000"
+
+}
+
+// The following defines the vhdl and verilog code generation
+object verilog extends App {
+ Config.spinal.generateVerilog(top_simple())
+}
+
+object vhdl extends App {
+ Config.spinal.generateVhdl(top_simple())
+}