-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding V2 Constructors in Paramaters and Emits Parameters #2532
Changes from all commits
4a02dc5
9ee41c0
881c410
c6f74ed
d2cd339
89bb612
e8388b4
68e98d0
dae71ca
40af618
e02bfa2
b45bafd
d11c923
afad0d8
7bae568
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,8 +97,9 @@ case class TransferSizes(min: Int, max: Int) | |
def intersect(x: TransferSizes) = | ||
if (x.max < min || max < x.min) TransferSizes.none | ||
else TransferSizes(scala.math.max(min, x.min), scala.math.min(max, x.max)) | ||
|
||
// Not a union, because the result may contain sizes contained by neither term | ||
// NOT TO BE CONFUSED WITH COVERPOINTS | ||
def cover(x: TransferSizes) = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. replace this with mincover |
||
if (none) { | ||
x | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,22 +54,24 @@ class TLFragmenter(val minSize: Int, val maxSize: Int, val alwaysMin: Boolean = | |
val node = TLAdapterNode( | ||
// We require that all the responses are mutually FIFO | ||
// Thus we need to compact all of the masters into one big master | ||
clientFn = { c => c.v1copy( | ||
clients = Seq(TLMasterParameters.v1( | ||
clientFn = { c => c.v2copy( | ||
masters = Seq(TLMasterParameters.v2( | ||
name = "TLFragmenter", | ||
sourceId = IdRange(0, if (minSize == maxSize) c.endSourceId else (c.endSourceId << addedBits)), | ||
requestFifo = true))), | ||
// This master can only produce: | ||
// emitsAcquireT = c.clients.map(_.knownToEmit.get.emitsAcquireT).reduce(_ smallestintervalcover _), | ||
// emitsAcquireB = c.clients.map(_.knownToEmit.get.emitsAcquireB).reduce(_ smallestintervalcover _), | ||
// emitsArithmetic = c.clients.map(_.knownToEmit.get.emitsArithmetic).reduce(_ smallestintervalcover _), | ||
// emitsLogical = c.clients.map(_.knownToEmit.get.emitsLogical).reduce(_ smallestintervalcover _), | ||
// emitsGet = c.clients.map(_.knownToEmit.get.emitsGet).reduce(_ smallestintervalcover _), | ||
// emitsPutFull = c.clients.map(_.knownToEmit.get.emitsPutFull).reduce(_ smallestintervalcover _), | ||
// emitsPutPartial = c.clients.map(_.knownToEmit.get.emitsPutPartial).reduce(_ smallestintervalcover _), | ||
// emitsHint = c.clients.map(_.knownToEmit.get.emitsHint).reduce(_ smallestintervalcover _) | ||
}, | ||
managerFn = { m => m.v1copy(managers = m.managers.map(mapManager)) }) | ||
requestFifo = true, | ||
emits = TLMasterToSlaveTransferSizes( | ||
acquireT = c.masters.map(_.emits.acquireT) .reduce(_ cover _), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. try and use shrinktransfer to make the bound tighter There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe: |
||
acquireB = c.masters.map(_.emits.acquireB) .reduce(_ cover _), | ||
arithmetic = c.masters.map(_.emits.arithmetic).reduce(_ cover _), | ||
logical = c.masters.map(_.emits.logical) .reduce(_ cover _), | ||
get = c.masters.map(_.emits.get) .reduce(_ cover _), | ||
putFull = c.masters.map(_.emits.putFull) .reduce(_ cover _), | ||
putPartial = c.masters.map(_.emits.putPartial).reduce(_ cover _), | ||
hint = c.masters.map(_.emits.hint) .reduce(_ cover _) | ||
) | ||
)) | ||
)}, | ||
managerFn = { m => m.v2copy(slaves = m.slaves.map(mapManager)) }) | ||
|
||
lazy val module = new LazyModuleImp(this) { | ||
(node.in zip node.out) foreach { case ((in, edgeIn), (out, edgeOut)) => | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -296,13 +296,42 @@ class TLSlaveParameters private( | |
putFull = supportsPutFull, | ||
putPartial = supportsPutPartial, | ||
hint = supportsHint), | ||
emits = emits, | ||
emits = emits, | ||
mayDenyGet = mayDenyGet, | ||
mayDenyPut = mayDenyPut, | ||
alwaysGrantsT = alwaysGrantsT, | ||
fifoId = fifoId) | ||
} | ||
|
||
def v2copy( | ||
nodePath: Seq[BaseNode] = nodePath, | ||
resources: Seq[Resource] = resources, | ||
setName: Option[String] = setName, | ||
address: Seq[AddressSet] = address, | ||
regionType: RegionType.T = regionType, | ||
executable: Boolean = executable, | ||
fifoId: Option[Int] = fifoId, | ||
supports: TLMasterToSlaveTransferSizes = supports, | ||
emits: TLSlaveToMasterTransferSizes = emits, | ||
alwaysGrantsT: Boolean = alwaysGrantsT, | ||
mayDenyGet: Boolean = mayDenyGet, | ||
mayDenyPut: Boolean = mayDenyPut) = | ||
{ | ||
new TLSlaveParameters( | ||
nodePath = nodePath, | ||
resources = resources, | ||
setName = setName, | ||
address = address, | ||
regionType = regionType, | ||
executable = executable, | ||
fifoId = fifoId, | ||
supports = supports, | ||
emits = emits, | ||
alwaysGrantsT = alwaysGrantsT, | ||
mayDenyGet = mayDenyGet, | ||
mayDenyPut = mayDenyPut) | ||
} | ||
|
||
@deprecated("Use v1copy instead of copy","") | ||
def copy( | ||
address: Seq[AddressSet] = address, | ||
|
@@ -386,6 +415,35 @@ object TLSlaveParameters { | |
alwaysGrantsT = alwaysGrantsT, | ||
fifoId = fifoId) | ||
} | ||
|
||
def v2( | ||
address: Seq[AddressSet], | ||
nodePath: Seq[BaseNode] = Seq(), | ||
resources: Seq[Resource] = Seq(), | ||
setName: Option[String] = None, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. try and change setname to name |
||
regionType: RegionType.T = RegionType.GET_EFFECTS, | ||
executable: Boolean = false, | ||
fifoId: Option[Int] = None, | ||
supports: TLMasterToSlaveTransferSizes = TLMasterToSlaveTransferSizes.unknownSupports, | ||
emits: TLSlaveToMasterTransferSizes = TLSlaveToMasterTransferSizes.unknownEmits, | ||
alwaysGrantsT: Boolean = false, | ||
mayDenyGet: Boolean = false, | ||
mayDenyPut: Boolean = false) = | ||
{ | ||
new TLSlaveParameters( | ||
nodePath = nodePath, | ||
resources = resources, | ||
setName = setName, | ||
address = address, | ||
regionType = regionType, | ||
executable = executable, | ||
fifoId = fifoId, | ||
supports = supports, | ||
emits = emits, | ||
alwaysGrantsT = alwaysGrantsT, | ||
mayDenyGet = mayDenyGet, | ||
mayDenyPut = mayDenyPut) | ||
} | ||
} | ||
|
||
object TLManagerParameters { | ||
|
@@ -677,6 +735,23 @@ class TLSlavePortParameters private( | |
requestKeys = requestKeys) | ||
} | ||
|
||
def v2copy( | ||
slaves: Seq[TLSlaveParameters] = slaves, | ||
channelBytes: TLChannelBeatBytes = channelBytes, | ||
endSinkId: Int = endSinkId, | ||
minLatency: Int = minLatency, | ||
responseFields: Seq[BundleFieldBase] = responseFields, | ||
requestKeys: Seq[BundleKeyBase] = requestKeys) = | ||
{ | ||
new TLSlavePortParameters( | ||
slaves = slaves, | ||
channelBytes = channelBytes, | ||
endSinkId = endSinkId, | ||
minLatency = minLatency, | ||
responseFields = responseFields, | ||
requestKeys = requestKeys) | ||
} | ||
|
||
@deprecated("Use v1copy instead of copy","") | ||
def copy( | ||
managers: Seq[TLSlaveParameters] = slaves, | ||
|
@@ -847,6 +922,33 @@ class TLMasterParameters private( | |
sourceId = sourceId) | ||
} | ||
|
||
def v2copy( | ||
nodePath: Seq[BaseNode] = nodePath, | ||
resources: Seq[Resource] = resources, | ||
name: String = name, | ||
visibility: Seq[AddressSet] = visibility, | ||
unusedRegionTypes: Set[RegionType.T] = unusedRegionTypes, | ||
executesOnly: Boolean = executesOnly, | ||
requestFifo: Boolean = requestFifo, | ||
supports: TLSlaveToMasterTransferSizes = supports, | ||
emits: TLMasterToSlaveTransferSizes = emits, | ||
neverReleasesData: Boolean = neverReleasesData, | ||
sourceId: IdRange = sourceId) = | ||
{ | ||
new TLMasterParameters( | ||
nodePath = nodePath, | ||
resources = resources, | ||
name = name, | ||
visibility = visibility, | ||
unusedRegionTypes = unusedRegionTypes, | ||
executesOnly = executesOnly, | ||
requestFifo = requestFifo, | ||
supports = supports, | ||
emits = emits, | ||
neverReleasesData = neverReleasesData, | ||
sourceId = sourceId) | ||
} | ||
|
||
@deprecated("Use v1copy instead of copy","") | ||
def copy( | ||
name: String = name, | ||
|
@@ -913,6 +1015,33 @@ object TLMasterParameters { | |
neverReleasesData = false, | ||
sourceId = sourceId) | ||
} | ||
|
||
def v2( | ||
nodePath: Seq[BaseNode] = Seq(), | ||
resources: Seq[Resource] = Nil, | ||
name: String, | ||
visibility: Seq[AddressSet] = Seq(AddressSet(0, ~0)), | ||
unusedRegionTypes: Set[RegionType.T] = Set(), | ||
executesOnly: Boolean = false, | ||
requestFifo: Boolean = false, | ||
supports: TLSlaveToMasterTransferSizes = TLSlaveToMasterTransferSizes.unknownSupports, | ||
emits: TLMasterToSlaveTransferSizes = TLMasterToSlaveTransferSizes.unknownEmits, | ||
neverReleasesData: Boolean = false, | ||
sourceId: IdRange = IdRange(0,1)) = | ||
{ | ||
new TLMasterParameters( | ||
nodePath = nodePath, | ||
resources = resources, | ||
name = name, | ||
visibility = visibility, | ||
unusedRegionTypes = unusedRegionTypes, | ||
executesOnly = executesOnly, | ||
requestFifo = requestFifo, | ||
supports = supports, | ||
emits = emits, | ||
neverReleasesData = neverReleasesData, | ||
sourceId = sourceId) | ||
} | ||
} | ||
|
||
object TLClientParameters { | ||
|
@@ -1096,6 +1225,23 @@ class TLMasterPortParameters private( | |
responseKeys = responseKeys) | ||
} | ||
|
||
def v2copy( | ||
masters: Seq[TLMasterParameters] = masters, | ||
channelBytes: TLChannelBeatBytes = channelBytes, | ||
minLatency: Int = minLatency, | ||
echoFields: Seq[BundleFieldBase] = echoFields, | ||
requestFields: Seq[BundleFieldBase] = requestFields, | ||
responseKeys: Seq[BundleKeyBase] = responseKeys) = | ||
{ | ||
new TLMasterPortParameters( | ||
masters = masters, | ||
channelBytes = channelBytes, | ||
minLatency = minLatency, | ||
echoFields = echoFields, | ||
requestFields = requestFields, | ||
responseKeys = responseKeys) | ||
} | ||
|
||
@deprecated("Use v1copy instead of copy","") | ||
def copy( | ||
clients: Seq[TLMasterParameters] = masters, | ||
|
@@ -1133,8 +1279,8 @@ object TLClientPortParameters { | |
|
||
object TLMasterPortParameters { | ||
def v1( | ||
clients: Seq[TLMasterParameters], | ||
minLatency: Int = 0, | ||
clients: Seq[TLMasterParameters], | ||
minLatency: Int = 0, | ||
echoFields: Seq[BundleFieldBase] = Nil, | ||
requestFields: Seq[BundleFieldBase] = Nil, | ||
responseKeys: Seq[BundleKeyBase] = Nil) = | ||
|
@@ -1147,6 +1293,22 @@ object TLMasterPortParameters { | |
requestFields = requestFields, | ||
responseKeys = responseKeys) | ||
} | ||
def v2( | ||
masters: Seq[TLMasterParameters], | ||
channelBytes: TLChannelBeatBytes = TLChannelBeatBytes(), | ||
minLatency: Int = 0, | ||
echoFields: Seq[BundleFieldBase] = Nil, | ||
requestFields: Seq[BundleFieldBase] = Nil, | ||
responseKeys: Seq[BundleKeyBase] = Nil) = | ||
{ | ||
new TLMasterPortParameters( | ||
masters = masters, | ||
channelBytes = channelBytes, | ||
minLatency = minLatency, | ||
echoFields = echoFields, | ||
requestFields = requestFields, | ||
responseKeys = responseKeys) | ||
} | ||
} | ||
|
||
case class TLBundleParameters( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment that specifies that "This value should be constrained by a data width parameter that flows from masters to slaves"