From 2e63fb291a61aee66118877531ffe3e949d76a92 Mon Sep 17 00:00:00 2001 From: Howard Mao Date: Fri, 25 Sep 2015 10:05:38 -0700 Subject: [PATCH] put sensible defaults for NASTI channel constructors --- junctions/src/main/scala/nasti.scala | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/junctions/src/main/scala/nasti.scala b/junctions/src/main/scala/nasti.scala index abda7321..d01e352f 100644 --- a/junctions/src/main/scala/nasti.scala +++ b/junctions/src/main/scala/nasti.scala @@ -112,7 +112,7 @@ class NASTIReadDataChannel extends NASTIResponseChannel with HasNASTIData { } object NASTIWriteAddressChannel { - def apply(id: UInt, addr: UInt, size: UInt, len: UInt) = { + def apply(id: UInt, addr: UInt, size: UInt, len: UInt = UInt(0)) = { val aw = Wire(new NASTIWriteAddressChannel) aw.id := id aw.addr := addr @@ -130,7 +130,7 @@ object NASTIWriteAddressChannel { } object NASTIReadAddressChannel { - def apply(id: UInt, addr: UInt, size: UInt, len: UInt) = { + def apply(id: UInt, addr: UInt, size: UInt, len: UInt = UInt(0)) = { val ar = Wire(new NASTIReadAddressChannel) ar.id := id ar.addr := addr @@ -148,7 +148,9 @@ object NASTIReadAddressChannel { } object NASTIWriteDataChannel { - def apply(strb: UInt, data: UInt, last: Bool) = { + private val strobeBits = new NASTIWriteDataChannel().nastiWStrobeBits + val fullStrobe = Fill(strobeBits, UInt(1, 1)) + def apply(data: UInt, strb: UInt = fullStrobe, last: Bool = Bool(true)) = { val w = Wire(new NASTIWriteDataChannel) w.strb := strb w.data := data @@ -159,7 +161,7 @@ object NASTIWriteDataChannel { } object NASTIReadDataChannel { - def apply(id: UInt, data: UInt, last: Bool, resp: UInt = UInt(0)) = { + def apply(id: UInt, data: UInt, last: Bool = Bool(true), resp: UInt = UInt(0)) = { val r = Wire(new NASTIReadDataChannel) r.id := id r.data := data