2016-08-19 20:08:35 +02:00
|
|
|
// See LICENSE for license details.
|
|
|
|
|
|
|
|
package uncore.tilelink2
|
|
|
|
|
|
|
|
import Chisel._
|
|
|
|
|
2016-08-24 01:23:35 +02:00
|
|
|
class TLEdge(
|
2016-08-19 20:08:35 +02:00
|
|
|
client: TLClientPortParameters,
|
|
|
|
manager: TLManagerPortParameters)
|
|
|
|
extends TLEdgeParameters(client, manager)
|
2016-08-24 01:23:35 +02:00
|
|
|
{
|
|
|
|
def isAligned(address: UInt, lgSize: UInt) =
|
|
|
|
if (maxLgSize == 0) Bool(true) else {
|
|
|
|
val mask = Vec.tabulate(maxLgSize) { UInt(_) < lgSize }
|
2016-08-30 23:38:26 +02:00
|
|
|
(address & Cat(mask.reverse)) === UInt(0)
|
2016-08-24 01:23:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// This gets used everywhere, so make the smallest circuit possible ...
|
|
|
|
def fullMask(address: UInt, lgSize: UInt) = {
|
|
|
|
val lgBytes = log2Ceil(manager.beatBytes)
|
|
|
|
def helper(i: Int): Seq[(Bool, Bool)] = {
|
|
|
|
if (i == 0) {
|
|
|
|
Seq((lgSize >= UInt(lgBytes), Bool(true)))
|
|
|
|
} else {
|
|
|
|
val sub = helper(i-1)
|
|
|
|
val size = lgSize === UInt(lgBytes - i)
|
|
|
|
val bit = address(lgBytes - i)
|
|
|
|
val nbit = !bit
|
|
|
|
Seq.tabulate (1 << i) { j =>
|
|
|
|
val (sub_acc, sub_eq) = sub(j/2)
|
|
|
|
val eq = sub_eq && (if (j % 2 == 1) bit else nbit)
|
|
|
|
val acc = sub_acc || (size && eq)
|
|
|
|
(acc, eq)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-08-30 23:38:26 +02:00
|
|
|
Cat(helper(lgBytes).map(_._1).reverse)
|
2016-08-24 01:23:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
def numBeats(bundle: HasTLOpcode) = {
|
|
|
|
val hasData = bundle.hasData()
|
|
|
|
val size = bundle.size()
|
|
|
|
val cutoff = log2Ceil(manager.beatBytes)
|
|
|
|
val small = size <= UInt(cutoff)
|
|
|
|
val decode = Vec.tabulate (1+maxLgSize-cutoff) { i => UInt(i + cutoff) === size }
|
2016-08-30 23:38:26 +02:00
|
|
|
Mux(!hasData || small, UInt(1), Cat(decode.reverse))
|
2016-08-24 01:23:35 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class TLEdgeOut(
|
|
|
|
client: TLClientPortParameters,
|
|
|
|
manager: TLManagerPortParameters)
|
|
|
|
extends TLEdge(client, manager)
|
2016-08-19 20:08:35 +02:00
|
|
|
{
|
|
|
|
// Transfers
|
2016-08-20 05:28:58 +02:00
|
|
|
def Acquire(fromSource: UInt, toAddress: UInt, lgSize: UInt, growPermissions: UInt) = {
|
2016-08-22 22:28:52 +02:00
|
|
|
require (manager.anySupportAcquire)
|
2016-08-20 05:28:58 +02:00
|
|
|
val legal = manager.supportsAcquire(toAddress, lgSize)
|
2016-08-27 00:32:20 +02:00
|
|
|
val a = Wire(new TLBundleA(bundle))
|
2016-08-20 05:28:58 +02:00
|
|
|
a.opcode := TLMessages.Acquire
|
|
|
|
a.param := growPermissions
|
|
|
|
a.size := lgSize
|
|
|
|
a.source := fromSource
|
2016-08-22 22:18:01 +02:00
|
|
|
a.address := toAddress
|
2016-08-20 05:28:58 +02:00
|
|
|
a.wmask := SInt(-1).asUInt
|
|
|
|
a.data := UInt(0)
|
|
|
|
(legal, a)
|
|
|
|
}
|
|
|
|
|
|
|
|
def Release(fromSource: UInt, toAddress: UInt, lgSize: UInt, shrinkPermissions: UInt) = {
|
2016-08-22 22:28:52 +02:00
|
|
|
require (manager.anySupportAcquire)
|
2016-08-20 05:28:58 +02:00
|
|
|
val legal = manager.supportsAcquire(toAddress, lgSize)
|
2016-08-27 00:32:20 +02:00
|
|
|
val c = Wire(new TLBundleC(bundle))
|
2016-08-20 05:28:58 +02:00
|
|
|
c.opcode := TLMessages.Release
|
|
|
|
c.param := shrinkPermissions
|
|
|
|
c.size := lgSize
|
|
|
|
c.source := fromSource
|
2016-08-22 22:18:01 +02:00
|
|
|
c.address := toAddress
|
2016-08-20 05:28:58 +02:00
|
|
|
c.data := UInt(0)
|
2016-08-30 23:38:26 +02:00
|
|
|
c.error := Bool(false)
|
2016-08-20 05:28:58 +02:00
|
|
|
(legal, c)
|
|
|
|
}
|
|
|
|
|
|
|
|
def Release(fromSource: UInt, toAddress: UInt, lgSize: UInt, shrinkPermissions: UInt, data: UInt) = {
|
2016-08-22 22:28:52 +02:00
|
|
|
require (manager.anySupportAcquire)
|
2016-08-20 05:28:58 +02:00
|
|
|
val legal = manager.supportsAcquire(toAddress, lgSize)
|
2016-08-27 00:32:20 +02:00
|
|
|
val c = Wire(new TLBundleC(bundle))
|
2016-08-20 05:28:58 +02:00
|
|
|
c.opcode := TLMessages.ReleaseData
|
|
|
|
c.param := shrinkPermissions
|
|
|
|
c.size := lgSize
|
|
|
|
c.source := fromSource
|
2016-08-22 22:18:01 +02:00
|
|
|
c.address := toAddress
|
2016-08-20 05:28:58 +02:00
|
|
|
c.data := data
|
2016-08-30 23:38:26 +02:00
|
|
|
c.error := Bool(false)
|
2016-08-20 05:28:58 +02:00
|
|
|
(legal, c)
|
|
|
|
}
|
|
|
|
|
|
|
|
def ProbeAck(toAddress: UInt, lgSize: UInt, reportPermissions: UInt) = {
|
2016-08-27 00:32:20 +02:00
|
|
|
val c = Wire(new TLBundleC(bundle))
|
2016-08-20 05:28:58 +02:00
|
|
|
c.opcode := TLMessages.ProbeAck
|
|
|
|
c.param := reportPermissions
|
|
|
|
c.size := lgSize
|
|
|
|
c.source := UInt(0)
|
2016-08-22 22:18:01 +02:00
|
|
|
c.address := toAddress
|
2016-08-20 05:28:58 +02:00
|
|
|
c.data := UInt(0)
|
2016-08-30 23:38:26 +02:00
|
|
|
c.error := Bool(false)
|
2016-08-20 05:28:58 +02:00
|
|
|
c
|
|
|
|
}
|
|
|
|
|
|
|
|
def ProbeAck(toAddress: UInt, lgSize: UInt, reportPermissions: UInt, data: UInt) = {
|
2016-08-27 00:32:20 +02:00
|
|
|
val c = Wire(new TLBundleC(bundle))
|
2016-08-20 05:28:58 +02:00
|
|
|
c.opcode := TLMessages.ProbeAckData
|
|
|
|
c.param := reportPermissions
|
|
|
|
c.size := lgSize
|
|
|
|
c.source := UInt(0)
|
2016-08-22 22:18:01 +02:00
|
|
|
c.address := toAddress
|
2016-08-20 05:28:58 +02:00
|
|
|
c.data := data
|
2016-08-30 23:38:26 +02:00
|
|
|
c.error := Bool(false)
|
2016-08-20 05:28:58 +02:00
|
|
|
c
|
|
|
|
}
|
|
|
|
|
|
|
|
def GrantAck(toSink: UInt) = {
|
2016-08-27 00:32:20 +02:00
|
|
|
val e = Wire(new TLBundleE(bundle))
|
2016-08-20 05:28:58 +02:00
|
|
|
e.sink := toSink
|
|
|
|
e
|
|
|
|
}
|
|
|
|
|
|
|
|
// Accesses
|
|
|
|
def Get(fromSource: UInt, toAddress: UInt, lgSize: UInt) = {
|
2016-08-22 22:28:52 +02:00
|
|
|
require (manager.anySupportGet)
|
2016-08-20 05:28:58 +02:00
|
|
|
val legal = manager.supportsGet(toAddress, lgSize)
|
2016-08-27 00:32:20 +02:00
|
|
|
val a = Wire(new TLBundleA(bundle))
|
2016-08-20 05:28:58 +02:00
|
|
|
a.opcode := TLMessages.Get
|
|
|
|
a.param := UInt(0)
|
|
|
|
a.size := lgSize
|
|
|
|
a.source := fromSource
|
2016-08-22 22:18:01 +02:00
|
|
|
a.address := toAddress
|
2016-08-20 05:28:58 +02:00
|
|
|
a.wmask := fullMask(toAddress, lgSize)
|
|
|
|
a.data := UInt(0)
|
|
|
|
(legal, a)
|
|
|
|
}
|
|
|
|
|
|
|
|
def Put(fromSource: UInt, toAddress: UInt, lgSize: UInt, data: UInt) = {
|
2016-08-22 22:28:52 +02:00
|
|
|
require (manager.anySupportPutFull)
|
2016-08-20 05:28:58 +02:00
|
|
|
val legal = manager.supportsPutFull(toAddress, lgSize)
|
2016-08-27 00:32:20 +02:00
|
|
|
val a = Wire(new TLBundleA(bundle))
|
2016-08-20 05:28:58 +02:00
|
|
|
a.opcode := TLMessages.PutFullData
|
|
|
|
a.param := UInt(0)
|
|
|
|
a.size := lgSize
|
|
|
|
a.source := fromSource
|
2016-08-22 22:18:01 +02:00
|
|
|
a.address := toAddress
|
2016-08-20 05:28:58 +02:00
|
|
|
a.wmask := fullMask(toAddress, lgSize)
|
|
|
|
a.data := data
|
|
|
|
(legal, a)
|
|
|
|
}
|
|
|
|
|
|
|
|
def Put(fromSource: UInt, toAddress: UInt, lgSize: UInt, data: UInt, wmask: UInt) = {
|
2016-08-22 22:28:52 +02:00
|
|
|
require (manager.anySupportPutPartial)
|
2016-08-20 05:28:58 +02:00
|
|
|
val legal = manager.supportsPutPartial(toAddress, lgSize)
|
2016-08-27 00:32:20 +02:00
|
|
|
val a = Wire(new TLBundleA(bundle))
|
2016-08-20 05:28:58 +02:00
|
|
|
a.opcode := TLMessages.PutPartialData
|
|
|
|
a.param := UInt(0)
|
|
|
|
a.size := lgSize
|
|
|
|
a.source := fromSource
|
2016-08-22 22:18:01 +02:00
|
|
|
a.address := toAddress
|
2016-08-20 05:28:58 +02:00
|
|
|
a.wmask := wmask
|
|
|
|
a.data := data
|
|
|
|
(legal, a)
|
|
|
|
}
|
|
|
|
|
|
|
|
def Arithmetic(fromSource: UInt, toAddress: UInt, lgSize: UInt, data: UInt, atomic: UInt) = {
|
2016-08-22 22:28:52 +02:00
|
|
|
require (manager.anySupportArithmetic)
|
2016-08-20 05:28:58 +02:00
|
|
|
val legal = manager.supportsArithmetic(toAddress, lgSize)
|
2016-08-27 00:32:20 +02:00
|
|
|
val a = Wire(new TLBundleA(bundle))
|
2016-08-20 05:28:58 +02:00
|
|
|
a.opcode := TLMessages.ArithmeticData
|
|
|
|
a.param := atomic
|
|
|
|
a.size := lgSize
|
|
|
|
a.source := fromSource
|
2016-08-22 22:18:01 +02:00
|
|
|
a.address := toAddress
|
2016-08-20 05:28:58 +02:00
|
|
|
a.wmask := fullMask(toAddress, lgSize)
|
|
|
|
a.data := data
|
|
|
|
(legal, a)
|
|
|
|
}
|
|
|
|
|
|
|
|
def Logical(fromSource: UInt, toAddress: UInt, lgSize: UInt, data: UInt, atomic: UInt) = {
|
2016-08-22 22:28:52 +02:00
|
|
|
require (manager.anySupportLogical)
|
2016-08-20 05:28:58 +02:00
|
|
|
val legal = manager.supportsLogical(toAddress, lgSize)
|
2016-08-27 00:32:20 +02:00
|
|
|
val a = Wire(new TLBundleA(bundle))
|
2016-08-20 05:28:58 +02:00
|
|
|
a.opcode := TLMessages.LogicalData
|
|
|
|
a.param := atomic
|
|
|
|
a.size := lgSize
|
|
|
|
a.source := fromSource
|
2016-08-22 22:18:01 +02:00
|
|
|
a.address := toAddress
|
2016-08-20 05:28:58 +02:00
|
|
|
a.wmask := fullMask(toAddress, lgSize)
|
|
|
|
a.data := data
|
|
|
|
(legal, a)
|
|
|
|
}
|
|
|
|
|
|
|
|
def Hint(fromSource: UInt, toAddress: UInt, lgSize: UInt, param: UInt) = {
|
2016-08-22 22:28:52 +02:00
|
|
|
require (manager.anySupportHint)
|
2016-08-20 05:28:58 +02:00
|
|
|
val legal = manager.supportsHint(toAddress)
|
2016-08-27 00:32:20 +02:00
|
|
|
val a = Wire(new TLBundleA(bundle))
|
2016-08-20 05:28:58 +02:00
|
|
|
a.opcode := TLMessages.Hint
|
|
|
|
a.param := param
|
|
|
|
a.size := lgSize
|
|
|
|
a.source := fromSource
|
2016-08-22 22:18:01 +02:00
|
|
|
a.address := toAddress
|
2016-08-20 05:28:58 +02:00
|
|
|
a.wmask := fullMask(toAddress, lgSize)
|
|
|
|
a.data := UInt(0)
|
|
|
|
(legal, a)
|
|
|
|
}
|
|
|
|
|
2016-08-30 23:38:26 +02:00
|
|
|
def AccessAck(toAddress: UInt, lgSize: UInt): TLBundleC = AccessAck(toAddress, lgSize, Bool(false))
|
|
|
|
def AccessAck(toAddress: UInt, lgSize: UInt, error: Bool) = {
|
2016-08-27 00:32:20 +02:00
|
|
|
val c = Wire(new TLBundleC(bundle))
|
2016-08-20 05:28:58 +02:00
|
|
|
c.opcode := TLMessages.AccessAck
|
|
|
|
c.param := UInt(0)
|
|
|
|
c.size := lgSize
|
|
|
|
c.source := UInt(0)
|
2016-08-22 22:18:01 +02:00
|
|
|
c.address := toAddress
|
2016-08-20 05:28:58 +02:00
|
|
|
c.data := UInt(0)
|
2016-08-30 23:38:26 +02:00
|
|
|
c.error := error
|
2016-08-23 00:36:39 +02:00
|
|
|
c
|
|
|
|
}
|
|
|
|
|
2016-08-30 23:38:26 +02:00
|
|
|
def AccessAck(toAddress: UInt, lgSize: UInt, data: UInt): TLBundleC = AccessAck(toAddress, lgSize, data, Bool(false))
|
|
|
|
def AccessAck(toAddress: UInt, lgSize: UInt, data: UInt, error: Bool) = {
|
2016-08-27 00:32:20 +02:00
|
|
|
val c = Wire(new TLBundleC(bundle))
|
2016-08-30 23:38:26 +02:00
|
|
|
c.opcode := TLMessages.AccessAckData
|
2016-08-23 00:36:39 +02:00
|
|
|
c.param := UInt(0)
|
|
|
|
c.size := lgSize
|
|
|
|
c.source := UInt(0)
|
|
|
|
c.address := toAddress
|
2016-08-30 23:38:26 +02:00
|
|
|
c.data := data
|
|
|
|
c.error := error
|
2016-08-20 05:28:58 +02:00
|
|
|
c
|
|
|
|
}
|
|
|
|
|
2016-08-30 23:38:26 +02:00
|
|
|
def HintAck(toAddress: UInt, lgSize: UInt) = {
|
2016-08-27 00:32:20 +02:00
|
|
|
val c = Wire(new TLBundleC(bundle))
|
2016-08-30 23:38:26 +02:00
|
|
|
c.opcode := TLMessages.HintAck
|
2016-08-20 05:28:58 +02:00
|
|
|
c.param := UInt(0)
|
|
|
|
c.size := lgSize
|
|
|
|
c.source := UInt(0)
|
2016-08-22 22:18:01 +02:00
|
|
|
c.address := toAddress
|
2016-08-30 23:38:26 +02:00
|
|
|
c.data := UInt(0)
|
|
|
|
c.error := Bool(false)
|
2016-08-20 05:28:58 +02:00
|
|
|
c
|
|
|
|
}
|
2016-08-19 20:08:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
class TLEdgeIn(
|
|
|
|
client: TLClientPortParameters,
|
|
|
|
manager: TLManagerPortParameters)
|
2016-08-24 01:23:35 +02:00
|
|
|
extends TLEdge(client, manager)
|
2016-08-19 20:08:35 +02:00
|
|
|
{
|
|
|
|
// Transfers
|
2016-08-20 05:28:58 +02:00
|
|
|
def Probe(fromAddress: UInt, toSource: UInt, lgSize: UInt, capPermissions: UInt) = {
|
2016-08-22 22:28:52 +02:00
|
|
|
require (client.anySupportProbe)
|
2016-08-20 05:28:58 +02:00
|
|
|
val legal = client.supportsProbe(fromAddress, lgSize)
|
2016-08-27 00:32:20 +02:00
|
|
|
val b = Wire(new TLBundleB(bundle))
|
2016-08-20 05:28:58 +02:00
|
|
|
b.opcode := TLMessages.Probe
|
|
|
|
b.param := capPermissions
|
|
|
|
b.size := lgSize
|
|
|
|
b.source := toSource
|
2016-08-22 22:18:01 +02:00
|
|
|
b.address := fromAddress
|
2016-08-23 00:36:39 +02:00
|
|
|
b.wmask := SInt(-1).asUInt
|
2016-08-20 05:28:58 +02:00
|
|
|
b.data := UInt(0)
|
|
|
|
(legal, b)
|
|
|
|
}
|
|
|
|
|
2016-08-30 23:38:26 +02:00
|
|
|
def Grant(fromSink: UInt, toSource: UInt, lgSize: UInt, capPermissions: UInt): TLBundleD = Grant(fromSink, toSource, lgSize, capPermissions, Bool(false))
|
|
|
|
def Grant(fromSink: UInt, toSource: UInt, lgSize: UInt, capPermissions: UInt, error: Bool) = {
|
2016-08-27 00:32:20 +02:00
|
|
|
val d = Wire(new TLBundleD(bundle))
|
2016-08-20 05:28:58 +02:00
|
|
|
d.opcode := TLMessages.Grant
|
|
|
|
d.param := capPermissions
|
|
|
|
d.size := lgSize
|
|
|
|
d.source := toSource
|
|
|
|
d.sink := fromSink
|
|
|
|
d.data := UInt(0)
|
2016-08-30 23:38:26 +02:00
|
|
|
d.error := error
|
2016-08-20 05:28:58 +02:00
|
|
|
d
|
|
|
|
}
|
|
|
|
|
2016-08-30 23:38:26 +02:00
|
|
|
def Grant(fromSink: UInt, toSource: UInt, lgSize: UInt, capPermissions: UInt, data: UInt): TLBundleD = Grant(fromSink, toSource, lgSize, capPermissions, data, Bool(false))
|
|
|
|
def Grant(fromSink: UInt, toSource: UInt, lgSize: UInt, capPermissions: UInt, data: UInt, error: Bool) = {
|
2016-08-27 00:32:20 +02:00
|
|
|
val d = Wire(new TLBundleD(bundle))
|
2016-08-20 05:28:58 +02:00
|
|
|
d.opcode := TLMessages.GrantData
|
|
|
|
d.param := capPermissions
|
|
|
|
d.size := lgSize
|
|
|
|
d.source := toSource
|
|
|
|
d.sink := fromSink
|
|
|
|
d.data := data
|
2016-08-30 23:38:26 +02:00
|
|
|
d.error := error
|
2016-08-20 05:28:58 +02:00
|
|
|
d
|
|
|
|
}
|
|
|
|
|
|
|
|
def ReleaseAck(toSource: UInt, lgSize: UInt) = {
|
2016-08-27 00:32:20 +02:00
|
|
|
val d = Wire(new TLBundleD(bundle))
|
2016-08-20 05:28:58 +02:00
|
|
|
d.opcode := TLMessages.ReleaseAck
|
|
|
|
d.param := UInt(0)
|
|
|
|
d.size := lgSize
|
|
|
|
d.source := toSource
|
|
|
|
d.sink := UInt(0)
|
|
|
|
d.data := UInt(0)
|
2016-08-30 23:38:26 +02:00
|
|
|
d.error := Bool(false)
|
2016-08-20 05:28:58 +02:00
|
|
|
d
|
|
|
|
}
|
|
|
|
|
|
|
|
// Accesses
|
|
|
|
def Get(fromAddress: UInt, toSource: UInt, lgSize: UInt) = {
|
2016-08-22 22:28:52 +02:00
|
|
|
require (client.anySupportGet)
|
2016-08-20 05:28:58 +02:00
|
|
|
val legal = client.supportsGet(toSource, lgSize)
|
2016-08-27 00:32:20 +02:00
|
|
|
val b = Wire(new TLBundleB(bundle))
|
2016-08-20 05:28:58 +02:00
|
|
|
b.opcode := TLMessages.Get
|
|
|
|
b.param := UInt(0)
|
|
|
|
b.size := lgSize
|
|
|
|
b.source := toSource
|
2016-08-22 22:18:01 +02:00
|
|
|
b.address := fromAddress
|
2016-08-20 05:28:58 +02:00
|
|
|
b.wmask := fullMask(fromAddress, lgSize)
|
|
|
|
b.data := UInt(0)
|
|
|
|
(legal, b)
|
|
|
|
}
|
|
|
|
|
|
|
|
def Put(fromAddress: UInt, toSource: UInt, lgSize: UInt, data: UInt) = {
|
2016-08-22 22:28:52 +02:00
|
|
|
require (client.anySupportPutFull)
|
2016-08-20 05:28:58 +02:00
|
|
|
val legal = client.supportsPutFull(toSource, lgSize)
|
2016-08-27 00:32:20 +02:00
|
|
|
val b = Wire(new TLBundleB(bundle))
|
2016-08-20 05:28:58 +02:00
|
|
|
b.opcode := TLMessages.PutFullData
|
|
|
|
b.param := UInt(0)
|
|
|
|
b.size := lgSize
|
|
|
|
b.source := toSource
|
2016-08-22 22:18:01 +02:00
|
|
|
b.address := fromAddress
|
2016-08-20 05:28:58 +02:00
|
|
|
b.wmask := fullMask(fromAddress, lgSize)
|
|
|
|
b.data := data
|
|
|
|
(legal, b)
|
|
|
|
}
|
|
|
|
|
|
|
|
def Put(fromAddress: UInt, toSource: UInt, lgSize: UInt, data: UInt, wmask: UInt) = {
|
2016-08-22 22:28:52 +02:00
|
|
|
require (client.anySupportPutPartial)
|
2016-08-20 05:28:58 +02:00
|
|
|
val legal = client.supportsPutPartial(toSource, lgSize)
|
2016-08-27 00:32:20 +02:00
|
|
|
val b = Wire(new TLBundleB(bundle))
|
2016-08-20 05:28:58 +02:00
|
|
|
b.opcode := TLMessages.PutPartialData
|
|
|
|
b.param := UInt(0)
|
|
|
|
b.size := lgSize
|
|
|
|
b.source := toSource
|
2016-08-22 22:18:01 +02:00
|
|
|
b.address := fromAddress
|
2016-08-20 05:28:58 +02:00
|
|
|
b.wmask := wmask
|
|
|
|
b.data := data
|
|
|
|
(legal, b)
|
|
|
|
}
|
|
|
|
|
|
|
|
def Arithmetic(fromAddress: UInt, toSource: UInt, lgSize: UInt, data: UInt, atomic: UInt) = {
|
2016-08-22 22:28:52 +02:00
|
|
|
require (client.anySupportArithmetic)
|
2016-08-20 05:28:58 +02:00
|
|
|
val legal = client.supportsArithmetic(toSource, lgSize)
|
2016-08-27 00:32:20 +02:00
|
|
|
val b = Wire(new TLBundleB(bundle))
|
2016-08-20 05:28:58 +02:00
|
|
|
b.opcode := TLMessages.ArithmeticData
|
|
|
|
b.param := atomic
|
|
|
|
b.size := lgSize
|
|
|
|
b.source := toSource
|
2016-08-22 22:18:01 +02:00
|
|
|
b.address := fromAddress
|
2016-08-20 05:28:58 +02:00
|
|
|
b.wmask := fullMask(fromAddress, lgSize)
|
|
|
|
b.data := data
|
|
|
|
(legal, b)
|
|
|
|
}
|
|
|
|
|
|
|
|
def Logical(fromAddress: UInt, toSource: UInt, lgSize: UInt, data: UInt, atomic: UInt) = {
|
2016-08-22 22:28:52 +02:00
|
|
|
require (client.anySupportLogical)
|
2016-08-20 05:28:58 +02:00
|
|
|
val legal = client.supportsLogical(toSource, lgSize)
|
2016-08-27 00:32:20 +02:00
|
|
|
val b = Wire(new TLBundleB(bundle))
|
2016-08-20 05:28:58 +02:00
|
|
|
b.opcode := TLMessages.LogicalData
|
|
|
|
b.param := atomic
|
|
|
|
b.size := lgSize
|
|
|
|
b.source := toSource
|
2016-08-22 22:18:01 +02:00
|
|
|
b.address := fromAddress
|
2016-08-20 05:28:58 +02:00
|
|
|
b.wmask := fullMask(fromAddress, lgSize)
|
|
|
|
b.data := data
|
|
|
|
(legal, b)
|
|
|
|
}
|
|
|
|
|
|
|
|
def Hint(fromAddress: UInt, toSource: UInt, lgSize: UInt, param: UInt) = {
|
2016-08-22 22:28:52 +02:00
|
|
|
require (client.anySupportHint)
|
2016-08-20 05:28:58 +02:00
|
|
|
val legal = client.supportsHint(toSource)
|
2016-08-27 00:32:20 +02:00
|
|
|
val b = Wire(new TLBundleB(bundle))
|
2016-08-20 05:28:58 +02:00
|
|
|
b.opcode := TLMessages.Hint
|
|
|
|
b.param := param
|
|
|
|
b.size := lgSize
|
|
|
|
b.source := toSource
|
2016-08-22 22:18:01 +02:00
|
|
|
b.address := fromAddress
|
2016-08-20 05:28:58 +02:00
|
|
|
b.wmask := fullMask(fromAddress, lgSize)
|
|
|
|
b.data := UInt(0)
|
|
|
|
(legal, b)
|
|
|
|
}
|
|
|
|
|
2016-08-30 23:38:26 +02:00
|
|
|
def AccessAck(toSource: UInt, lgSize: UInt): TLBundleD = AccessAck(toSource, lgSize, Bool(false))
|
|
|
|
def AccessAck(toSource: UInt, lgSize: UInt, error: Bool) = {
|
2016-08-27 00:32:20 +02:00
|
|
|
val d = Wire(new TLBundleD(bundle))
|
2016-08-20 05:28:58 +02:00
|
|
|
d.opcode := TLMessages.AccessAck
|
|
|
|
d.param := UInt(0)
|
|
|
|
d.size := lgSize
|
|
|
|
d.source := toSource
|
|
|
|
d.sink := UInt(0)
|
|
|
|
d.data := UInt(0)
|
2016-08-30 23:38:26 +02:00
|
|
|
d.error := error
|
2016-08-23 00:36:39 +02:00
|
|
|
d
|
|
|
|
}
|
|
|
|
|
2016-08-30 23:38:26 +02:00
|
|
|
def AccessAck(toSource: UInt, lgSize: UInt, data: UInt): TLBundleD = AccessAck(toSource, lgSize, data, Bool(false))
|
|
|
|
def AccessAck(toSource: UInt, lgSize: UInt, data: UInt, error: Bool) = {
|
2016-08-27 00:32:20 +02:00
|
|
|
val d = Wire(new TLBundleD(bundle))
|
2016-08-30 23:38:26 +02:00
|
|
|
d.opcode := TLMessages.AccessAckData
|
2016-08-23 00:36:39 +02:00
|
|
|
d.param := UInt(0)
|
|
|
|
d.size := lgSize
|
|
|
|
d.source := toSource
|
|
|
|
d.sink := UInt(0)
|
2016-08-30 23:38:26 +02:00
|
|
|
d.data := data
|
|
|
|
d.error := error
|
2016-08-20 05:28:58 +02:00
|
|
|
d
|
|
|
|
}
|
|
|
|
|
2016-08-30 23:38:26 +02:00
|
|
|
def HintAck(toSource: UInt, lgSize: UInt) = {
|
2016-08-27 00:32:20 +02:00
|
|
|
val d = Wire(new TLBundleD(bundle))
|
2016-08-30 23:38:26 +02:00
|
|
|
d.opcode := TLMessages.HintAck
|
2016-08-20 05:28:58 +02:00
|
|
|
d.param := UInt(0)
|
|
|
|
d.size := lgSize
|
|
|
|
d.source := toSource
|
|
|
|
d.sink := UInt(0)
|
2016-08-30 23:38:26 +02:00
|
|
|
d.data := UInt(0)
|
|
|
|
d.error := Bool(false)
|
2016-08-20 05:28:58 +02:00
|
|
|
d
|
|
|
|
}
|
2016-08-19 20:08:35 +02:00
|
|
|
}
|