Added "src" attribute to processes
authorClifford Wolf <clifford@clifford.at>
Thu, 28 Nov 2013 16:37:50 +0000 (17:37 +0100)
committerClifford Wolf <clifford@clifford.at>
Thu, 28 Nov 2013 16:37:50 +0000 (17:37 +0100)
frontends/ast/genrtlil.cc
passes/cmds/show.cc

index f7e7b852cc7afa16ac2193ca1dd6506fd3a37517..8aea05969336a788c5210e051ef05c0c335b76b8 100644 (file)
@@ -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)
index f5ebe774ae19304203d176eaf7c55457759d454e..c4d93333219607cd430b6c5fb09914d9af17370d 100644 (file)
@@ -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)