aboutsummaryrefslogtreecommitdiffstats
path: root/frontends
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2017-04-26 16:09:32 +0200
committerClifford Wolf <clifford@clifford.at>2017-04-26 16:09:41 +0200
commitf0db8ffdbcd64560739639dfde078c14f9939604 (patch)
tree6cd03dd9069784e0125fec1ed3d29825dac7380f /frontends
parentb72a7e1104554dc8a8ca5e1557be36828f0a959b (diff)
downloadyosys-f0db8ffdbcd64560739639dfde078c14f9939604.tar.gz
yosys-f0db8ffdbcd64560739639dfde078c14f9939604.tar.bz2
yosys-f0db8ffdbcd64560739639dfde078c14f9939604.zip
Add support for `resetall compiler directive
Diffstat (limited to 'frontends')
-rw-r--r--frontends/verilog/preproc.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/frontends/verilog/preproc.cc b/frontends/verilog/preproc.cc
index 41b5eac19..cf220fef9 100644
--- a/frontends/verilog/preproc.cc
+++ b/frontends/verilog/preproc.cc
@@ -438,6 +438,13 @@ std::string frontend_verilog_preproc(std::istream &f, std::string filename, cons
continue;
}
+ if (tok == "`resetall") {
+ defines_map.clear();
+ defines_with_args.clear();
+ global_defines_cache.clear();
+ continue;
+ }
+
if (tok.size() > 1 && tok[0] == '`' && defines_map.count(tok.substr(1)) > 0) {
std::string name = tok.substr(1);
// printf("expand: >>%s<< -> >>%s<<\n", name.c_str(), defines_map[name].c_str());