Work around Chisel3's lack of 0-width wires
This is super ugly, but it's necessary to get Chisel3 to compile. Note that this still fails simulations in Chisel3, so it might be wrong.
This commit is contained in:
parent
13dcb96b7f
commit
50f61687de
@ -59,10 +59,23 @@ class UncachedTileLinkGenerator(id: Int)
|
|||||||
|
|
||||||
io.finished := (state === s_finished)
|
io.finished := (state === s_finished)
|
||||||
|
|
||||||
val full_addr = UInt(startAddress) + Cat(
|
val part_of_full_addr =
|
||||||
req_cnt, UInt(id, log2Ceil(nGens)),
|
if (genCached) {
|
||||||
(if (genCached) UInt(0, 1) else UInt(0, 0)),
|
Cat(req_cnt,
|
||||||
|
UInt(0, width = 1),
|
||||||
UInt(0, wordOffset))
|
UInt(0, wordOffset))
|
||||||
|
} else {
|
||||||
|
Cat(req_cnt,
|
||||||
|
UInt(0, wordOffset))
|
||||||
|
}
|
||||||
|
val another_part_of_full_addr =
|
||||||
|
if (log2Ceil(nGens) > 0) {
|
||||||
|
Cat(UInt(id, log2Ceil(nGens)),
|
||||||
|
part_of_full_addr)
|
||||||
|
} else {
|
||||||
|
part_of_full_addr
|
||||||
|
}
|
||||||
|
val full_addr = UInt(startAddress) + another_part_of_full_addr
|
||||||
|
|
||||||
val addr_block = full_addr >> UInt(tlBlockOffset)
|
val addr_block = full_addr >> UInt(tlBlockOffset)
|
||||||
val addr_beat = full_addr(tlBlockOffset - 1, tlByteAddrBits)
|
val addr_beat = full_addr(tlBlockOffset - 1, tlByteAddrBits)
|
||||||
@ -122,10 +135,25 @@ class HellaCacheGenerator(id: Int)
|
|||||||
|
|
||||||
val (req_cnt, req_wrap) = Counter(io.mem.resp.valid, maxRequests)
|
val (req_cnt, req_wrap) = Counter(io.mem.resp.valid, maxRequests)
|
||||||
|
|
||||||
val req_addr = UInt(startAddress) + Cat(
|
val part_of_req_addr =
|
||||||
req_cnt, UInt(id, log2Ceil(nGens)),
|
if (log2Ceil(nGens) > 0) {
|
||||||
(if (genUncached) UInt(1, 1) else UInt(0, 0)),
|
if (genUncached) {
|
||||||
|
Cat(UInt(id, log2Ceil(nGens)),
|
||||||
|
UInt(1, width = 1),
|
||||||
UInt(0, wordOffset))
|
UInt(0, wordOffset))
|
||||||
|
} else {
|
||||||
|
Cat(UInt(id, log2Ceil(nGens)),
|
||||||
|
UInt(0, wordOffset))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (genUncached) {
|
||||||
|
Cat(UInt(1, width = 1),
|
||||||
|
UInt(0, wordOffset))
|
||||||
|
} else {
|
||||||
|
UInt(0, wordOffset)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val req_addr = UInt(startAddress) + Cat(req_cnt, part_of_req_addr)
|
||||||
val req_data = Cat(UInt(id, log2Up(nGens)), req_cnt, req_addr)
|
val req_data = Cat(UInt(id, log2Up(nGens)), req_cnt, req_addr)
|
||||||
|
|
||||||
io.mem.req.valid := sending && !io.finished
|
io.mem.req.valid := sending && !io.finished
|
||||||
|
Loading…
Reference in New Issue
Block a user