1
0
Fork 0

tilelink2: helper objects should pass source line from where they were invoked

This commit is contained in:
Wesley W. Terpstra 2016-09-04 17:03:10 -07:00
parent 1a081b4dd5
commit fb262558ee
4 changed files with 8 additions and 4 deletions

View File

@ -3,6 +3,7 @@
package uncore.tilelink2
import Chisel._
import chisel3.internal.sourceinfo.SourceInfo
class TLBuffer(entries: Int = 2, pipe: Boolean = false) extends LazyModule
{
@ -39,7 +40,7 @@ class TLBuffer(entries: Int = 2, pipe: Boolean = false) extends LazyModule
object TLBuffer
{
// applied to the TL source node; connect (TLBuffer(x.node) -> y.node)
def apply(x: TLBaseNode, entries: Int = 2, pipe: Boolean = false)(implicit lazyModule: LazyModule): TLBaseNode = {
def apply(x: TLBaseNode, entries: Int = 2, pipe: Boolean = false)(implicit lazyModule: LazyModule, sourceInfo: SourceInfo): TLBaseNode = {
val buffer = LazyModule(new TLBuffer(entries, pipe))
lazyModule.connect(x -> buffer.node)
buffer.node

View File

@ -3,6 +3,7 @@
package uncore.tilelink2
import Chisel._
import chisel3.internal.sourceinfo.SourceInfo
import scala.math.{min,max}
// minSize: minimum size of transfers supported by all outward managers
@ -241,7 +242,7 @@ class TLFragmenter(minSize: Int, maxSize: Int, alwaysMin: Boolean = false) exten
object TLFragmenter
{
// applied to the TL source node; connect (TLFragmenter(x.node, 256, 4) -> y.node)
def apply(x: TLBaseNode, minSize: Int, maxSize: Int, alwaysMin: Boolean = false)(implicit lazyModule: LazyModule): TLBaseNode = {
def apply(x: TLBaseNode, minSize: Int, maxSize: Int, alwaysMin: Boolean = false)(implicit lazyModule: LazyModule, sourceInfo: SourceInfo): TLBaseNode = {
val fragmenter = LazyModule(new TLFragmenter(minSize, maxSize, alwaysMin))
lazyModule.connect(x -> fragmenter.node)
fragmenter.node

View File

@ -3,6 +3,7 @@
package uncore.tilelink2
import Chisel._
import chisel3.internal.sourceinfo.SourceInfo
// Acks Hints for managers that don't support them or Acks all Hints if !passthrough
class TLHintHandler(supportManagers: Boolean = true, supportClients: Boolean = false, passthrough: Boolean = true) extends LazyModule
@ -90,7 +91,7 @@ class TLHintHandler(supportManagers: Boolean = true, supportClients: Boolean = f
object TLHintHandler
{
// applied to the TL source node; connect (TLHintHandler(x.node) -> y.node)
def apply(x: TLBaseNode, supportManagers: Boolean = true, supportClients: Boolean = false, passthrough: Boolean = true)(implicit lazyModule: LazyModule): TLBaseNode = {
def apply(x: TLBaseNode, supportManagers: Boolean = true, supportClients: Boolean = false, passthrough: Boolean = true)(implicit lazyModule: LazyModule, sourceInfo: SourceInfo): TLBaseNode = {
val hints = LazyModule(new TLHintHandler(supportManagers, supportClients, passthrough))
lazyModule.connect(x -> hints.node)
hints.node

View File

@ -3,6 +3,7 @@
package uncore.tilelink2
import Chisel._
import chisel3.internal.sourceinfo.SourceInfo
// innBeatBytes => the bus width after the adapter
class TLNarrower(innerBeatBytes: Int) extends LazyModule
@ -122,7 +123,7 @@ class TLNarrower(innerBeatBytes: Int) extends LazyModule
object TLNarrower
{
// applied to the TL source node; connect (Narrower(x.node, 16) -> y.node)
def apply(x: TLBaseNode, innerBeatBytes: Int)(implicit lazyModule: LazyModule): TLBaseNode = {
def apply(x: TLBaseNode, innerBeatBytes: Int)(implicit lazyModule: LazyModule, sourceInfo: SourceInfo): TLBaseNode = {
val narrower = LazyModule(new TLNarrower(innerBeatBytes))
lazyModule.connect(x -> narrower.node)
narrower.node