1
0
mirror of https://github.com/antonblanchard/chiselwatt.git synced 2026-01-30 21:42:16 +00:00

Temporary reset fix

We need to clean up the nia/fetch handling, but avoid the situation
where we come out of reset right around the time completed goes high.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
This commit is contained in:
Anton Blanchard
2020-02-03 13:00:17 +11:00
committed by Anton Blanchard
parent c4ac79c1d7
commit fb60b534b2

View File

@@ -373,22 +373,22 @@ class Core(bits: Int, memSize: Int, memFileName: String, resetAddr: Int) extends
cmp(wrData, adderLtOut, writebackIs32bit)
}
val completed = RegNext(writebackFastValid || multiplier.io.out.valid || loadStore.io.out.valid || divider.io.out.valid)
val sFirst :: sSecond :: sThird :: Nil = Enum(3)
val initState = RegInit(sFirst)
val sReset :: sFirst :: sRunning :: Nil = Enum(3)
val initState = RegInit(sReset)
switch (initState) {
is (sFirst) {
initState := sSecond
is (sReset) {
initState := sFirst
}
is (sSecond) {
initState := sThird
is (sFirst) {
initState := sRunning
}
}
val completed = RegNext((initState === sRunning) && (writebackFastValid || multiplier.io.out.valid || loadStore.io.out.valid || divider.io.out.valid))
// One instruction in the entire pipeline at a time
nia.io.nia.ready := completed || (initState === sSecond)
nia.io.nia.ready := completed || (initState === sFirst)
}
object CoreObj extends App {