tilelink Buffer: use new :=? adapter API
This commit is contained in:
		| @@ -73,7 +73,7 @@ object TLBuffer | ||||
|       d: BufferParams, | ||||
|       e: BufferParams)(x: TLOutwardNode)(implicit p: Parameters, sourceInfo: SourceInfo): TLOutwardNode = { | ||||
|     val buffer = LazyModule(new TLBuffer(a, b, c, d, e)) | ||||
|     buffer.node := x | ||||
|     buffer.node :=? x | ||||
|     buffer.node | ||||
|   } | ||||
| } | ||||
| @@ -82,18 +82,19 @@ class TLBufferChain(depth: Int)(implicit p: Parameters) extends LazyModule { | ||||
|  | ||||
|   val nodeIn = TLInputNode() | ||||
|   val nodeOut = TLOutputNode() | ||||
|   val node = NodeHandle(nodeIn, nodeOut) | ||||
|  | ||||
|   val buf_chain = if (depth > 0) { | ||||
|     val chain = List.fill(depth)(LazyModule(new TLBuffer(BufferParams.default))) | ||||
|  | ||||
|     (chain.init zip chain.tail) foreach { case(prev, next) => next.node :=* prev.node } | ||||
|     (chain.init zip chain.tail) foreach { case(prev, next) => next.node :=? prev.node } | ||||
|     chain | ||||
|   } else { | ||||
|     List(LazyModule(new TLBuffer(BufferParams.none))) | ||||
|   } | ||||
|  | ||||
|   buf_chain.head.node :=* nodeIn | ||||
|   nodeOut :=* buf_chain.last.node | ||||
|   buf_chain.head.node :=? nodeIn | ||||
|   nodeOut :=? buf_chain.last.node | ||||
|  | ||||
|   lazy val module = new LazyModuleImp(this) { | ||||
|     val io = new Bundle { | ||||
| @@ -102,3 +103,12 @@ class TLBufferChain(depth: Int)(implicit p: Parameters) extends LazyModule { | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
| object TLBufferChain | ||||
| { | ||||
|   def apply(depth: Int)(x: TLOutwardNode)(implicit p: Parameters, sourceInfo: SourceInfo): TLOutwardNode = { | ||||
|     val buffer = LazyModule(new TLBufferChain(depth)) | ||||
|     buffer.node :=? x | ||||
|     buffer.node | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -68,9 +68,11 @@ abstract class TLBusWrapper(params: TLBusParams, val busName: String)(implicit p | ||||
|   protected def inwardBufNode: TLInwardNode = master_buffer.node | ||||
|  | ||||
|   protected def bufferChain(depth: Int, name: Option[String] = None): (TLInwardNode, TLOutwardNode) = { | ||||
|     val chain = LazyModule(new TLBufferChain(depth)) | ||||
|     name.foreach { n => chain.suggestName(s"${busName}_${n}_TLBufferChain")} | ||||
|     (chain.nodeIn, chain.nodeOut) | ||||
|     RightStar { implicit p => | ||||
|       val chain = LazyModule(new TLBufferChain(depth)) | ||||
|       name.foreach { n => chain.suggestName(s"${busName}_${n}_TLBufferChain")} | ||||
|       (chain.nodeIn, chain.nodeOut) | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   def bufferFromMasters: TLInwardNode = inwardBufNode | ||||
|   | ||||
		Reference in New Issue
	
	Block a user