Some cleanups in setundef.cc
authorClifford Wolf <clifford@clifford.at>
Sun, 13 May 2018 14:36:12 +0000 (16:36 +0200)
committerClifford Wolf <clifford@clifford.at>
Sun, 13 May 2018 14:36:12 +0000 (16:36 +0200)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
passes/cmds/setundef.cc

index 389c3790ec576f6e9090e1e444c4d5caca20a2d4..c11ddbdc1061f11fd900e75878987fc4a00989ab 100644 (file)
@@ -40,6 +40,9 @@ struct SetundefWorker
                if (next_bit_mode == 1)
                        return RTLIL::State::S1;
 
+               if (next_bit_mode == 2)
+                       log_abort();
+
                if (next_bit_mode == 4)
                        return RTLIL::State::Sx;
 
@@ -117,21 +120,25 @@ struct SetundefPass : public Pass {
                        if (args[argidx] == "-zero") {
                                got_value = true;
                                worker.next_bit_mode = 0;
+                               worker.next_bit_state = 0;
                                continue;
                        }
                        if (args[argidx] == "-one") {
                                got_value = true;
                                worker.next_bit_mode = 1;
+                               worker.next_bit_state = 0;
                                continue;
                        }
                        if (args[argidx] == "-anyseq") {
                                got_value = true;
                                worker.next_bit_mode = 2;
+                               worker.next_bit_state = 0;
                                continue;
                        }
                        if (args[argidx] == "-undef") {
                                got_value = true;
                                worker.next_bit_mode = 4;
+                               worker.next_bit_state = 0;
                                continue;
                        }
                        if (args[argidx] == "-init") {