memory_collect: Copy attr from RTLIL::Memory to cell
authorDavid Shah <dave@ds0.me>
Mon, 18 Nov 2019 13:58:03 +0000 (13:58 +0000)
committerDavid Shah <dave@ds0.me>
Mon, 18 Nov 2019 13:58:03 +0000 (13:58 +0000)
Signed-off-by: David Shah <dave@ds0.me>
passes/memory/memory_collect.cc

index 6acbce62fda6dab443e0a6eb53eeb3bb3957fd6d..9dcb3f0246d816a00307e9a080b5030b00e58aec 100644 (file)
@@ -218,6 +218,10 @@ Cell *handle_memory(Module *module, RTLIL::Memory *memory)
        mem->setPort("\\RD_DATA", sig_rd_data);
        mem->setPort("\\RD_EN", sig_rd_en);
 
+       // Copy attributes from RTLIL memory to $mem
+       for (auto attr : memory->attributes)
+               mem->attributes[attr.first] = attr.second;
+
        for (auto c : memcells)
                module->remove(c);