Skip to content

Commit

Permalink
[rtl] update field encodings for Tilelink 1.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
OceanS2000 committed Feb 17, 2023
1 parent 572a536 commit 857b545
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
26 changes: 18 additions & 8 deletions tilelink/src/bundle/MessageTypes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import chisel3.internal.firrtl.Width

/** opcode field of TileLink messages
*
* cf. TileLink Spec 1.8.1 Table 13
* cf. TileLink Spec 1.9.3 Table 12
*/
object OpCode {
protected[tilelink] val width: Width = 3.W
Expand Down Expand Up @@ -47,7 +47,8 @@ object Param {
*/
def tieZero: UInt = 0.U(width)

/** TileLink Spec 1.8.1 Table 23
/** param field for ArithmeticData
* TileLink Spec 1.9.3 Table 23
*/
object Arithmetic {
val MIN: UInt = 0.U(width)
Expand All @@ -57,7 +58,8 @@ object Param {
val ADD: UInt = 4.U(width)
}

/** TileLink Spec 1.8.1 Table 25
/** param field for LogicalData
* TileLink Spec 1.9.3 Table 25
*/
object Logical {
val XOR: UInt = 0.U(width)
Expand All @@ -66,38 +68,46 @@ object Param {
val SWAP: UInt = 3.U(width)
}

/** TileLink Spec 1.8.1 Table 27 Intent
/** param field for Intent
* TileLink Spec 1.9.3 Table 27
*/
object Intent {
val PrefetchRead: UInt = 0.U(width)
val PrefetchWrite: UInt = 1.U(width)
val CBOInval: UInt = 5.U(width)
val CBOClean: UInt = 6.U(width)
val CBOFlush: UInt = 7.U(width)
}

/** TileLink Spec 1.8.1 Table 31 Cap
/** permissions transitions encodings for Cap
* TileLink Spec 1.9.3 Table 31
*/
object Cap {
val toT: UInt = 0.U(width)
val toB: UInt = 1.U(width)
val toN: UInt = 2.U(width)
}

/** TileLink Spec 1.8.1 Table 31 Grow
/** permissions transitions encodings for Grow
* TileLink Spec 1.9.3 Table 31
*/
object Grow {
val NtoB: UInt = 0.U(width)
val NtoT: UInt = 1.U(width)
val BtoT: UInt = 2.U(width)
}

/** TileLink Spec 1.8.1 Table 31 Prune
/** permissions transitions encodings for Prune
* TileLink Spec 1.9.3 Table 31
*/
object Prune {
val TtoB: UInt = 0.U(width)
val TtoN: UInt = 1.U(width)
val BtoN: UInt = 2.U(width)
}

/** TileLink Spec 1.8.1 Table 31 Report
/** permissions transitions encodings for Report
* TileLink Spec 1.9.3 Table 31
*/
object Report {
val TtoT: UInt = 3.U(width)
Expand Down
2 changes: 1 addition & 1 deletion tilelink/src/bundle/TLChannel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ trait TLChannel extends Bundle {

class TLChannelA(val parameter: TileLinkChannelAParameter) extends TLChannel {
private val maskWidth = parameter.dataWidth / 8
// NOTE: this field is called a_code in TileLink spec version 1.8.1 p. 15, which is probably a typo
// NOTE: this field is called a_code in TileLink spec version 1.9.3 p. 16, which is probably a typo
val opcode: UInt = UInt(OpCode.width)
val param: UInt = UInt(Param.width)
val size: UInt = UInt(parameter.sizeWidth.W)
Expand Down

0 comments on commit 857b545

Please sign in to comment.