spef unescaped names resolves #208

commit ce315777630daa66702dc08f60992dd50ad822c1
Author: James Cherry <[email protected]>
Date:   Mon Feb 10 17:30:34 2025 -0700

    spef missing escapes

    Signed-off-by: James Cherry <[email protected]>

Signed-off-by: James Cherry <[email protected]>
This commit is contained in:
James Cherry
2025-02-10 17:32:50 -07:00
parent 0dfea7dfad
commit b8b67ba4df
6 changed files with 89 additions and 48 deletions
+36 -3
View File
@@ -789,6 +789,22 @@ SdcNetwork::findInstance(const char *path_name) const
return child;
}
Instance *
SdcNetwork::findInstanceRelative(const Instance *inst,
const char *path_name) const
{
Instance *inst1 = network_->findInstanceRelative(inst, path_name);
if (inst1 == nullptr) {
string path_name1 = escapeBrackets(path_name, this);
inst1 = network_->findInstanceRelative(inst, path_name1.c_str());
if (inst1 == nullptr) {
string path_name2 = escapeDividers(path_name1.c_str(), network_);
inst1 = network_->findInstanceRelative(inst, path_name2.c_str());
}
}
return inst1;
}
InstanceSeq
SdcNetwork::findInstancesMatching(const Instance *context,
const PatternMatch *pattern) const
@@ -835,17 +851,34 @@ SdcNetwork::findNet(const char *path_name) const
parsePath(path_name, inst, net_name);
if (inst == nullptr)
inst = network_->topInstance();
return findNet(inst, net_name);
return findNetRelative(inst, net_name);
}
Net *
SdcNetwork::findNet(const Instance *instance,
const char *net_name) const
const char *net_name) const
{
Net *net = network_->findNet(instance, net_name);
if (net == nullptr) {
string net_name1 = escapeBrackets(net_name, this);
net = network_->findNet(instance, net_name1.c_str());
string net_name2 = escapeDividers(net_name1.c_str(), network_);
net = network_->findNet(instance, net_name2.c_str());
}
return net;
}
Net *
SdcNetwork::findNetRelative(const Instance *inst,
const char *path_name) const
{
Net *net = network_->findNetRelative(inst, path_name);
if (net == nullptr) {
string path_name1 = escapeBrackets(path_name, this);
net = network_->findNetRelative(inst, path_name1.c_str());
if (net == nullptr) {
string path_name2 = escapeDividers(path_name1.c_str(), network_);
net = network_->findNetRelative(inst, path_name2.c_str());
}
}
return net;
}