aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAngie Wang2016-10-23 19:32:18 -0700
committerDonggyu2016-10-23 19:32:18 -0700
commitde45e93c43201c5b757d681fb922a57564462a08 (patch)
tree0593b4e4d846ab2a205ca7ef4f6f66606775c023 /src
parentbcf73fb70969e5629a693c18f1f2ee7b37f14a76 (diff)
Fix bitmask (#346)
* toBitMask cat direction should be consistent with data * minor comment updates * moved remaining mem passes/utils to memlib * changed again so that data, mask are consistent. data element 0, bit 0 = LSB (on RHS) when concatenated
Diffstat (limited to 'src')
-rw-r--r--src/main/scala/firrtl/passes/memlib/InferReadWrite.scala (renamed from src/main/scala/firrtl/passes/InferReadWrite.scala)0
-rw-r--r--src/main/scala/firrtl/passes/memlib/MemUtils.scala (renamed from src/main/scala/firrtl/passes/MemUtils.scala)29
-rw-r--r--src/main/scala/firrtl/passes/memlib/ReplaceMemMacros.scala3
-rw-r--r--src/main/scala/firrtl/passes/memlib/VerilogMemDelays.scala (renamed from src/main/scala/firrtl/passes/VerilogMemDelays.scala)0
4 files changed, 4 insertions, 28 deletions
diff --git a/src/main/scala/firrtl/passes/InferReadWrite.scala b/src/main/scala/firrtl/passes/memlib/InferReadWrite.scala
index 9adbdd95..9adbdd95 100644
--- a/src/main/scala/firrtl/passes/InferReadWrite.scala
+++ b/src/main/scala/firrtl/passes/memlib/InferReadWrite.scala
diff --git a/src/main/scala/firrtl/passes/MemUtils.scala b/src/main/scala/firrtl/passes/memlib/MemUtils.scala
index 8cd58afb..22650c7a 100644
--- a/src/main/scala/firrtl/passes/MemUtils.scala
+++ b/src/main/scala/firrtl/passes/memlib/MemUtils.scala
@@ -1,29 +1,4 @@
-/*
- Copyright (c) 2014 - 2016 The Regents of the University of
- California (Regents). All Rights Reserved. Redistribution and use in
- source and binary forms, with or without modification, are permitted
- provided that the following conditions are met:
- * Redistributions of source code must retain the above
- copyright notice, this list of conditions and the following
- two paragraphs of disclaimer.
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- two paragraphs of disclaimer in the documentation and/or other materials
- provided with the distribution.
- * Neither the name of the Regents nor the names of its contributors
- may be used to endorse or promote products derived from this
- software without specific prior written permission.
- IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
- SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
- ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
- REGENTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF
- ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION
- TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
- MODIFICATIONS.
- */
+// See LICENSE for license details.
package firrtl.passes
@@ -52,7 +27,7 @@ object toBits {
case t => error("Invalid operand expression for toBits!")
}
private def hiercat(e: Expression): Expression = e.tpe match {
- case t: VectorType => seqCat((0 until t.size) map (i =>
+ case t: VectorType => seqCat((0 until t.size).reverse map (i =>
hiercat(WSubIndex(e, i, t.tpe, UNKNOWNGENDER))))
case t: BundleType => seqCat(t.fields map (f =>
hiercat(WSubField(e, f.name, f.tpe, UNKNOWNGENDER))))
diff --git a/src/main/scala/firrtl/passes/memlib/ReplaceMemMacros.scala b/src/main/scala/firrtl/passes/memlib/ReplaceMemMacros.scala
index 3139ef21..5fc99b9c 100644
--- a/src/main/scala/firrtl/passes/memlib/ReplaceMemMacros.scala
+++ b/src/main/scala/firrtl/passes/memlib/ReplaceMemMacros.scala
@@ -109,7 +109,8 @@ class ReplaceMemMacros(writer: ConfWriter) extends Pass {
def defaultConnects(wrapperPort: WRef, bbPort: WSubField): Seq[Connect] =
Seq("clk", "en", "addr") map (f => connectFields(bbPort, f, wrapperPort, f))
- // Connects the clk, en, and addr fields from the wrapperPort to the bbPort
+ // Generates mask bits (concatenates an aggregate to ground type)
+ // depending on mask granularity (# bits = data width / mask granularity)
def maskBits(mask: WSubField, dataType: Type, fillMask: Boolean): Expression =
if (fillMask) toBitMask(mask, dataType) else toBits(mask)
diff --git a/src/main/scala/firrtl/passes/VerilogMemDelays.scala b/src/main/scala/firrtl/passes/memlib/VerilogMemDelays.scala
index 2f7126b4..2f7126b4 100644
--- a/src/main/scala/firrtl/passes/VerilogMemDelays.scala
+++ b/src/main/scala/firrtl/passes/memlib/VerilogMemDelays.scala