From 69795c1eabc861861cb7927968ca75cabe3295eb Mon Sep 17 00:00:00 2001 From: Martin Schoeberl Date: Fri, 26 Jul 2024 14:41:34 +0200 Subject: [PATCH] store state --- src/main/scala/leros/Decode.scala | 4 +--- src/main/scala/leros/Leros.scala | 8 +++++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/scala/leros/Decode.scala b/src/main/scala/leros/Decode.scala index 01e7fa2..a33f687 100644 --- a/src/main/scala/leros/Decode.scala +++ b/src/main/scala/leros/Decode.scala @@ -17,7 +17,6 @@ class DecodeOut extends Bundle { val nextState = State() val enaByte = Bool() val enaHalf = Bool() - val isStore = Bool() val isStoreInd = Bool() val isStoreIndB = Bool() val isStoreIndH = Bool() @@ -44,7 +43,6 @@ object DecodeOut { v.nextState := execute v.enaByte := false.B v.enaHalf := false.B - v.isStore := false.B v.isStoreInd := false.B v.isStoreIndB := false.B v.isStoreIndH := false.B @@ -188,7 +186,7 @@ class Decode() extends Module { d.useDecOpd := true.B } is (ST.U) { - d.isStore := true.B + d.nextState := store } is (LDADDR.U) { d.nextState := loadAddr diff --git a/src/main/scala/leros/Leros.scala b/src/main/scala/leros/Leros.scala index eb252fa..8aaad6a 100644 --- a/src/main/scala/leros/Leros.scala +++ b/src/main/scala/leros/Leros.scala @@ -98,13 +98,15 @@ class Leros(prog: String, size: Int = 32, memAddrWidth: Int = 8) extends LerosBa // nothing to be done here } + is (store) { + dataMem.io.wr := true.B + } + is (execute) { - when(decReg.isStore) { - dataMem.io.wr := true.B - } when(decReg.isStoreInd) { dataMem.io.wr := true.B + // TODO: am I missing here something? See the other store indirect // TODO: this is a super quick hack to get the LED blinking outReg := accu }