1
0

minor Changes needed to support formal tests

This commit is contained in:
Jacob Chang 2016-12-01 14:55:25 -08:00
parent 4234cff074
commit cff2612cdb
5 changed files with 28 additions and 3 deletions

View File

@ -91,7 +91,10 @@ object LazyModule
protected[diplomacy] var stack = List[LazyModule]() protected[diplomacy] var stack = List[LazyModule]()
private var index = 0 private var index = 0
var module_list = List[LazyModule]()
def apply[T <: LazyModule](bc: T)(implicit sourceInfo: SourceInfo): T = { def apply[T <: LazyModule](bc: T)(implicit sourceInfo: SourceInfo): T = {
module_list = bc :: module_list
// Make sure the user put LazyModule around modules in the correct order // Make sure the user put LazyModule around modules in the correct order
// If this require fails, probably some grandchild was missing a LazyModule // If this require fails, probably some grandchild was missing a LazyModule
// ... or you applied LazyModule twice // ... or you applied LazyModule twice

View File

@ -95,6 +95,24 @@ class TLEdge(
staticHasData(x).map(Bool(_)).getOrElse(opdata) staticHasData(x).map(Bool(_)).getOrElse(opdata)
} }
def opcode(x: TLDataChannel): UInt = {
x match {
case a: TLBundleA => a.opcode
case b: TLBundleB => b.opcode
case c: TLBundleC => c.opcode
case d: TLBundleD => d.opcode
}
}
def param(x: TLDataChannel): UInt = {
x match {
case a: TLBundleA => a.param
case b: TLBundleB => b.param
case c: TLBundleC => c.param
case d: TLBundleD => d.param
}
}
def size(x: TLDataChannel): UInt = { def size(x: TLDataChannel): UInt = {
x match { x match {
case a: TLBundleA => a.size case a: TLBundleA => a.size

View File

@ -13,7 +13,7 @@ import scala.math.{min,max}
// Fragmenter modifies: PutFull, PutPartial, LogicalData, Get, Hint // Fragmenter modifies: PutFull, PutPartial, LogicalData, Get, Hint
// Fragmenter passes: ArithmeticData (truncated to minSize if alwaysMin) // Fragmenter passes: ArithmeticData (truncated to minSize if alwaysMin)
// Fragmenter cannot modify acquire (could livelock); thus it is unsafe to put caches on both sides // Fragmenter cannot modify acquire (could livelock); thus it is unsafe to put caches on both sides
class TLFragmenter(minSize: Int, maxSize: Int, alwaysMin: Boolean = false) extends LazyModule class TLFragmenter(val minSize: Int, val maxSize: Int, val alwaysMin: Boolean = false) extends LazyModule
{ {
require (isPow2 (maxSize)) require (isPow2 (maxSize))
require (isPow2 (minSize)) require (isPow2 (minSize))

View File

@ -415,11 +415,15 @@ class TLMonitor(gen: () => TLBundleSnoop, edge: () => TLEdge, sourceInfo: Source
legalizeSourceUnique(bundle, edge) legalizeSourceUnique(bundle, edge)
} }
var code_insertion = (bundle_monitor: TLBundleSnoop, edge: TLEdge) => {}
lazy val module = new LazyModuleImp(this) { lazy val module = new LazyModuleImp(this) {
val io = new Bundle { val io = new Bundle {
val in = gen().asInput val in = gen().asInput
} }
code_insertion(io.in, edge())
legalize(io.in, edge())(sourceInfo) legalize(io.in, edge())(sourceInfo)
} }
} }

View File

@ -7,9 +7,9 @@ import diplomacy._
import scala.math.max import scala.math.max
case class TLManagerParameters( case class TLManagerParameters(
address: Seq[AddressSet], val address: Seq[AddressSet],
regionType: RegionType.T = RegionType.GET_EFFECTS, regionType: RegionType.T = RegionType.GET_EFFECTS,
executable: Boolean = false, // processor can execute from this memory val executable: Boolean = false, // processor can execute from this memory
nodePath: Seq[BaseNode] = Seq(), nodePath: Seq[BaseNode] = Seq(),
// Supports both Acquire+Release+Finish of these sizes // Supports both Acquire+Release+Finish of these sizes
supportsAcquire: TransferSizes = TransferSizes.none, supportsAcquire: TransferSizes = TransferSizes.none,