From f68a7dabdf4f20907ce550596bc50233ab0897ca Mon Sep 17 00:00:00 2001 From: Howard Mao Date: Mon, 4 Apr 2016 19:42:25 -0700 Subject: [PATCH] fix AXI -> TL converter --- uncore/src/main/scala/converters.scala | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/uncore/src/main/scala/converters.scala b/uncore/src/main/scala/converters.scala index e6f28b52..46b7d7af 100644 --- a/uncore/src/main/scala/converters.scala +++ b/uncore/src/main/scala/converters.scala @@ -584,13 +584,7 @@ class TileLinkIONastiIOConverter(implicit p: Parameters) extends TLModule()(p) def nasti_wmask(aw: NastiWriteAddressChannel, w: NastiWriteDataChannel): UInt = { val base = w.strb & size_mask(aw.size) val addr_byte = nasti_addr_byte(aw) - base << addr_byte - } - - def nasti_wdata(aw: NastiWriteAddressChannel, w: NastiWriteDataChannel): UInt = { - val base = w.data & FillInterleaved(8, size_mask(aw.size)) - val addr_byte = nasti_addr_byte(aw) - base << Cat(addr_byte, UInt(0, 3)) + w.strb & (size_mask(aw.size) << addr_byte) } def tl_last(gnt: GrantMetadata): Bool = @@ -645,7 +639,7 @@ class TileLinkIONastiIOConverter(implicit p: Parameters) extends TLModule()(p) client_xact_id = aw_req.id, addr_block = nasti_addr_block(aw_req), addr_beat = nasti_addr_beat(aw_req), - data = nasti_wdata(aw_req, io.nasti.w.bits), + data = io.nasti.w.bits.data, wmask = nasti_wmask(aw_req, io.nasti.w.bits))) io.tl.acquire.bits := Mux(state === s_put, put_acquire, get_acquire) @@ -655,19 +649,7 @@ class TileLinkIONastiIOConverter(implicit p: Parameters) extends TLModule()(p) io.nasti.aw.ready := (state === s_idle && !io.nasti.ar.valid) io.nasti.w.ready := (state === s_put && io.tl.acquire.ready) - val acq = io.tl.acquire.bits val nXacts = tlMaxClientXacts * tlMaxClientsPerPort - val get_align = Reg(Vec(nXacts, UInt(width = tlByteAddrBits))) - val is_narrow_get = acq.a_type === Acquire.getType - - when (io.tl.acquire.fire() && is_narrow_get) { - get_align(acq.client_xact_id) := acq.addr_byte() - } - - def tl_data(gnt: Grant): UInt = - Mux(gnt.g_type === Grant.getDataBeatType, - gnt.data >> Cat(get_align(gnt.client_xact_id), UInt(0, 3)), - gnt.data) io.nasti.b.valid := io.tl.grant.valid && tl_b_grant(io.tl.grant.bits) io.nasti.b.bits := NastiWriteResponseChannel( @@ -676,7 +658,7 @@ class TileLinkIONastiIOConverter(implicit p: Parameters) extends TLModule()(p) io.nasti.r.valid := io.tl.grant.valid && !tl_b_grant(io.tl.grant.bits) io.nasti.r.bits := NastiReadDataChannel( id = io.tl.grant.bits.client_xact_id, - data = tl_data(io.tl.grant.bits), + data = io.tl.grant.bits.data, last = tl_last(io.tl.grant.bits)) io.tl.grant.ready := Mux(tl_b_grant(io.tl.grant.bits),