Use require statement
This commit is contained in:
@@ -176,11 +176,8 @@ class MacroCompilerPass(mems: Option[Seq[Macro]],
|
|||||||
if (libPort.src.effectiveMaskGran == libPort.src.width) {
|
if (libPort.src.effectiveMaskGran == libPort.src.width) {
|
||||||
bits(WRef(mem), low / memPort.src.effectiveMaskGran)
|
bits(WRef(mem), low / memPort.src.effectiveMaskGran)
|
||||||
} else {
|
} else {
|
||||||
if (libPort.src.effectiveMaskGran != 1) {
|
require(libPort.src.effectiveMaskGran == 1, "only single-bit mask supported for now")
|
||||||
// TODO
|
|
||||||
System.err println "only single-bit mask supported"
|
|
||||||
return None
|
|
||||||
}
|
|
||||||
cat(((low to high) map (i => bits(WRef(mem), i / memPort.src.effectiveMaskGran))).reverse)
|
cat(((low to high) map (i => bits(WRef(mem), i / memPort.src.effectiveMaskGran))).reverse)
|
||||||
}
|
}
|
||||||
case None =>
|
case None =>
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ class FirrtlMacroPort(port: MacroPort) {
|
|||||||
val isWriter = !port.writeEnable.isEmpty && port.readEnable.isEmpty
|
val isWriter = !port.writeEnable.isEmpty && port.readEnable.isEmpty
|
||||||
val isReadWriter = !port.writeEnable.isEmpty && !port.readEnable.isEmpty
|
val isReadWriter = !port.writeEnable.isEmpty && !port.readEnable.isEmpty
|
||||||
|
|
||||||
val AddrType = UIntType(IntWidth(ceilLog2(port.depth) max 1))
|
val addrType = UIntType(IntWidth(ceilLog2(port.depth) max 1))
|
||||||
val DataType = UIntType(IntWidth(port.width))
|
val dataType = UIntType(IntWidth(port.width))
|
||||||
val MaskType = UIntType(IntWidth(port.width / port.effectiveMaskGran))
|
val maskType = UIntType(IntWidth(port.width / port.effectiveMaskGran))
|
||||||
|
|
||||||
// Bundle representing this macro port.
|
// Bundle representing this macro port.
|
||||||
val tpe = BundleType(Seq(
|
val tpe = BundleType(Seq(
|
||||||
|
|||||||
Reference in New Issue
Block a user