Use require statement

This commit is contained in:
Edward Wang
2017-07-21 10:32:48 -07:00
committed by edwardcwang
parent 3cb424cf80
commit 80ca2e538f
2 changed files with 5 additions and 8 deletions

View File

@@ -176,11 +176,8 @@ class MacroCompilerPass(mems: Option[Seq[Macro]],
if (libPort.src.effectiveMaskGran == libPort.src.width) {
bits(WRef(mem), low / memPort.src.effectiveMaskGran)
} else {
if (libPort.src.effectiveMaskGran != 1) {
// TODO
System.err println "only single-bit mask supported"
return None
}
require(libPort.src.effectiveMaskGran == 1, "only single-bit mask supported for now")
cat(((low to high) map (i => bits(WRef(mem), i / memPort.src.effectiveMaskGran))).reverse)
}
case None =>

View File

@@ -18,9 +18,9 @@ class FirrtlMacroPort(port: MacroPort) {
val isWriter = !port.writeEnable.isEmpty && port.readEnable.isEmpty
val isReadWriter = !port.writeEnable.isEmpty && !port.readEnable.isEmpty
val AddrType = UIntType(IntWidth(ceilLog2(port.depth) max 1))
val DataType = UIntType(IntWidth(port.width))
val MaskType = UIntType(IntWidth(port.width / port.effectiveMaskGran))
val addrType = UIntType(IntWidth(ceilLog2(port.depth) max 1))
val dataType = UIntType(IntWidth(port.width))
val maskType = UIntType(IntWidth(port.width / port.effectiveMaskGran))
// Bundle representing this macro port.
val tpe = BundleType(Seq(