Fixed gentb_constant handling in autotest backend
authorClifford Wolf <clifford@clifford.at>
Wed, 4 Dec 2013 08:09:42 +0000 (09:09 +0100)
committerClifford Wolf <clifford@clifford.at>
Wed, 4 Dec 2013 08:09:42 +0000 (09:09 +0100)
backends/autotest/autotest.cc

index 89ccc371865914da417030d5be2b69bac6b50072..3e2fab0069993254527bf29bee65ca9991f5fefd 100644 (file)
@@ -124,11 +124,11 @@ static void autotest(FILE *f, RTLIL::Design *design)
                                                        is_clksignal = true;
                                        }
                                }
-                               if (is_clksignal && !wire->get_bool_attribute("\\gentb_constant")) {
+                               if (is_clksignal && wire->attributes.count("\\gentb_constant") == 0) {
                                        signal_clk[idy("sig", mod->name, wire->name)] = wire->width;
                                } else {
                                        signal_in[idy("sig", mod->name, wire->name)] = wire->width;
-                                       if (wire->get_bool_attribute("\\gentb_constant"))
+                                       if (wire->attributes.count("\\gentb_constant") != 0)
                                                signal_const[idy("sig", mod->name, wire->name)] = wire->attributes["\\gentb_constant"].as_string();
                                }
                                fprintf(f, "reg [%d:0] %s;\n", wire->width-1, idy("sig", mod->name, wire->name).c_str());