From 41421f5dca3587172c870b548921331398a06c19 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sat, 18 Apr 2020 03:43:15 +0000 Subject: ast, rpc: record original name of $paramod\* as \hdlname attribute. The $paramod name mangling is not invertible (the \ character, which separates the module name from the parameters, is valid in the module name itself), which does not stop people from trying to invert it. This commit makes it easy to invert the name mangling by storing the original name explicitly, and fixes the firrtl backend to use the newly introduced attribute. --- frontends/rpc/rpc_frontend.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'frontends/rpc') diff --git a/frontends/rpc/rpc_frontend.cc b/frontends/rpc/rpc_frontend.cc index a23f7548e..46ee6a733 100644 --- a/frontends/rpc/rpc_frontend.cc +++ b/frontends/rpc/rpc_frontend.cc @@ -217,6 +217,8 @@ struct RpcModule : RTLIL::Module { module.second->name = mangled_name; module.second->design = design; module.second->attributes.erase(ID::top); + if (!module.second->has_attribute(ID::hdlname)) + module.second->set_string_attribute(ID::hdlname, module.first.str()); design->modules_[mangled_name] = module.second; derived_design->modules_.erase(module.first); } -- cgit v1.2.3