write_verilog escape cell names resolves #187
Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
parent
17ee13495a
commit
fc92c8411d
|
|
@ -22,6 +22,8 @@ namespace sta {
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
|
|
||||||
|
string
|
||||||
|
cellVerilogName(const char *sta_name);
|
||||||
string
|
string
|
||||||
instanceVerilogName(const char *sta_name,
|
instanceVerilogName(const char *sta_name,
|
||||||
const char escape);
|
const char escape);
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,12 @@ staToVerilog2(const char *sta_name,
|
||||||
static string
|
static string
|
||||||
verilogToSta(const char *verilog_name);
|
verilogToSta(const char *verilog_name);
|
||||||
|
|
||||||
|
string
|
||||||
|
cellVerilogName(const char *sta_name)
|
||||||
|
{
|
||||||
|
return staToVerilog(sta_name, '\\');
|
||||||
|
}
|
||||||
|
|
||||||
string
|
string
|
||||||
instanceVerilogName(const char *sta_name,
|
instanceVerilogName(const char *sta_name,
|
||||||
const char escape)
|
const char escape)
|
||||||
|
|
|
||||||
|
|
@ -171,8 +171,8 @@ void
|
||||||
VerilogWriter::writeModule(const Instance *inst)
|
VerilogWriter::writeModule(const Instance *inst)
|
||||||
{
|
{
|
||||||
Cell *cell = network_->cell(inst);
|
Cell *cell = network_->cell(inst);
|
||||||
fprintf(stream_, "module %s (",
|
string cell_vname = cellVerilogName(network_->name(cell));
|
||||||
network_->name(cell));
|
fprintf(stream_, "module %s (", cell_vname.c_str());
|
||||||
writePorts(cell);
|
writePorts(cell);
|
||||||
writePortDcls(cell);
|
writePortDcls(cell);
|
||||||
fprintf(stream_, "\n");
|
fprintf(stream_, "\n");
|
||||||
|
|
@ -336,8 +336,9 @@ VerilogWriter::writeChild(const Instance *child)
|
||||||
if (!remove_cells_.hasKey(child_cell)) {
|
if (!remove_cells_.hasKey(child_cell)) {
|
||||||
const char *child_name = network_->name(child);
|
const char *child_name = network_->name(child);
|
||||||
string child_vname = instanceVerilogName(child_name, network_->pathEscape());
|
string child_vname = instanceVerilogName(child_name, network_->pathEscape());
|
||||||
|
string child_cell_vname = cellVerilogName(network_->name(child_cell));
|
||||||
fprintf(stream_, " %s %s (",
|
fprintf(stream_, " %s %s (",
|
||||||
network_->name(child_cell),
|
child_cell_vname.c_str(),
|
||||||
child_vname.c_str());
|
child_vname.c_str());
|
||||||
bool first_port = true;
|
bool first_port = true;
|
||||||
CellPortIterator *port_iter = network_->portIterator(child_cell);
|
CellPortIterator *port_iter = network_->portIterator(child_cell);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue