Raise a RuntimeError instead of AssertionError
authorEddie Hung <eddie@fpgeh.com>
Thu, 12 Sep 2019 00:06:37 +0000 (17:06 -0700)
committerEddie Hung <eddie@fpgeh.com>
Thu, 12 Sep 2019 00:06:37 +0000 (17:06 -0700)
passes/pmgen/pmgen.py

index 573722d68e4830a5234fe368648f0f963c4176fd..335d26f169b7ac820061d04ac3a6e3cf65de254e 100644 (file)
@@ -305,7 +305,8 @@ def process_pmgfile(f, filename):
             block["states"] = set()
 
             for s in line.split()[1:]:
-                assert s in state_types[current_pattern]
+                if s not in state_types[current_pattern]:
+                    raise RuntimeError("'%s' not in state_types" % s)
                 block["states"].add(s)
 
             codetype = "code"