Building Spike simulator for RISC-V


I am trying to build toolchain for RISC-V Spike simulator. I use the repository Here while building openocd, i get following error

: not founder/ 2: …/src/helper/
: not founder/ 5: …/src/helper/ echo
make: *** [src/] Error 1

Is the file src/startup_tcl.h created ?. Build.log has following output error

cat …/src/helper/startup.tcl …/src/jtag/startup.tcl …/src/target/startup.tcl …/src/server/startup.tcl …/src/flash/startup.tcl | …/src/helper/ > src/ || { rm -f src/; false; }
Makefile:4659: recipe for target ‘src/’ failed

Any idea what is the error here ?

The error message looks corrupted, so not clear what happened. Try debugging this. Do the …/src/* files all exist? What happens if you run the …/src/helper/ script by hand? It looks like it could be a problem with /bin/sh which is odd. What system are you building on? Linux? mingw?

Hi Ji

I could resolve this error. There was a line ending conversion needed for shell script. But now while building ISA, i am getting following error in the file riscv/ in the function
string dts_compile(const string&). The error is

…/riscv/ In function ‘std::__cxx11::string dts_compile(const string&)’:
…/riscv/ error: ‘DTC’ was not declared in this scope
execlp(DTC, DTC, “-O”, “dtb”, 0);
…/riscv/ error: expected ‘;’ before ‘DTC’
std::cerr << "Failed to run " DTC ": " << strerror(errno) << std::endl;

I have installed device-tree -compiler already, the version is 1.4.5-3. Basically i have entered some error condition i guess ? what is this DTC here ? is this some kind of macro?

I have attached the snapshot of build log of ISA simulator, and also the my ubuntu terminal snapshot (to know current status).

Can u please help me here ?

DTC is set by the configure script to the full pathname for the device tree compiler. This definition goes into config.h in the build tree. I have
/* Path to the device-tree-compiler */
#define DTC “/usr/bin/dtc”

The configure script will give an error if the device tree compiler is not found at configure time. The build script is simple and stupid though, and doesn’t check for configure errors, so it will go ahead and run make even though it won’t work.

If you installed the device tree compiler after running configure, then you will need to configure again, or rm -rf the build tree and rebuild from scratch.