aboutsummaryrefslogtreecommitdiffstats
path: root/passes/techmap
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2019-04-22 16:54:38 +0200
committerGitHub <noreply@github.com>2019-04-22 16:54:38 +0200
commit9050b5e1915b05f55c1db279566f34202905f02a (patch)
tree111ff3104e02f55f2cd2f30db227853f4e93648e /passes/techmap
parentc0f9a74b121dd19e359038b6f6f76be0ffe3cc38 (diff)
parentaeeefc32d8603b138f24824d01b29d28cb0f85cf (diff)
downloadyosys-9050b5e1915b05f55c1db279566f34202905f02a.tar.gz
yosys-9050b5e1915b05f55c1db279566f34202905f02a.tar.bz2
yosys-9050b5e1915b05f55c1db279566f34202905f02a.zip
Merge pull request #950 from whitequark/attrmap_remove_wildcard
attrmap: extend -remove to allow removing attributes with any value
Diffstat (limited to 'passes/techmap')
-rw-r--r--passes/techmap/attrmap.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/passes/techmap/attrmap.cc b/passes/techmap/attrmap.cc
index 0b5576b06..aa48e1125 100644
--- a/passes/techmap/attrmap.cc
+++ b/passes/techmap/attrmap.cc
@@ -111,9 +111,10 @@ struct AttrmapMap : AttrmapAction {
};
struct AttrmapRemove : AttrmapAction {
+ bool has_value;
string name, value;
bool apply(IdString &id, Const &val) YS_OVERRIDE {
- return !(match_name(name, id) && match_value(value, val));
+ return !(match_name(name, id) && (!has_value || match_value(value, val)));
}
};
@@ -235,6 +236,7 @@ struct AttrmapPass : public Pass {
}
auto action = new AttrmapRemove;
action->name = arg1;
+ action->has_value = (p != string::npos);
action->value = val1;
actions.push_back(std::unique_ptr<AttrmapAction>(action));
continue;