summaryrefslogtreecommitdiff
path: root/src/main/scala/chisel3/util/pla.scala
diff options
context:
space:
mode:
authorJack Koenig2022-01-10 10:39:52 -0800
committerJack Koenig2022-01-10 15:53:55 -0800
commit3131c0daad41dea78bede4517669e376c41a325a (patch)
tree55baed78a6a01f80ff3952a08233ca553a19964f /src/main/scala/chisel3/util/pla.scala
parentdd36f97a82746cec0b25b94651581fe799e24579 (diff)
Apply scalafmt
Command: sbt scalafmtAll
Diffstat (limited to 'src/main/scala/chisel3/util/pla.scala')
-rw-r--r--src/main/scala/chisel3/util/pla.scala35
1 files changed, 18 insertions, 17 deletions
diff --git a/src/main/scala/chisel3/util/pla.scala b/src/main/scala/chisel3/util/pla.scala
index c57ca962..d4707d26 100644
--- a/src/main/scala/chisel3/util/pla.scala
+++ b/src/main/scala/chisel3/util/pla.scala
@@ -68,7 +68,8 @@ object pla {
val inverterMask = invert.value & invert.mask
if (inverterMask.bitCount != 0)
- require(invert.getWidth == numberOfOutputs,
+ require(
+ invert.getWidth == numberOfOutputs,
"non-zero inverter mask must have the same width as the output part of specified PLA table"
)
@@ -99,28 +100,28 @@ object pla {
// the OR matrix
val orMatrixOutputs: UInt = Cat(
- Seq
- .tabulate(numberOfOutputs) { i =>
- val andMatrixLines = table
- // OR matrix composed by input terms which makes this output bit a `1`
- .filter {
- case (_, or) => or.mask.testBit(i) && or.value.testBit(i)
- }.map {
- case (inputTerm, _) =>
- andMatrixOutputs(inputTerm.toString)
- }
- if (andMatrixLines.isEmpty) false.B
- else Cat(andMatrixLines).orR()
- }
- .reverse
- )
+ Seq
+ .tabulate(numberOfOutputs) { i =>
+ val andMatrixLines = table
+ // OR matrix composed by input terms which makes this output bit a `1`
+ .filter {
+ case (_, or) => or.mask.testBit(i) && or.value.testBit(i)
+ }.map {
+ case (inputTerm, _) =>
+ andMatrixOutputs(inputTerm.toString)
+ }
+ if (andMatrixLines.isEmpty) false.B
+ else Cat(andMatrixLines).orR()
+ }
+ .reverse
+ )
// the INV matrix, useful for decoders
val invMatrixOutputs: UInt = Cat(
Seq
.tabulate(numberOfOutputs) { i =>
if (inverterMask.testBit(i)) ~orMatrixOutputs(i)
- else orMatrixOutputs(i)
+ else orMatrixOutputs(i)
}
.reverse
)