Skip to content

Commit

Permalink
store state
Browse files Browse the repository at this point in the history
  • Loading branch information
schoeberl committed Jul 26, 2024
1 parent f505da6 commit 69795c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/main/scala/leros/Decode.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions src/main/scala/leros/Leros.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 69795c1

Please sign in to comment.