Skip to content

Commit

Permalink
Bitstream simulation fix (#1482)
Browse files Browse the repository at this point in the history
* Bitstream simulation fix

* Incremented patch version

---------

Co-authored-by: alaindargelas <alaindargelas@users.noreply.github.com>
  • Loading branch information
alaindargelas and alaindargelas authored Feb 27, 2024
1 parent 215cc8a commit 4128cc8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ set(VERSION_MINOR 0)
# Add the spdlog directory to the include path
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third_party/spdlog/include ${CMAKE_CURRENT_SOURCE_DIR}/third_party/exprtk)

set(VERSION_PATCH 321)
set(VERSION_PATCH 322)

option(
WITH_LIBCXX
Expand Down
30 changes: 29 additions & 1 deletion src/Simulation/Simulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1157,10 +1157,20 @@ bool Simulator::SimulateBitstream(SimulationType sim_type, SimulatorType type) {
Message("##################################################");
Message("Bitstream simulation for design: " + ProjManager()->projectName());
Message("##################################################");

#ifdef PRODUCTION_BUILD
ErrorMessage("Bitstream simulation is not available in production build");
return false;
#endif
std::string fileList =
LanguageDirective(type, Design::Language::SYSTEMVERILOG_2012);

std::filesystem::path path = std::filesystem::path(
std::filesystem::path("..") / "bitstream" / "BIT_SIM" / "sub_module");
for (const std::filesystem::path& entry :
std::filesystem::directory_iterator(path)) {
fileList += std::string(" ") + entry.string();
}

if (sim_type == SimulationType::BitstreamBackDoor) {
fileList += std::string(" ") +
std::filesystem::path(std::filesystem::path("..") /
Expand Down Expand Up @@ -1202,6 +1212,24 @@ bool Simulator::SimulateBitstream(SimulationType sim_type, SimulatorType type) {
" ";
}

fileList += std::string(" ") + LibraryPathDirective(type) +
std::filesystem::path(std::filesystem::path("..") / "bitstream" /
"BIT_SIM")
.string() +
" ";

fileList += std::string(" ") + LibraryPathDirective(type) +
std::filesystem::path(std::filesystem::path("..") / "bitstream" /
"BIT_SIM" / "lb")
.string() +
" ";

fileList += std::string(" ") + LibraryPathDirective(type) +
std::filesystem::path(std::filesystem::path("..") / "bitstream" /
"BIT_SIM" / "routing")
.string() +
" ";

for (auto ext : ProjManager()->libraryExtensionList()) {
fileList += std::string(" ") + LibraryExtDirective(type) + ext + " ";
}
Expand Down

0 comments on commit 4128cc8

Please sign in to comment.