Skip to content

Commit

Permalink
Merge pull request chipsalliance#3915 from alainmarcel/alainmarcel-pa…
Browse files Browse the repository at this point in the history
…tch-1

Repair -lowmem in the context of read_systemverilog yosys command
  • Loading branch information
alaindargelas authored Oct 26, 2023
2 parents c742271 + 0d84478 commit eb3e943
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 eb3e943

Please sign in to comment.