EECS-NTNU / bismo

BISMO: A Scalable Bit-Serial Matrix Multiplication Overlay for Reconfigurable Computing
BSD 3-Clause "New" or "Revised" License
131 stars 30 forks source link

compilation error #4

Closed HKLee2040 closed 5 years ago

HKLee2040 commented 5 years ago

Previous version works very well. Now, I want to test the latest version. However, when I run "PLATFORM=VerilatedTester make emu", I got the following error message

buildInfoPackage: Chisel, version: 2.2.39, scalaVersion: 2.11.11, sbtVersion: 0.13.16, builtAtString: 2018-04-18 17:37:17.153, builtAtMillis: 1524073037153

Writing template defines to /tmp/hls_syn_ExecAddrGen/ExecAddrGen_TemplateDefs.hpp [error] (run-main-0) java.io.IOException: Cannot run program "vivado_hls" (in directory "/tmp/hls_syn_ExecAddrGen"): error=2, No such file or directory java.io.IOException: Cannot run program "vivado_hls" (in directory "/tmp/hls_syn_ExecAddrGen"): error=2, No such file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at scala.sys.process.ProcessBuilderImpl$Simple.run(ProcessBuilderImpl.scala:69) at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.run(ProcessBuilderImpl.scala:100) at scala.sys.process.ProcessBuilderImpl$AbstractBuilder$$anonfun$runBuffered$1.apply(ProcessBuilderImpl.scala:148) at scala.sys.process.ProcessBuilderImpl$AbstractBuilder$$anonfun$runBuffered$1.apply(ProcessBuilderImpl.scala:148) at scala.sys.process.ProcessLogger$$anon$1.buffer(ProcessLogger.scala:99) at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.runBuffered(ProcessBuilderImpl.scala:148) at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$bang(ProcessBuilderImpl.scala:114) at fpgatidbits.hlstools.TidbitsHLSTools$.hlsToVerilog(HLSTools.scala:30) at fpgatidbits.TidbitsMakeUtils$$anonfun$makeHLSDependencies$1.apply(Main.scala:149) at fpgatidbits.TidbitsMakeUtils$$anonfun$makeHLSDependencies$1.apply(Main.scala:137) at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59) at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48) at fpgatidbits.TidbitsMakeUtils$.makeHLSDependencies(Main.scala:137) at bismo.Settings$.makeHLSDependencies(Main.scala:83) at bismo.HLSMain$.main(Main.scala:135) at bismo.HLSMain.main(Main.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) Caused by: java.io.IOException: error=2, No such file or directory at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.(UNIXProcess.java:247) at java.lang.ProcessImpl.start(ProcessImpl.java:134) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) at scala.sys.process.ProcessBuilderImpl$Simple.run(ProcessBuilderImpl.scala:69) at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.run(ProcessBuilderImpl.scala:100) at scala.sys.process.ProcessBuilderImpl$AbstractBuilder$$anonfun$runBuffered$1.apply(ProcessBuilderImpl.scala:148) at scala.sys.process.ProcessBuilderImpl$AbstractBuilder$$anonfun$runBuffered$1.apply(ProcessBuilderImpl.scala:148) at scala.sys.process.ProcessLogger$$anon$1.buffer(ProcessLogger.scala:99) at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.runBuffered(ProcessBuilderImpl.scala:148) at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$bang(ProcessBuilderImpl.scala:114) at fpgatidbits.hlstools.TidbitsHLSTools$.hlsToVerilog(HLSTools.scala:30) at fpgatidbits.TidbitsMakeUtils$$anonfun$makeHLSDependencies$1.apply(Main.scala:149) at fpgatidbits.TidbitsMakeUtils$$anonfun$makeHLSDependencies$1.apply(Main.scala:137) at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59) at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48) at fpgatidbits.TidbitsMakeUtils$.makeHLSDependencies(Main.scala:137) at bismo.Settings$.makeHLSDependencies(Main.scala:83) at bismo.HLSMain$.main(Main.scala:135) at bismo.HLSMain.main(Main.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) [trace] Stack trace suppressed: run 'last compile:runMain' for the full output. java.lang.RuntimeException: Nonzero exit code: 1 at scala.sys.package$.error(package.scala:27) [trace] Stack trace suppressed: run 'last compile:runMain' for the full output. [error] (compile:runMain) Nonzero exit code: 1 [error] Total time: 3 s, completed Jun 28, 2019 8:46:49 PM Makefile:127: recipe for target '/media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/hw/verilog/ExecInstrGen.v' failed make: *** [/media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/hw/verilog/ExecInstrGen.v] Error 1

maltanar commented 5 years ago

Hi @HKLee2040 , it seems as though you are missing some dependencies:

[error] (run-main-0) java.io.IOException: Cannot run program "vivado_hls" (in directory "/tmp/hls_syn_ExecAddrGen"): error=2, No such file or directory

BISMO requires you to have Vivado (which includes Vivado HLS) installed and available on PATH. Make sure you run /path/to/vivado/installation/settings64.sh before trying to compile BISMO.

HKLee2040 commented 5 years ago

@maltanar Thanks. It works. However, I met another error, could you help me?

=======> Driver written to BitSerialMatMulAccel.hpp [success] Total time: 3 s, completed Jun 28, 2019 9:37:11 PM mkdir -p /media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/deploy; \ mkdir -p /media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/deploy/driver; \ mkdir -p /media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/deploy/test; \ mkdir -p /media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/deploy/rtlib; \ mkdir -p /media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/deploy/hls_include; \ cp -rf /media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/hw/driver/ /media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/deploy/driver/; \ cp -rf /media/walker/DATA/work/bismo/new/bismo/src/main/resources/cpp/app/ /media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/deploy/test/; cp -rf /media/walker/DATA/work/bismo/new/bismo/src/main/resources/cpp/lib/ /media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/deploy/rtlib; \ cp -rf /media/walker/DATA/tools/Xilinx/Vivado/2017.4/bin/../include/ /media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/deploy/hls_include; mkdir -p /media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/deploy; cp -f /media/walker/DATA/work/bismo/new/bismo/src/main/script/VerilatedTester/target/ /media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/deploy/ cd /media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/deploy; \ sh compile_rtlib.sh; g++: error: verilog/verilated/.cpp: Not a directory platforms/VerilatedTester.mk:63: recipe for target '/media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/deploy/libbismo_rt.so' failed make: *** [/media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/deploy/libbismo_rt.so] Error 1

maltanar commented 5 years ago

To me it looks like you're still missing a dependency; the new version of BISMO also needs Verilator, have you installed it?

g++: error: verilog/verilated/*.cpp: Not a directory

On Ubuntu you should be able to do sudo apt-get install verilator and that should be enough. On other distributions, please see the Verilator website and modify the Verilator installation path on this line

HKLee2040 commented 5 years ago

I had installed verilator. Is it the right version?

verilator --version Verilator 3.874 2015-06-06 rev verilator_3_872-20-g0d43051

The path is the same as "/usr/share/verilator/include"

maltanar commented 5 years ago

OK, that version of Verilator should be recent enough. It seems as though Verilator is not working correctly. You could try doing a clean rebuild, or if that does not work either, can you do the following:

PLATFORM=VerilatedTester make /media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/deploy/verilog/verilated

and post the output here?

HKLee2040 commented 5 years ago

The output is very long. I only post the final output

[success] Total time: 87 s, completed Jun 28, 2019 10:25:12 PM mkdir -p /media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/deploy/verilog; \ cp -rf /media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/hw/verilog/ /media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/deploy/verilog; \ cp -rf /media/walker/DATA/work/bismo/new/bismo/fpga-tidbits/src/main/resources/verilog/ /media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/deploy/verilog; \ cd /media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/deploy/verilog; \ verilator -Iother-verilog --cc TesterWrapper.v -Wno-assignin -Wno-fatal -Wno-lint -Wno-style -Wno-COMBDLY -Wno-STMTDLY --Mdir verilated --trace; \ cp -rf /usr/share/verilator/include/verilated.cpp /media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/deploy/verilog/verilated; \ cp -rf /usr/share/verilator/include/verilated_vcd_c.cpp /media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/deploy/verilog/verilated; %Error-BLKLOOPINIT: Q_srl.v:195: Unsupported: Delayed assignment to array inside for loops (non-delayed is ok - see docs) %Error: Exiting due to 1 error(s) %Error: See the manual and http://www.veripool.org/verilator for more assistance. %Error: Command Failed /usr/bin/verilator_bin -Iother-verilog --cc TesterWrapper.v -Wno-assignin -Wno-fatal -Wno-lint -Wno-style -Wno-COMBDLY -Wno-STMTDLY --Mdir verilated --trace

If I change the command to be PLATFORM=VerilatedTester make all --> "all" instead of "emu" compilation is success

Should I use "all"?

maltanar commented 5 years ago

It actually looks like your Verilator version isn't able to correctly handle some of the sources, can you try with a newer version? I have Verilator 3.916 (which is what I get on Ubuntu 18.04 with apt-get) and I'm able to build without any errors.

make all doesn't do the compilation step (Verilog to C++ translation with Verilator) which is failing, so it won't solve the problem (you'd still have to run the compile_rtlib.sh script in the deployment folder after make all, and it will fail in the same way).

HKLee2040 commented 5 years ago

Yes, the problem is solved if I use verilator 3.912. But... new error message occurs: Is it libgmp issue? Which version do you use?

sh compile_rtlib.sh; In file included from ./hls_include/gmp.h:53:0, from ./hls_include/floating_point_v7_0_bitacc_cmodel.h:143, from ./hls_include/hls_fpo.h:172, from ./hls_include/hls_half.h:57, from ./hls_include/ap_int.h:74, from rtlib/BISMOInstruction.hpp:35, from rtlib/BISMOInstruction.cpp:32: /usr/include/c++/5/cstddef:51:11: error: ‘::max_align_t’ has not been declared using ::max_align_t; ^ In file included from rtlib/BitSerialMatMulAccelDriver.hpp:42:0, from rtlib/bismo_rt_internal.hpp:35, from rtlib/bismo_rt.cpp:32: ./test/gemmbitserial/gemmbitserial.hpp:509:2: warning: #warning "Compiling using generic popcount" [-Wcpp]

warning "Compiling using generic popcount"

^ In file included from ./hls_include/gmp.h:53:0, from ./hls_include/floating_point_v7_0_bitacc_cmodel.h:143, from ./hls_include/hls_fpo.h:172, from ./hls_include/hls_half.h:57, from ./hls_include/ap_int.h:74, from rtlib/BISMOInstruction.hpp:35, from rtlib/BitSerialMatMulAccelDriver.hpp:44, from rtlib/bismo_rt_internal.hpp:35, from rtlib/bismo_rt.cpp:32: /usr/include/c++/5/cstddef:51:11: error: ‘::max_align_t’ has not been declared using ::max_align_t; ^ rtlib/bismo_rt.cpp: In function ‘void bismo_rt::deinit()’: rtlib/bismo_rt.cpp:60:41: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] platform->deallocAccelBuffer((void *) accel_p2s_bitpar_buffer); ^ In file included from rtlib/BitSerialMatMulAccelDriver.hpp:42:0, from rtlib/bismo_rt_internal.hpp:35, from rtlib/bismo_rt_instrumentation.cpp:32: ./test/gemmbitserial/gemmbitserial.hpp:509:2: warning: #warning "Compiling using generic popcount" [-Wcpp]

warning "Compiling using generic popcount"

^ In file included from ./hls_include/gmp.h:53:0, from ./hls_include/floating_point_v7_0_bitacc_cmodel.h:143, from ./hls_include/hls_fpo.h:172, from ./hls_include/hls_half.h:57, from ./hls_include/ap_int.h:74, from rtlib/BISMOInstruction.hpp:35, from rtlib/BitSerialMatMulAccelDriver.hpp:44, from rtlib/bismo_rt_internal.hpp:35, from rtlib/bismo_rt_instrumentation.cpp:32: /usr/include/c++/5/cstddef:51:11: error: ‘::max_align_t’ has not been declared using ::max_align_t; ^ In file included from rtlib/BitSerialMatMulAccelDriver.hpp:42:0, from rtlib/bismo_rt_internal.hpp:35, from rtlib/bismo_rt_matmul.hpp:35, from rtlib/bismo_rt_matmul.cpp:32: ./test/gemmbitserial/gemmbitserial.hpp:509:2: warning: #warning "Compiling using generic popcount" [-Wcpp]

warning "Compiling using generic popcount"

^ In file included from ./hls_include/gmp.h:53:0, from ./hls_include/floating_point_v7_0_bitacc_cmodel.h:143, from ./hls_include/hls_fpo.h:172, from ./hls_include/hls_half.h:57, from ./hls_include/ap_int.h:74, from rtlib/BISMOInstruction.hpp:35, from rtlib/BitSerialMatMulAccelDriver.hpp:44, from rtlib/bismo_rt_internal.hpp:35, from rtlib/bismo_rt_matmul.hpp:35, from rtlib/bismo_rt_matmul.cpp:32: /usr/include/c++/5/cstddef:51:11: error: ‘::max_align_t’ has not been declared using ::max_align_t; ^ In file included from rtlib/BitSerialMatMulAccelDriver.hpp:42:0, from rtlib/bismo_rt_internal.hpp:35, from rtlib/bismo_rt_matmul.hpp:35, from rtlib/bismo_rt_matmul_api.cpp:32: ./test/gemmbitserial/gemmbitserial.hpp:509:2: warning: #warning "Compiling using generic popcount" [-Wcpp]

warning "Compiling using generic popcount"

^ In file included from ./hls_include/gmp.h:53:0, from ./hls_include/floating_point_v7_0_bitacc_cmodel.h:143, from ./hls_include/hls_fpo.h:172, from ./hls_include/hls_half.h:57, from ./hls_include/ap_int.h:74, from rtlib/BISMOInstruction.hpp:35, from rtlib/BitSerialMatMulAccelDriver.hpp:44, from rtlib/bismo_rt_internal.hpp:35, from rtlib/bismo_rt_matmul.hpp:35, from rtlib/bismo_rt_matmul_api.cpp:32: /usr/include/c++/5/cstddef:51:11: error: ‘::max_align_t’ has not been declared using ::max_align_t; ^ In file included from rtlib/bismo_rt_matmul.hpp:36:0, from rtlib/bismo_rt_matmul_api.cpp:32: rtlib/bismo_rt_matrix.hpp: In instantiation of ‘bismo_rt::Matrix::~Matrix() [with T = unsigned char]’: rtlib/bismo_rt_matmul_api.cpp:126:14: required from here rtlib/bismo_rt_matrix.hpp:125:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] platform->deallocAccelBuffer((void ) m_bitserial_accelbuf); ^ rtlib/bismo_rt_matrix.hpp: In instantiation of ‘bismo_rt::Matrix::~Matrix() [with T = int]’: rtlib/bismo_rt_matmul_api.cpp:128:14: required from here rtlib/bismo_rt_matrix.hpp:125:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] In file included from rtlib/bismo_rt_matrix.hpp:38:0, from rtlib/bismo_rt_matmul.hpp:36, from rtlib/bismo_rt_matmul_api.cpp:32: rtlib/bismo_rt_shared_buffer.hpp: In instantiation of ‘bismo_rt::SharedBuffer::SharedBuffer(size_t, WrapperRegDriver, std::cxx11::string, bool, bool) [with T = unsigned char; size_t = long unsigned int; std::cxx11::string = std::cxx11::basic_string]’: rtlib/bismo_rt_matrix.hpp:98:18: required from ‘bismo_rt::Matrix::Matrix(size_t, size_t, size_t, bool, bool, bismo_rt::MatrixType, std::__cxx11::string, bool) [with T = unsigned char; size_t = long unsigned int; std::cxx11::string = std::cxx11::basic_string]’ rtlib/bismo_rt_matmul_api.cpp:46:3: required from here rtlib/bismo_rt_shared_buffer.hpp:59:44: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] m_hostbuf = (T ) platform->phys2virt((void ) m_accelbuf); ^ rtlib/bismo_rt_shared_buffer.hpp: In instantiation of ‘bismo_rt::SharedBuffer::SharedBuffer(size_t, WrapperRegDriver*, std::cxx11::string, bool, bool) [with T = int; size_t = long unsigned int; std::cxx11::string = std::cxx11::basic_string]’: rtlib/bismo_rt_matrix.hpp:98:18: required from ‘bismo_rt::Matrix::Matrix(size_t, size_t, size_t, bool, bool, bismo_rt::MatrixType, std::__cxx11::string, bool) [with T = int; size_t = long unsigned int; std::cxx11::string = std::cxx11::basic_string]’ rtlib/bismo_rt_matmul_api.cpp:52:3: required from here rtlib/bismo_rt_shared_buffer.hpp:59:44: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] rtlib/bismo_rt_shared_buffer.hpp: In instantiation of ‘void bismo_rt::SharedBuffer::host2accel() [with T = unsigned char]’: rtlib/bismo_rt_matrix.hpp:207:5: required from ‘void bismo_rt::Matrix::host2accel() [with T = unsigned char]’ rtlib/bismo_rt_matmul_api.cpp:103:25: required from here rtlib/bismo_rt_shared_buffer.hpp:89:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] m_platform->copyBufferHostToAccel( ^ In file included from rtlib/bismo_rt_matmul.hpp:36:0, from rtlib/bismo_rt_matmul_api.cpp:32: rtlib/bismo_rt_matrix.hpp: In instantiation of ‘uint32_t bismo_rt::Matrix::p2s() [with T = unsigned char; uint32_t = unsigned int]’: rtlib/bismo_rt_matrix.hpp:213:10: required from ‘void bismo_rt::Matrix::host2accel() [with T = unsigned char]’ rtlib/bismo_rt_matmul_api.cpp:103:25: required from here rtlib/bismo_rt_matrix.hpp:264:5: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] acc->setup_p2s( ^ rtlib/bismo_rt_matrix.hpp:264:5: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] In file included from rtlib/bismo_rt_matrix.hpp:38:0, from rtlib/bismo_rt_matmul.hpp:36, from rtlib/bismo_rt_matmul_api.cpp:32: rtlib/bismo_rt_shared_buffer.hpp: In instantiation of ‘void bismo_rt::SharedBuffer::accel2host() [with T = int]’: rtlib/bismo_rt_matrix.hpp:177:5: required from ‘void bismo_rt::Matrix::accel2host() [with T = int]’ rtlib/bismo_rt_matmul_api.cpp:121:25: required from here rtlib/bismo_rt_shared_buffer.hpp:76:7: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] m_platform->copyBufferAccelToHost( ^ rtlib/bismo_rt_shared_buffer.hpp: In instantiation of ‘bismo_rt::SharedBuffer::~SharedBuffer() [with T = unsigned char]’: rtlib/bismo_rt_matrix.hpp:120:5: required from ‘bismo_rt::Matrix::~Matrix() [with T = unsigned char]’ rtlib/bismo_rt_matmul_api.cpp:126:14: required from here rtlib/bismo_rt_shared_buffer.hpp:66:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] m_platform->deallocAccelBuffer((void *) m_accelbuf); ^ rtlib/bismo_rt_shared_buffer.hpp: In instantiation of ‘bismo_rt::SharedBuffer::~SharedBuffer() [with T = int]’: rtlib/bismo_rt_matrix.hpp:120:5: required from ‘bismo_rt::Matrix::~Matrix() [with T = int]’ rtlib/bismo_rt_matmul_api.cpp:128:14: required from here rtlib/bismo_rt_shared_buffer.hpp:66:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] In file included from rtlib/BitSerialMatMulAccelDriver.hpp:42:0, from rtlib/bismo_rt_internal.hpp:35, from rtlib/bismo_rt_p2s.cpp:32: ./test/gemmbitserial/gemmbitserial.hpp:509:2: warning: #warning "Compiling using generic popcount" [-Wcpp]

warning "Compiling using generic popcount"

^ In file included from ./hls_include/gmp.h:53:0, from ./hls_include/floating_point_v7_0_bitacc_cmodel.h:143, from ./hls_include/hls_fpo.h:172, from ./hls_include/hls_half.h:57, from ./hls_include/ap_int.h:74, from rtlib/BISMOInstruction.hpp:35, from rtlib/BitSerialMatMulAccelDriver.hpp:44, from rtlib/bismo_rt_internal.hpp:35, from rtlib/bismo_rt_p2s.cpp:32: /usr/include/c++/5/cstddef:51:11: error: ‘::max_align_t’ has not been declared using ::max_align_t; ^ rtlib/bismo_rt_p2s.cpp: In function ‘void bismo_rt::p2s(const uint8_t, uint32_t, size_t, size_t, size_t, bool, bool, size_t)’: rtlib/bismo_rt_p2s.cpp:86:75: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] platform->copyBufferHostToAccel((void )host_p2s_bitpar_buffer, (void )accel_p2s_bitpar_buffer, nbytes_bitpar_aligned); ^ rtlib/bismo_rt_p2s.cpp:89:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] (void )accel_p2s_bitpar_buffer, // source buffer ^ rtlib/bismo_rt_p2s.cpp:91:14: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] (void ) accel_buf_dst, // dest buffer ^ rtlib/bismo_rt_p2s.cpp: In function ‘bool bismo_rt::selftest_p2s()’: rtlib/bismo_rt_p2s.cpp:128:51: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] platform->copyBufferAccelToHost((void )accel_buf, accel_mat_bs, nbytes_bitser); ^ rtlib/bismo_rt_p2s.cpp:139:48: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] platform->deallocAccelBuffer((void *)accel_buf); ^ In file included from rtlib/BitSerialMatMulAccelDriver.hpp:42:0, from rtlib/bismo_rt_internal.hpp:35, from rtlib/bismo_rt_test.cpp:32: ./test/gemmbitserial/gemmbitserial.hpp:509:2: warning: #warning "Compiling using generic popcount" [-Wcpp]

warning "Compiling using generic popcount"

^ In file included from ./hls_include/gmp.h:53:0, from ./hls_include/floating_point_v7_0_bitacc_cmodel.h:143, from ./hls_include/hls_fpo.h:172, from ./hls_include/hls_half.h:57, from ./hls_include/ap_int.h:74, from rtlib/BISMOInstruction.hpp:35, from rtlib/BitSerialMatMulAccelDriver.hpp:44, from rtlib/bismo_rt_internal.hpp:35, from rtlib/bismo_rt_test.cpp:32: /usr/include/c++/5/cstddef:51:11: error: ‘::max_align_t’ has not been declared using ::max_align_t; ^ In file included from rtlib/bismo_rt_matrix.hpp:38:0, from rtlib/bismo_rt_test.cpp:33: rtlib/bismo_rt_shared_buffer.hpp: In instantiation of ‘bismo_rt::SharedBuffer::SharedBuffer(size_t, WrapperRegDriver, std::__cxx11::string, bool, bool) [with T = int; size_t = long unsigned int; std::cxx11::string = std::cxx11::basic_string]’: rtlib/bismo_rt_test.cpp:46:3: required from here rtlib/bismo_rt_shared_buffer.hpp:59:44: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] m_hostbuf = (T ) platform->phys2virt((void ) m_accelbuf); ^ rtlib/bismo_rt_shared_buffer.hpp: In instantiation of ‘bool bismo_rt::SharedBuffer::compare() [with T = int]’: rtlib/bismo_rt_test.cpp:54:27: required from here rtlib/bismo_rt_shared_buffer.hpp:106:5: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] m_platform->copyBufferAccelToHost( ^ rtlib/bismo_rt_shared_buffer.hpp: In instantiation of ‘void bismo_rt::SharedBuffer::host2accel() [with T = int]’: rtlib/bismo_rt_test.cpp:56:19: required from here rtlib/bismo_rt_shared_buffer.hpp:89:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] m_platform->copyBufferHostToAccel( ^ rtlib/bismo_rt_shared_buffer.hpp: In instantiation of ‘bismo_rt::SharedBuffer::~SharedBuffer() [with T = int]’: rtlib/bismo_rt_test.cpp:59:10: required from here rtlib/bismo_rt_shared_buffer.hpp:66:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] m_platform->deallocAccelBuffer((void ) m_accelbuf); ^ In file included from rtlib/bismo_rt_test.cpp:33:0: rtlib/bismo_rt_matrix.hpp: In instantiation of ‘bismo_rt::Matrix::~Matrix() [with T = int]’: rtlib/bismo_rt_test.cpp:99:18: required from here rtlib/bismo_rt_matrix.hpp:125:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] platform->deallocAccelBuffer((void ) m_bitserial_accelbuf); ^ rtlib/bismo_rt_matrix.hpp: In instantiation of ‘bismo_rt::Matrix::~Matrix() [with T = unsigned char]’: rtlib/bismo_rt_test.cpp:125:18: required from here rtlib/bismo_rt_matrix.hpp:125:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] rtlib/bismo_rt_matrix.hpp: In instantiation of ‘uint32_t bismo_rt::Matrix::p2s() [with T = int; uint32_t = unsigned int]’: rtlib/bismo_rt_matrix.hpp:213:10: required from ‘void bismo_rt::Matrix::host2accel() [with T = int]’ rtlib/bismo_rt_test.cpp:85:28: required from here rtlib/bismo_rt_matrix.hpp:264:5: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] acc->setup_p2s( ^ rtlib/bismo_rt_matrix.hpp:264:5: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] In file included from rtlib/bismo_rt_matrix.hpp:38:0, from rtlib/bismo_rt_test.cpp:33: rtlib/bismo_rt_shared_buffer.hpp: In instantiation of ‘void bismo_rt::SharedBuffer::accel2host() [with T = int]’: rtlib/bismo_rt_matrix.hpp:177:5: required from ‘void bismo_rt::Matrix::accel2host() [with T = int]’ rtlib/bismo_rt_test.cpp:95:28: required from here rtlib/bismo_rt_shared_buffer.hpp:76:7: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] m_platform->copyBufferAccelToHost( ^ rtlib/bismo_rt_shared_buffer.hpp: In instantiation of ‘bismo_rt::SharedBuffer::SharedBuffer(size_t, WrapperRegDriver, std::cxx11::string, bool, bool) [with T = unsigned char; size_t = long unsigned int; std::cxx11::string = std::cxx11::basic_string]’: rtlib/bismo_rt_matrix.hpp:98:18: required from ‘bismo_rt::Matrix::Matrix(size_t, size_t, size_t, bool, bool, bismo_rt::MatrixType, std::__cxx11::string, bool) [with T = unsigned char; size_t = long unsigned int; std::cxx11::string = std::__cxx11::basic_string]’ rtlib/bismo_rt_test.cpp:103:11: required from here rtlib/bismo_rt_shared_buffer.hpp:59:44: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] m_hostbuf = (T ) platform->phys2virt((void ) m_accelbuf); ^ rtlib/bismo_rt_shared_buffer.hpp: In instantiation of ‘void bismo_rt::SharedBuffer::host2accel() [with T = unsigned char]’: rtlib/bismo_rt_matrix.hpp:207:5: required from ‘void bismo_rt::Matrix::host2accel() [with T = unsigned char]’ rtlib/bismo_rt_test.cpp:111:28: required from here rtlib/bismo_rt_shared_buffer.hpp:89:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] m_platform->copyBufferHostToAccel( ^ In file included from rtlib/bismo_rt_test.cpp:33:0: rtlib/bismo_rt_matrix.hpp: In instantiation of ‘uint32_t bismo_rt::Matrix::p2s() [with T = unsigned char; uint32_t = unsigned int]’: rtlib/bismo_rt_matrix.hpp:213:10: required from ‘void bismo_rt::Matrix::host2accel() [with T = unsigned char]’ rtlib/bismo_rt_test.cpp:111:28: required from here rtlib/bismo_rt_matrix.hpp:264:5: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] acc->setup_p2s( ^ rtlib/bismo_rt_matrix.hpp:264:5: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] In file included from rtlib/bismo_rt_matrix.hpp:38:0, from rtlib/bismo_rt_test.cpp:33: rtlib/bismo_rt_shared_buffer.hpp: In instantiation of ‘void bismo_rt::SharedBuffer::accel2host() [with T = unsigned char]’: rtlib/bismo_rt_matrix.hpp:177:5: required from ‘void bismo_rt::Matrix::accel2host() [with T = unsigned char]’ rtlib/bismo_rt_test.cpp:121:28: required from here rtlib/bismo_rt_shared_buffer.hpp:76:7: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] m_platform->copyBufferAccelToHost( ^ rtlib/bismo_rt_shared_buffer.hpp: In instantiation of ‘bismo_rt::SharedBuffer::~SharedBuffer() [with T = unsigned char]’: rtlib/bismo_rt_matrix.hpp:120:5: required from ‘bismo_rt::Matrix::~Matrix() [with T = unsigned char]’ rtlib/bismo_rt_test.cpp:125:18: required from here rtlib/bismo_rt_shared_buffer.hpp:66:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] m_platform->deallocAccelBuffer((void *) m_accelbuf); ^ In file included from driver/verilatedtesterdriver.hpp:8:0, from driver/platform-verilatedtester.cpp:5: verilog/verilated/VTesterWrapper.h:11:23: fatal error: verilated.h: No such file or directory compilation terminated. In file included from verilog/verilated/VTesterWrapper.cpp:5:0: verilog/verilated/VTesterWrapper.h:11:23: fatal error: verilated.h: No such file or directory compilation terminated. In file included from verilog/verilated/VTesterWrapperSyms.cpp:4:0: verilog/verilated/VTesterWrapperSyms.h:9:23: fatal error: verilated.h: No such file or directory compilation terminated. verilog/verilated/VTesterWrapperTrace.cpp:3:29: fatal error: verilated_vcd_c.h: No such file or directory compilation terminated. verilog/verilated/VTesterWrapperTrace__Slow.cpp:3:29: fatal error: verilated_vcd_c.h: No such file or directory compilation terminated. verilog/verilated/verilated.cpp:27:27: fatal error: verilated_imp.h: No such file or directory compilation terminated. verilog/verilated/verilated_vcd_c.cpp:23:25: fatal error: verilatedos.h: No such file or directory compilation terminated. platforms/VerilatedTester.mk:63: recipe for target '/media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/deploy/libbismo_rt.so' failed make: *** [/media/walker/DATA/work/bismo/new/bismo/build/2x64x2/VerilatedTester/deploy/libbismo_rt.so] Error 1

maltanar commented 5 years ago

I've not had this issue and I would guess this is some toolchain version difference. If you prefer to use Docker, there is a Dockerfile under the repo root in the dev branch, which should not have any of these build issues.

If you don't want to use Docker, I had a look at the the error message you are getting, and this issue seems related, and the suggested solution is to add #include <cstddef> before any HLS includes. For BISMO if you add that to the beginning of BISMOInstruction.hpp it might be enough to propagate to all the HLS files.

HKLee2040 commented 5 years ago

@maltanar Yes, I add #include to the beginning of BISMOInstruction.hpp, the problem is sovled. All tests passed successfully.

Thanks!