From: Clifford Wolf Date: Thu, 28 Nov 2013 16:37:50 +0000 (+0100) Subject: Added "src" attribute to processes X-Git-Tag: yosys-0.2.0~287 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0e52f3fa01dfc7280141871585ed180225a596e7;p=yosys.git Added "src" attribute to processes --- diff --git a/frontends/ast/genrtlil.cc b/frontends/ast/genrtlil.cc index f7e7b852c..8aea05969 100644 --- a/frontends/ast/genrtlil.cc +++ b/frontends/ast/genrtlil.cc @@ -265,6 +265,7 @@ struct AST_INTERNAL::ProcessGenerator { // generate process and simple root case proc = new RTLIL::Process; + proc->attributes["\\src"] = stringf("%s:%d", always->filename.c_str(), always->linenum); proc->name = stringf("$proc$%s:%d$%d", always->filename.c_str(), always->linenum, RTLIL::autoidx++); for (auto &attr : always->attributes) { if (attr.second->type != AST_CONSTANT) diff --git a/passes/cmds/show.cc b/passes/cmds/show.cc index f5ebe774a..c4d933332 100644 --- a/passes/cmds/show.cc +++ b/passes/cmds/show.cc @@ -386,7 +386,10 @@ struct ShowWorker net_conn_map[node].in.insert(stringf("p%d", pidx)); } - fprintf(f, "p%d [shape=box, style=rounded, label=\"PROC\\n%s\"];\n", pidx, RTLIL::id2cstr(proc->name)); + std::string proc_src = RTLIL::unescape_id(proc->name); + if (proc->attributes.count("\\src") > 0) + proc_src = proc->attributes.at("\\src").str; + fprintf(f, "p%d [shape=box, style=rounded, label=\"PROC\\n%s\"];\n", pidx, proc_src.c_str()); } for (auto &conn : module->connections)