Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2023-02-28 08:27:07 -07:00
parent a500b96fda
commit d6c21a21e1
4 changed files with 17 additions and 5 deletions

Binary file not shown.

Binary file not shown.

View File

@ -975,7 +975,7 @@ proc get_ports { args } {
return $ports return $ports
} }
variable filter_regexp1 {@?([a-zA-Z_]+) *(==|=~) *([0-9a-zA-Z_\*]+)} variable filter_regexp1 {@?([a-zA-Z_]+) *(==|!=|=~) *([0-9a-zA-Z_\*]+)}
variable filter_or_regexp "($filter_regexp1) +\\|\\| +($filter_regexp1)" variable filter_or_regexp "($filter_regexp1) +\\|\\| +($filter_regexp1)"
variable filter_and_regexp "($filter_regexp1) +&& +($filter_regexp1)" variable filter_and_regexp "($filter_regexp1) +&& +($filter_regexp1)"

View File

@ -2426,12 +2426,15 @@ filter_ports(const char *property,
Sta *sta = Sta::sta(); Sta *sta = Sta::sta();
PortSeq filtered_ports; PortSeq filtered_ports;
bool exact_match = stringEq(op, "=="); bool exact_match = stringEq(op, "==");
bool pattern_match = stringEq(op, "=~");
bool not_match = stringEq(op, "!=");
for (const Port *port : *ports) { for (const Port *port : *ports) {
PropertyValue value(getProperty(port, property, sta)); PropertyValue value(getProperty(port, property, sta));
const char *prop = value.stringValue(); const char *prop = value.stringValue();
if (prop && if (prop &&
((exact_match && stringEq(prop, pattern)) ((exact_match && stringEq(prop, pattern))
|| (!exact_match && patternMatch(pattern, prop)))) || (not_match && !stringEq(prop, pattern))
|| (pattern_match && patternMatch(pattern, prop))))
filtered_ports.push_back(port); filtered_ports.push_back(port);
} }
delete ports; delete ports;
@ -2447,13 +2450,16 @@ filter_insts(const char *property,
Sta *sta = Sta::sta(); Sta *sta = Sta::sta();
cmdLinkedNetwork(); cmdLinkedNetwork();
bool exact_match = stringEq(op, "=="); bool exact_match = stringEq(op, "==");
bool pattern_match = stringEq(op, "=~");
bool not_match = stringEq(op, "!=");
InstanceSeq filtered_insts; InstanceSeq filtered_insts;
for (const Instance *inst : *insts) { for (const Instance *inst : *insts) {
PropertyValue value(getProperty(inst, property, sta)); PropertyValue value(getProperty(inst, property, sta));
const char *prop = value.stringValue(); const char *prop = value.stringValue();
if (prop && if (prop &&
((exact_match && stringEq(prop, pattern)) ((exact_match && stringEq(prop, pattern))
|| (!exact_match && patternMatch(pattern, prop)))) || (not_match && !stringEq(prop, pattern))
|| (pattern_match && patternMatch(pattern, prop))))
filtered_insts.push_back(inst); filtered_insts.push_back(inst);
} }
delete insts; delete insts;
@ -2469,12 +2475,15 @@ filter_pins(const char *property,
Sta *sta = Sta::sta(); Sta *sta = Sta::sta();
PinSeq filtered_pins; PinSeq filtered_pins;
bool exact_match = stringEq(op, "=="); bool exact_match = stringEq(op, "==");
bool pattern_match = stringEq(op, "=~");
bool not_match = stringEq(op, "!=");
for (const Pin *pin : *pins) { for (const Pin *pin : *pins) {
PropertyValue value(getProperty(pin, property, sta)); PropertyValue value(getProperty(pin, property, sta));
const char *prop = value.stringValue(); const char *prop = value.stringValue();
if (prop && if (prop &&
((exact_match && stringEq(prop, pattern)) ((exact_match && stringEq(prop, pattern))
|| (!exact_match && patternMatch(pattern, prop)))) || (not_match && !stringEq(prop, pattern))
|| (pattern_match && patternMatch(pattern, prop))))
filtered_pins.push_back(pin); filtered_pins.push_back(pin);
} }
delete pins; delete pins;
@ -2675,12 +2684,15 @@ filter_timing_arcs(const char *property,
Sta *sta = Sta::sta(); Sta *sta = Sta::sta();
EdgeSeq filtered_edges; EdgeSeq filtered_edges;
bool exact_match = stringEq(op, "=="); bool exact_match = stringEq(op, "==");
bool pattern_match = stringEq(op, "=~");
bool not_match = stringEq(op, "!=");
for (Edge *edge : *edges) { for (Edge *edge : *edges) {
PropertyValue value(getProperty(edge, property, sta)); PropertyValue value(getProperty(edge, property, sta));
const char *prop = value.stringValue(); const char *prop = value.stringValue();
if (prop && if (prop &&
((exact_match && stringEq(prop, pattern)) ((exact_match && stringEq(prop, pattern))
|| (!exact_match && patternMatch(pattern, prop)))) || (not_match && !stringEq(prop, pattern))
|| (pattern_match && patternMatch(pattern, prop))))
filtered_edges.push_back(edge); filtered_edges.push_back(edge);
} }
delete edges; delete edges;