assertpmux: Fix crash on unused $pmux output.
authorMarcelina Kościelnicka <mwk@0x04.net>
Mon, 22 Feb 2021 21:02:48 +0000 (22:02 +0100)
committerMarcelina Kościelnicka <mwk@0x04.net>
Mon, 22 Feb 2021 22:30:28 +0000 (23:30 +0100)
Fixes #2595.

passes/sat/assertpmux.cc
tests/sat/bug2595.ys [new file with mode: 0644]

index e9a10465ea691ab4ff0738c36c73332f46d009af..f31b7880487540608fb952a7558c9f57550e2e27 100644 (file)
@@ -88,7 +88,7 @@ struct AssertpmuxWorker
                {
                        SigSpec output;
 
-                       for (auto muxuser : sigbit_muxusers.at(bit))
+                       for (auto muxuser : sigbit_muxusers[bit])
                        {
                                Cell *cell = std::get<0>(muxuser);
                                int portidx = std::get<1>(muxuser);
diff --git a/tests/sat/bug2595.ys b/tests/sat/bug2595.ys
new file mode 100644 (file)
index 0000000..f668fd7
--- /dev/null
@@ -0,0 +1,18 @@
+read_ilang <<EOT
+module \top
+  wire input 3 \A
+  wire width 2 input 2 \B
+  wire width 2 input 1 \S
+  wire \Y
+  cell $pmux \my_pmux
+    parameter signed \S_WIDTH 2
+    parameter signed \WIDTH 1
+    connect \A \A
+    connect \B \B
+    connect \S \S
+    connect \Y \Y
+  end
+end
+EOT
+
+assertpmux