Skip to content

Commit

Permalink
fix: add chiselTypeOf when inst Wire
Browse files Browse the repository at this point in the history
+ in.d and out.a;
  • Loading branch information
SingularityKChen authored and sequencer committed Apr 26, 2023
1 parent 3902497 commit e52773e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/scala/tilelink/CacheCork.scala
Expand Up @@ -63,8 +63,8 @@ class TLCacheCork(params: TLCacheCorkParams = TLCacheCorkParams())(implicit p: P
// Fortunately, no masters we know of behave this way!

// Take requests from A to A or D (if BtoT Acquire)
val a_a = Wire(out.a)
val a_d = Wire(in.d)
val a_a = Wire(chiselTypeOf(out.a))
val a_d = Wire(chiselTypeOf(in.d))
val isPut = in.a.bits.opcode === PutFullData || in.a.bits.opcode === PutPartialData
val toD = (in.a.bits.opcode === AcquireBlock && in.a.bits.param === TLPermissions.BtoT) ||
(in.a.bits.opcode === AcquirePerm)
Expand All @@ -90,7 +90,7 @@ class TLCacheCork(params: TLCacheCorkParams = TLCacheCorkParams())(implicit p: P
capPermissions = TLPermissions.toT)

// Take ReleaseData from C to A; Release from C to D
val c_a = Wire(out.a)
val c_a = Wire(chiselTypeOf(out.a))
c_a.valid := in.c.valid && in.c.bits.opcode === ReleaseData
c_a.bits := edgeOut.Put(
fromSource = in.c.bits.source << 1,
Expand All @@ -101,7 +101,7 @@ class TLCacheCork(params: TLCacheCorkParams = TLCacheCorkParams())(implicit p: P
c_a.bits.user :<= in.c.bits.user

// Releases without Data succeed instantly
val c_d = Wire(in.d)
val c_d = Wire(chiselTypeOf(in.d))
c_d.valid := in.c.valid && in.c.bits.opcode === Release
c_d.bits := edgeIn.ReleaseAck(in.c.bits)

Expand All @@ -120,7 +120,7 @@ class TLCacheCork(params: TLCacheCorkParams = TLCacheCorkParams())(implicit p: P
pool.io.free.valid := in.e.fire
pool.io.free.bits := in.e.bits.sink

val in_d = Wire(in.d)
val in_d = Wire(chiselTypeOf(in.d))
val d_first = edgeOut.first(in_d)
val d_grant = in_d.bits.opcode === GrantData || in_d.bits.opcode === Grant
pool.io.alloc.ready := in.d.fire && d_first && d_grant
Expand All @@ -130,7 +130,7 @@ class TLCacheCork(params: TLCacheCorkParams = TLCacheCorkParams())(implicit p: P
in.d.bits.sink := pool.io.alloc.bits holdUnless d_first

// Take responses from D and transform them
val d_d = Wire(in.d)
val d_d = Wire(chiselTypeOf(in.d))
d_d <> out.d
d_d.bits.source := out.d.bits.source >> 1

Expand Down

0 comments on commit e52773e

Please sign in to comment.