aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/yw.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/yw.h')
-rw-r--r--kernel/yw.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/yw.h b/kernel/yw.h
index 8b651fd83..503319b1d 100644
--- a/kernel/yw.h
+++ b/kernel/yw.h
@@ -52,6 +52,18 @@ struct WitnessHierarchyItem {
template<typename D, typename T>
void witness_hierarchy(RTLIL::Module *module, D data, T callback);
+template<class T> static std::vector<std::string> witness_path(T *obj) {
+ std::vector<std::string> path;
+ if (obj->name.isPublic()) {
+ auto hdlname = obj->get_string_attribute(ID::hdlname);
+ for (auto token : split_tokens(hdlname))
+ path.push_back("\\" + token);
+ }
+ if (path.empty())
+ path.push_back(obj->name.str());
+ return path;
+}
+
struct ReadWitness
{
struct Clock {