Another fsm_extract bugfix
authorClifford Wolf <clifford@clifford.at>
Fri, 8 Aug 2014 12:55:11 +0000 (14:55 +0200)
committerClifford Wolf <clifford@clifford.at>
Fri, 8 Aug 2014 12:56:04 +0000 (14:56 +0200)
passes/fsm/fsm_extract.cc

index 7533b4a33c1e3a93132a0d6a8ff92014dc0667f0..ebe3073def02e9ede94d2bbd79d5eadd363326ba 100644 (file)
@@ -231,6 +231,10 @@ static void extract_fsm(RTLIL::Wire *wire)
                log("  fsm extraction failed: state selection tree is not closed.\n");
                return;
        }
+       if (SIZE(states) <= 1) {
+               log("  fsm extraction failed: at least two states are required.\n");
+               return;
+       }
 
        // find control outputs
        // (add the state signals to the list of control outputs. if everything goes right, this signals