Oops
authorEddie Hung <eddie@fpgeh.com>
Mon, 16 Dec 2019 21:31:05 +0000 (13:31 -0800)
committerEddie Hung <eddie@fpgeh.com>
Mon, 16 Dec 2019 21:31:05 +0000 (13:31 -0800)
passes/memory/memory_bram.cc

index a1353e56d509ff74b3727d5f8beb15c4dce9f495..7ce5e80e14b1bc273e7b4a0bb24e09ea052ec863 100644 (file)
@@ -333,12 +333,9 @@ struct rules_t
                                for (int idx = 1; idx <= GetSize(tokens)-1; idx++) {
                                        size_t c1 = tokens[1][0] == '!' ? 1 : 0;
                                        size_t c2 = tokens[1].find("=");
-                                       if (c2 != std::string::npos)
-                                               c2--;
-
                                        bool exists = (c1 == 0);
                                        IdString key = RTLIL::escape_id(tokens[1].substr(c1, c2));
-                                       Const val = c2 != std::string::npos ? tokens[1].substr(c2) : RTLIL::Const(1);
+                                       Const val = c2 != std::string::npos ? tokens[1].substr(c2+1) : RTLIL::Const(1);
 
                                        data.attributes.back().emplace_back(exists, key, val);
                                }