Comments (5)
Hi @mksit. I cannot reproduce this; at least on 2018.3 the empty()
-method of hls::stream
is marked as const, so IsEmpty()
synthesizes as expected. What is your exact setup, and can you provide code to reproduce this?
from hlslib.
I tested it with Vivado HLS 2019.1. A minimal program that just invokes IsEmpty() fails to compile when HLSLIB_SYNTHESIS is set.
SimpleTest.cpp
#include "hlslib/xilinx/Stream.h"
int main() {
hlslib::Stream<int, 10> strm;
bool empty = strm.IsEmpty();
}
In file included from ../../../../SimpleTest.cpp:1:0:
/home/Workspace/hlslib/include/hlslib/xilinx/Stream.h: In instantiation of ‘bool hlslib::Stream<T, capacity, <anonymous> >::IsEmpty() const [with T = int; unsigned int capacityDefault = 10u; hlslib::Storage storage = (hlslib::Storage)0]’:
../../../../SimpleTest.cpp:12:26: required from here
/home/Workspace/hlslib/include/hlslib/xilinx/Stream.h:459:26: error: passing ‘const hls::stream<int>’ as ‘this’ argument discards qualifiers [-fpermissive]
return stream_.empty();
^
In file included from /home/Workspace/hlslib/include/hlslib/xilinx/Stream.h:10:0,
from ../../../../SimpleTest.cpp:1:
/opt/Xilinx/Vivado/2019.1/include/hls_stream.h:175:10: note: in call to ‘bool hls::stream<__STREAM_T__>::empty() [with __STREAM_T__ = int]’
bool empty() {
^~~~~
make: *** [obj/SimpleTest.o] Error 1
from hlslib.
This is not a bug: HLSLIB_SYNTHESIS
should only be set when you're running synthesis. If you want to do software simulation, you should not define this macro.
When running synthesis, Vivado HLS does not use the hls_stream.h
header, and you will thus not get this error.
You can have a look at xilinx_test/CMakeLists.txt
for examples on how you can build, simulate, and synthesize codes with hlslib
.
from hlslib.
The synthesis works when I set HLSLIB_SYNTHESIS, but I ran into the same error when I tried to do C/RTL cosimulation. I cannot find how to set the flags properly for cosimulation in your example.
I attach my simple testing code along with a tcl script. Could you please suggest how I should change the tcl script in order to get the cosimulation working?
from hlslib.
Unfortunately Vivado HLS' cosimulation is not support by hlslib. This is because the internal version of clang used for cosimulation used to be behind the one used for synthesis, so it did not support the same language features. I have not looked into whether this has been updated in the meantime.
Instead, I advise to use SDAccel/Vitis' hardware emulation feature. This uses the OpenCL flow by executing emulation kernels, and can give you cycle accurate emulation, even emitting waveforms you can inspect.
Thus, the three stages of validation are:
- Software simulation (i.e., just compile and run the code using
HLSLIB_DATAFLOW
-macros). - Hardware emulation using SDAccel/Vitis
- Executing in hardware
from hlslib.
Related Issues (20)
- cosim_design with Vivado_hls 2019.2 HOT 5
- Dataflow and Template Functions HOT 2
- Another Project Which Uses HLSLIB HOT 3
- Compatibility with Vitis 2020.2? HOT 16
- Feature Request: support event wait list when enqueueing a Kernel or Buffer Read/Write HOT 1
- Warnings when building with 2020.2 HOT 1
- Support for aarch64/arm64? HOT 6
- Tight packing for DataPack on hardware HOT 2
- hlslib::ConstLog2 off by 1? HOT 3
- c++0x_warning.h HOT 10
- function WriteOptimistic in Stream.h has a void return type HOT 3
- `hlslib::Stream` on the interface HOT 2
- `hlslib::Stream` with `ap_axiu` HOT 2
- No platform found in path HOT 8
- Run hlslib on U50 HOT 1
- `hlslib::Stream::write` works like `hls::stream::write` HOT 4
- Vitis 2021.1 failed to parse XPFM file of U250 HOT 3
- Any plans to support Vitis 2022.1 and 2022.2? HOT 3
- Does this library support running on U200 platform? HOT 1
- Does this repository have documentation and simple example programs? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hlslib.