diff --git a/asm/test/blink.s b/asm/test/blink.s new file mode 100644 index 0000000..6469336 --- /dev/null +++ b/asm/test/blink.s @@ -0,0 +1,47 @@ + + +start: + loadi 0 + loadhi 2 + store r0 +ll1: + loadi 255 + loadhi 255 +ll2: + subi 1 + nop + brnz ll2 + nop + load r0 + subi 1 + store r0 + brnz ll1 + nop + + loadi 0 + stind 0 + + loadi 0 + loadhi 2 + store r0 +ll3: + loadi 255 + loadhi 255 +ll4: + subi 1 + nop + brnz ll4 + nop + load r0 + subi 1 + store r0 + brnz ll3 + nop + + loadi 1 + stind 0 + + loadi 1 + nop + brnz start + diff --git a/src/main/scala/leros/Leros.scala b/src/main/scala/leros/Leros.scala index 4759698..018a227 100644 --- a/src/main/scala/leros/Leros.scala +++ b/src/main/scala/leros/Leros.scala @@ -87,7 +87,6 @@ class Leros(prog: String, size: Int = 32, memAddrWidth: Int = 8) extends LerosBa // connection to the external world (test) val exit = RegInit(false.B) val outReg = RegInit(0.U(32.W)) - outReg := accu io.led := outReg switch(stateReg) { @@ -118,6 +117,8 @@ class Leros(prog: String, size: Int = 32, memAddrWidth: Int = 8) extends LerosBa when(decReg.isStoreInd) { dataMem.io.wr := true.B alu.io.enaMask := 0.U + // TODO: this is a super quick hack to get the LED blinking + outReg := accu } when(decReg.isStoreIndB) { dataMem.io.wr := true.B diff --git a/src/main/scala/leros/util/Assembler.scala b/src/main/scala/leros/util/Assembler.scala index 20cae7a..54c1b25 100644 --- a/src/main/scala/leros/util/Assembler.scala +++ b/src/main/scala/leros/util/Assembler.scala @@ -24,7 +24,7 @@ object Assembler { if (true) getProgramFix() else { - // FERTL does not like large vectors + // FIRRTL does not like large vectors val code = new Array[Int](200) for (i <- 0 until code.length) { code(i) = ((i << 8) + i+1) & 0xffff