From: Clifford Wolf Date: Thu, 16 Jan 2014 23:15:15 +0000 (+0100) Subject: Added automatic memid generation to memory_unpack command X-Git-Tag: yosys-0.2.0~170 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f3154f569423c978946982a9ddb0a05627e255a9;p=yosys.git Added automatic memid generation to memory_unpack command --- 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;