summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorJiuyang Liu2021-06-14 22:39:42 +0800
committerJiuyang Liu2021-06-16 10:32:04 +0800
commit48548463c6c5c6bc9076c80924cb4683fc737f11 (patch)
tree976fa9b496426a537434942adfd71ea574ee8085 /src/main
parentc11fdf33981365927ea085b7aee095933a4a5ddf (diff)
Apply Jack's Review
1. `TruthTable` is final now. 2. add return type for `TruthTable` Co-authored-by: Jack Koenig <koenig@sifive.com>
Diffstat (limited to 'src/main')
-rw-r--r--src/main/scala/chisel3/util/experimental/decode/TruthTable.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/scala/chisel3/util/experimental/decode/TruthTable.scala b/src/main/scala/chisel3/util/experimental/decode/TruthTable.scala
index cde9cf14..ca0ff8b4 100644
--- a/src/main/scala/chisel3/util/experimental/decode/TruthTable.scala
+++ b/src/main/scala/chisel3/util/experimental/decode/TruthTable.scala
@@ -4,7 +4,7 @@ package chisel3.util.experimental.decode
import chisel3.util.BitPat
-sealed class TruthTable(val table: Map[BitPat, BitPat], val default: BitPat) {
+final class TruthTable(val table: Map[BitPat, BitPat], val default: BitPat) {
def inputWidth = table.head._1.getWidth
@@ -42,7 +42,7 @@ object TruthTable {
}
/** Convert a table and default output into a [[TruthTable]]. */
- def apply(table: Iterable[(BitPat, BitPat)], default: BitPat) = {
+ def apply(table: Iterable[(BitPat, BitPat)], default: BitPat): TruthTable = {
require(table.map(_._1.getWidth).toSet.size == 1, "input width not equal.")
require(table.map(_._2.getWidth).toSet.size == 1, "output width not equal.")
val outputWidth = table.map(_._2.getWidth).head