Skip to content

Commit

Permalink
Define SYNTHESIS earlier and in both, support ignored module specific…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
akashlevy committed May 17, 2024
1 parent a94cd0b commit 60e598b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions frontends/verific/verific.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3394,8 +3394,13 @@ struct VerificPass : public Pass {
unsigned verilog_mode = veri_file::SYSTEM_VERILOG;
const char* arg = args[argidx].c_str();

// Define macros
hdl_file_sort::DefineMacro("SYNTHESIS");
veri_file::DefineMacro("SYNTHESIS");

// Ignore translate_off statements
hdl_file_sort::SetIgnoreTranslateOff(0);
veri_file::SetIgnoreTranslateOff(0);

// Treat .v as SystemVerilog too (overriding default behavior to treat it as VERILOG_2000)
hdl_file_sort::RemoveFileExt(".v");
Expand Down Expand Up @@ -3468,6 +3473,12 @@ struct VerificPass : public Pass {
log("AUTO-DISCOVER: registered file %s from .f file processing\n", file_name);
}
delete file_names;
} else if (args[argidx] == "-i") {
const char *ignore_module = args[++argidx].c_str();
log("AUTO-DISCOVER: ignoring module %s\n", ignore_module);
veri_file::AddToIgnoredModuleNames(ignore_module);
veri_file::AddToIgnoredParsedModuleNames(ignore_module);
hdl_file_sort::RegisterIgnoreUnitName(ignore_module);
} else {
veri_file::AddIncludeDir(args[argidx].c_str());
if (!hdl_file_sort::RegisterDir(args[argidx].c_str())) {
Expand All @@ -3478,11 +3489,6 @@ struct VerificPass : public Pass {
}
}

// Define macros
hdl_file_sort::DefineMacro("YOSYS");
hdl_file_sort::DefineMacro("VERIFIC");
hdl_file_sort::DefineMacro("SYNTHESIS");

// Analyze discovered/sorted files
if (!analyze_function(veri_file::MFCU)) {
verific_error_msg.clear();
Expand Down
2 changes: 1 addition & 1 deletion verific

0 comments on commit 60e598b

Please sign in to comment.