Add support for `resetall compiler directive

This commit is contained in:
Clifford Wolf 2017-04-26 16:09:32 +02:00
parent b72a7e1104
commit f0db8ffdbc
1 changed files with 7 additions and 0 deletions

View File

@ -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());