json: Improve reporting of multiple drivers

Signed-off-by: David Shah <dave@ds0.me>
This commit is contained in:
David Shah 2018-11-29 19:20:51 +00:00
parent fc08856537
commit dbc14ea76d

View File

@ -594,7 +594,11 @@ void json_import_cell(Context *ctx, string modname, const std::vector<IdString>
if (type == PORT_IN || type == PORT_INOUT) { if (type == PORT_IN || type == PORT_INOUT) {
net->users.push_back(pr); net->users.push_back(pr);
} else if (type == PORT_OUT) { } else if (type == PORT_OUT) {
assert(net->driver.cell == nullptr); if (net->driver.cell != nullptr)
log_error("multiple drivers on net '%s' (%s.%s and %s.%s)\n",
net->name.c_str(ctx), net->driver.cell->name.c_str(ctx),
net->driver.port.c_str(ctx), pr.cell->name.c_str(ctx),
pr.port.c_str(ctx));
net->driver = pr; net->driver = pr;
} }
} }