Initial Chisel core implementation

This commit is contained in:
abnerhexu
2026-06-26 08:20:25 +00:00
commit 502803c37f
47 changed files with 2342 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import chisel3._
import chisel3.util._
class LoadQueue(p: CoreParams = CoreParams()) extends Module {
val io = IO(new Bundle {
val enqValid = Input(Bool())
val enqAddr = Input(UInt(p.xlen.W))
val enqReady = Output(Bool())
val complete = Input(Bool())
val flush = Input(Bool())
})
val count = RegInit(0.U(log2Ceil(p.loadQueueEntries + 1).W))
io.enqReady := count =/= p.loadQueueEntries.U
when(io.flush) {
count := 0.U
}.otherwise {
when(io.enqValid && io.enqReady) { count := count + 1.U }
when(io.complete && count =/= 0.U) { count := count - 1.U }
}
}