verilog dup name
Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
parent
661097bdae
commit
01f1fc7642
|
|
@ -927,12 +927,12 @@ VerilogModule::checkInstanceName(VerilogInst *inst,
|
||||||
{
|
{
|
||||||
const char *inst_name = inst->instanceName();
|
const char *inst_name = inst->instanceName();
|
||||||
if (inst_names.findKey(inst_name)) {
|
if (inst_names.findKey(inst_name)) {
|
||||||
int i = 1;
|
int i = 0;
|
||||||
const char *replacement_name = nullptr;
|
const char *replacement_name = nullptr;
|
||||||
do {
|
do {
|
||||||
if (replacement_name)
|
if (replacement_name)
|
||||||
stringDelete(replacement_name);
|
stringDelete(replacement_name);
|
||||||
replacement_name = stringPrint("%s_%d", inst_name, i);
|
replacement_name = stringPrint("%s_%d", inst_name, i++);
|
||||||
} while (inst_names.findKey(replacement_name));
|
} while (inst_names.findKey(replacement_name));
|
||||||
string inst_vname = reader->instanceVerilogName(inst_name);
|
string inst_vname = reader->instanceVerilogName(inst_name);
|
||||||
reader->warn(1396, filename_, inst->line(),
|
reader->warn(1396, filename_, inst->line(),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue