summaryrefslogtreecommitdiff
path: root/passes/memory
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-01-17 00:15:15 +0100
committerClifford Wolf <clifford@clifford.at>2014-01-17 00:15:15 +0100
commitf3154f569423c978946982a9ddb0a05627e255a9 (patch)
tree3cf6067afaa9b82a42473608de2904a381ec0186 /passes/memory
parent4d8318ad1be85fa25c44bd4cb6111bb8a0a2a34f (diff)
Added automatic memid generation to memory_unpack command
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 6aa6698f..060d8e67 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;