Skip to content

Commit

Permalink
Fix include, library file order issue
Browse files Browse the repository at this point in the history
  • Loading branch information
alaindargelas committed Oct 3, 2024
1 parent e1992e6 commit d2794ac
Showing 1 changed file with 37 additions and 37 deletions.
74 changes: 37 additions & 37 deletions src/Compiler/CompilerOpenFPGA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1720,6 +1720,43 @@ std::string CompilerOpenFPGA::YosysDesignParsingCommmands() {
}

std::string designFiles = macros;
for (const auto& lang_file : ProjManager()->DesignFiles()) {
std::string filesScript =
"read_verilog ${READ_VERILOG_OPTIONS} ${INCLUDE_PATHS} "
"${VERILOG_FILES}";
std::string lang;

auto files = lang_file.second + " ";
switch (lang_file.first.language) {
case Design::Language::VHDL_1987:
case Design::Language::VHDL_1993:
case Design::Language::VHDL_2000:
case Design::Language::VHDL_2008:
case Design::Language::VHDL_2019:
ErrorMessage("Unsupported language (Yosys default parser)");
break;
case Design::Language::VERILOG_1995:
case Design::Language::VERILOG_2001:
case Design::Language::SYSTEMVERILOG_2005:
break;
case Design::Language::SYSTEMVERILOG_2009:
case Design::Language::SYSTEMVERILOG_2012:
case Design::Language::SYSTEMVERILOG_2017:
lang = "-sv";
break;
case Design::Language::VERILOG_NETLIST:
break;
case Design::Language::BLIF:
case Design::Language::EBLIF:
ErrorMessage("Unsupported language (Yosys default parser)");
break;
}
filesScript = ReplaceAll(filesScript, "${READ_VERILOG_OPTIONS}", lang);
filesScript = ReplaceAll(filesScript, "${INCLUDE_PATHS}", includes);
filesScript = ReplaceAll(filesScript, "${VERILOG_FILES}", files);
designFiles += filesScript + "\n";
}

for (auto path : ProjManager()->libraryPathList()) {
std::filesystem::path libPath =
FileUtils::AdjustPath(path, ProjManager()->projectPath());
Expand Down Expand Up @@ -1765,43 +1802,6 @@ std::string CompilerOpenFPGA::YosysDesignParsingCommmands() {
}
}

for (const auto& lang_file : ProjManager()->DesignFiles()) {
std::string filesScript =
"read_verilog ${READ_VERILOG_OPTIONS} ${INCLUDE_PATHS} "
"${VERILOG_FILES}";
std::string lang;

auto files = lang_file.second + " ";
switch (lang_file.first.language) {
case Design::Language::VHDL_1987:
case Design::Language::VHDL_1993:
case Design::Language::VHDL_2000:
case Design::Language::VHDL_2008:
case Design::Language::VHDL_2019:
ErrorMessage("Unsupported language (Yosys default parser)");
break;
case Design::Language::VERILOG_1995:
case Design::Language::VERILOG_2001:
case Design::Language::SYSTEMVERILOG_2005:
break;
case Design::Language::SYSTEMVERILOG_2009:
case Design::Language::SYSTEMVERILOG_2012:
case Design::Language::SYSTEMVERILOG_2017:
lang = "-sv";
break;
case Design::Language::VERILOG_NETLIST:
break;
case Design::Language::BLIF:
case Design::Language::EBLIF:
ErrorMessage("Unsupported language (Yosys default parser)");
break;
}
filesScript = ReplaceAll(filesScript, "${READ_VERILOG_OPTIONS}", lang);
filesScript = ReplaceAll(filesScript, "${INCLUDE_PATHS}", includes);
filesScript = ReplaceAll(filesScript, "${VERILOG_FILES}", files);

designFiles += filesScript + "\n";
}
return designFiles;
}

Expand Down

0 comments on commit d2794ac

Please sign in to comment.