aboutsummaryrefslogtreecommitdiffstats
path: root/passes/memory
diff options
context:
space:
mode:
Diffstat (limited to 'passes/memory')
-rw-r--r--passes/memory/memory_unpack.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/passes/memory/memory_unpack.cc b/passes/memory/memory_unpack.cc
index 6aa6698f7..060d8e671 100644
--- a/passes/memory/memory_unpack.cc
+++ b/passes/memory/memory_unpack.cc
@@ -31,8 +31,8 @@ static void handle_memory(RTLIL::Module *module, RTLIL::Cell *memory)
RTLIL::IdString mem_name = RTLIL::escape_id(memory->parameters.at("\\MEMID").decode_string());
- if (module->memories.count(mem_name) != 0)
- log_error("Already found a memory object with the ID %s.\n", mem_name.c_str());
+ while (module->memories.count(mem_name) != 0)
+ mem_name += stringf("_%d", RTLIL::autoidx++);
RTLIL::Memory *mem = new RTLIL::Memory;
mem->name = mem_name;
n120' href='#n120'>120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161