Skip to content

Commit

Permalink
Fix some Chisel 6 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
schoeberl committed Jul 25, 2024
1 parent a232848 commit f713e45
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/scala/leros/InstrMem.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package leros

import chisel3._
import chisel3.util._
import leros.util.Assembler


Expand All @@ -21,5 +22,6 @@ class InstrMem(memAddrWidth: Int, prog: String) extends Module {
val progMem = VecInit(code.toIndexedSeq.map(_.asUInt(16.W)))
val memReg = RegInit(0.U(memAddrWidth.W))
memReg := io.addr
io.instr := progMem(memReg)
val index = log2Ceil(code.length)
io.instr := progMem(memReg(index - 1, 0))
}

0 comments on commit f713e45

Please sign in to comment.