ispras / utopia-hls

Utopia: a High-Level Synthesis framework
Apache License 2.0
7 stars 1 forks source link

DFCxx.Polynomial2AddInt2MulInt3Asap falling #32

Closed ssmolov closed 3 months ago

ssmolov commented 3 months ago

I've built the project as follows (sorry for absolute paths):

rm -rf build

cmake -S . -B build -G Ninja -DCMAKE_PREFIX_PATH="/home/ssedai/sources/circt.git/build;/home/ssedai/sources/circt.git/llvm/build" -DSRC_FILES="~/projects/utopia-hls/examples/polynomial2/polynomial2.cpp" -DBUILD_TESTS=ON

cmake --build build

After that I run build/test/utest and receive the following error:

[==========] Running 17 tests from 1 test suite.

[----------] Global test environment set-up.

[----------] 17 tests from DFCxx

[ RUN      ] DFCxx.Polynomial2AddInt2MulInt3Asap

/usr/include/c++/9/bits/stl_vector.h:1042: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = llvm::raw_fd_ostream*; _Alloc = std::allocator<llvm::raw_fd_ostream*>; std::vector<_Tp, _Alloc>::reference = llvm::raw_fd_ostream*&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__builtin_expect(__n < this->size(), true)' failed.

./tests-run.sh: line 5: 65724 Aborted                 (core dumped) build/test/utest
Muxianesty commented 3 months ago

Looked into it: compile-method which is used to translate a kernel accepts a vector of string output files' paths and assumes that the vector is of the same size as the number of all possible output formats (with empty strings for excluded output formats). Normally main.cpp is responsible for creating a valid vector so general use of Utopia HLS doesn't fail, but the tests still use the old assumption of a single output format (SystemVerilog), so a single element vector is created, which fails.

I can see several ways of fixing that:

ssmolov commented 3 months ago

Fixed.