Skip to content

Commit

Permalink
Repair -lowmem in read_systemverilog yosys command
Browse files Browse the repository at this point in the history
  • Loading branch information
alaindargelas committed Oct 26, 2023
1 parent c742271 commit 0d84478
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/CommandLine/CommandLineParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -754,8 +754,18 @@ void CommandLineParser::processOutputDirectory_(

bool CommandLineParser::parseCommandLine(int32_t argc, const char** argv) {
FileSystem* const fileSystem = FileSystem::getInstance();
m_programId = fileSystem->getProgramFile(argv[0], m_symbolTable);

std::string pname = argv[0];
if (pname == "read_systemverilog") {
// When surelog is embedded as a plugin in yosys, the program name is
// "read_systemverilog", which breaks the -lowmem option
pname = "surelog";
std::filesystem::path programPath = fileSystem->getProgramPath();
programPath = programPath.parent_path();
programPath = programPath / pname;
m_programId = fileSystem->toPathId(programPath.c_str(), m_symbolTable);
} else {
m_programId = fileSystem->getProgramFile(pname, m_symbolTable);
}
std::vector<std::string> cmd_line;
for (int32_t i = 1; i < argc; i++) {
cmd_line.emplace_back(undecorateArg(argv[i]));
Expand Down

0 comments on commit 0d84478

Please sign in to comment.