Skip to content

Commit 6d4db3e

Browse files
committed
Fix simulation elf relative path
1 parent 9d7f282 commit 6d4db3e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/wrapper/simulation/SimulationTool.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,12 @@ std::string SimulationTool::GenerateSimulationScript(const std::string& top_file
316316

317317
if(has_user_elf)
318318
{
319-
script << "SYS_ELF=\"" << Param->getOption<std::string>(OPT_testbench_input_file).substr(4) << "\"\n";
319+
std::filesystem::path elf_path(Param->getOption<std::string>(OPT_testbench_input_file).substr(4));
320+
if(!elf_path.is_absolute() && elf_path.parent_path() != ".")
321+
{
322+
elf_path = std::filesystem::path(".") / elf_path;
323+
}
324+
script << "SYS_ELF=" << elf_path << "\n";
320325
}
321326
else
322327
{

0 commit comments

Comments
 (0)