Don't emit writeback state machine logic for scratchpad (#1127)
Firrtl can't DCE it because it would require analyzing the state machine.
This commit is contained in:
parent
a8d573beeb
commit
5155eb6059
@ -558,68 +558,69 @@ class DCacheModule(outer: DCache) extends HellaCacheModule(outer) {
|
|||||||
val newCoh = Wire(init = probeNewCoh)
|
val newCoh = Wire(init = probeNewCoh)
|
||||||
releaseWay := s2_probe_way
|
releaseWay := s2_probe_way
|
||||||
|
|
||||||
when (s2_victimize && s2_victim_dirty) {
|
if (!usingDataScratchpad) {
|
||||||
assert(!(s2_valid && s2_hit_valid && !s2_data_error))
|
when (s2_victimize && s2_victim_dirty) {
|
||||||
release_state := s_voluntary_writeback
|
assert(!(s2_valid && s2_hit_valid && !s2_data_error))
|
||||||
probe_bits.address := Cat(s2_victim_tag, s2_req.addr(idxMSB, idxLSB)) << idxLSB
|
release_state := s_voluntary_writeback
|
||||||
}
|
probe_bits.address := Cat(s2_victim_tag, s2_req.addr(idxMSB, idxLSB)) << idxLSB
|
||||||
when (s2_probe) {
|
}
|
||||||
val probeNack = Wire(init = true.B)
|
when (s2_probe) {
|
||||||
when (s2_meta_error) {
|
val probeNack = Wire(init = true.B)
|
||||||
release_state := s_probe_retry
|
when (s2_meta_error) {
|
||||||
}.elsewhen (s2_prb_ack_data) {
|
release_state := s_probe_retry
|
||||||
release_state := s_probe_rep_dirty
|
}.elsewhen (s2_prb_ack_data) {
|
||||||
}.elsewhen (s2_probe_state.isValid()) {
|
release_state := s_probe_rep_dirty
|
||||||
|
}.elsewhen (s2_probe_state.isValid()) {
|
||||||
|
tl_out_c.valid := true
|
||||||
|
tl_out_c.bits := cleanReleaseMessage
|
||||||
|
release_state := Mux(releaseDone, s_probe_write_meta, s_probe_rep_clean)
|
||||||
|
}.otherwise {
|
||||||
|
tl_out_c.valid := true
|
||||||
|
probeNack := !releaseDone
|
||||||
|
release_state := Mux(releaseDone, s_ready, s_probe_rep_miss)
|
||||||
|
}
|
||||||
|
when (probeNack) { s1_nack := true }
|
||||||
|
}
|
||||||
|
when (release_state === s_probe_retry) {
|
||||||
|
metaArb.io.in(6).valid := true
|
||||||
|
metaArb.io.in(6).bits.addr := Cat(io.cpu.req.bits.addr >> paddrBits, probe_bits.address)
|
||||||
|
when (metaArb.io.in(6).ready) {
|
||||||
|
release_state := s_ready
|
||||||
|
s1_probe := true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
when (release_state === s_probe_rep_miss) {
|
||||||
|
tl_out_c.valid := true
|
||||||
|
when (releaseDone) { release_state := s_ready }
|
||||||
|
}
|
||||||
|
when (release_state === s_probe_rep_clean) {
|
||||||
tl_out_c.valid := true
|
tl_out_c.valid := true
|
||||||
tl_out_c.bits := cleanReleaseMessage
|
tl_out_c.bits := cleanReleaseMessage
|
||||||
release_state := Mux(releaseDone, s_probe_write_meta, s_probe_rep_clean)
|
when (releaseDone) { release_state := s_probe_write_meta }
|
||||||
}.otherwise {
|
|
||||||
tl_out_c.valid := true
|
|
||||||
probeNack := !releaseDone
|
|
||||||
release_state := Mux(releaseDone, s_ready, s_probe_rep_miss)
|
|
||||||
}
|
}
|
||||||
when (probeNack) { s1_nack := true }
|
when (release_state === s_probe_rep_dirty) {
|
||||||
}
|
tl_out_c.bits := dirtyReleaseMessage
|
||||||
when (release_state === s_probe_retry) {
|
when (releaseDone) { release_state := s_probe_write_meta }
|
||||||
metaArb.io.in(6).valid := true
|
|
||||||
metaArb.io.in(6).bits.addr := Cat(io.cpu.req.bits.addr >> paddrBits, probe_bits.address)
|
|
||||||
when (metaArb.io.in(6).ready) {
|
|
||||||
release_state := s_ready
|
|
||||||
s1_probe := true
|
|
||||||
}
|
}
|
||||||
}
|
when (release_state.isOneOf(s_voluntary_writeback, s_voluntary_write_meta)) {
|
||||||
when (release_state === s_probe_rep_miss) {
|
|
||||||
tl_out_c.valid := true
|
|
||||||
when (releaseDone) { release_state := s_ready }
|
|
||||||
}
|
|
||||||
when (release_state === s_probe_rep_clean) {
|
|
||||||
tl_out_c.valid := true
|
|
||||||
tl_out_c.bits := cleanReleaseMessage
|
|
||||||
when (releaseDone) { release_state := s_probe_write_meta }
|
|
||||||
}
|
|
||||||
when (release_state === s_probe_rep_dirty) {
|
|
||||||
tl_out_c.bits := dirtyReleaseMessage
|
|
||||||
when (releaseDone) { release_state := s_probe_write_meta }
|
|
||||||
}
|
|
||||||
when (release_state.isOneOf(s_voluntary_writeback, s_voluntary_write_meta)) {
|
|
||||||
if (edge.manager.anySupportAcquireT)
|
|
||||||
tl_out_c.bits := edge.Release(fromSource = 0.U,
|
tl_out_c.bits := edge.Release(fromSource = 0.U,
|
||||||
toAddress = 0.U,
|
toAddress = 0.U,
|
||||||
lgSize = lgCacheBlockBytes,
|
lgSize = lgCacheBlockBytes,
|
||||||
shrinkPermissions = s2_shrink_param,
|
shrinkPermissions = s2_shrink_param,
|
||||||
data = 0.U)._2
|
data = 0.U)._2
|
||||||
newCoh := voluntaryNewCoh
|
newCoh := voluntaryNewCoh
|
||||||
releaseWay := s2_victim_way
|
releaseWay := s2_victim_way
|
||||||
when (releaseDone) { release_state := s_voluntary_write_meta }
|
when (releaseDone) { release_state := s_voluntary_write_meta }
|
||||||
when (tl_out_c.fire() && c_first) { release_ack_wait := true }
|
when (tl_out_c.fire() && c_first) { release_ack_wait := true }
|
||||||
}
|
}
|
||||||
tl_out_c.bits.address := probe_bits.address
|
tl_out_c.bits.address := probe_bits.address
|
||||||
tl_out_c.bits.data := s2_data_corrected
|
tl_out_c.bits.data := s2_data_corrected
|
||||||
tl_out_c.bits.error := inWriteback && {
|
tl_out_c.bits.error := inWriteback && {
|
||||||
val accrued = Reg(Bool())
|
val accrued = Reg(Bool())
|
||||||
val next = writeback_data_uncorrectable || (accrued && !c_first)
|
val next = writeback_data_uncorrectable || (accrued && !c_first)
|
||||||
when (tl_out_c.fire()) { accrued := next }
|
when (tl_out_c.fire()) { accrued := next }
|
||||||
next
|
next
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dataArb.io.in(2).valid := inWriteback && releaseDataBeat < refillCycles
|
dataArb.io.in(2).valid := inWriteback && releaseDataBeat < refillCycles
|
||||||
|
Loading…
Reference in New Issue
Block a user