08-19-2013 05:46 AM
Hello,
I want to compute sth like this in vivado HLS...
Integer_Indicator = Bit_Indicator/32;
pos = Bit_Indicator%32;
In the synthesis vivado HLS seems to add two separate devision module for each operation. These results could be computed by a div core....Could HLS be told to use the same hardware module to produce both result to save area?
Thanks
08-19-2013 06:56 AM
08-19-2013 10:59 AM
08-20-2013 07:10 AM
Would the resource directive be able to force both operations to use the same division module?
@rcingham No...no way. Someone that has no clue about hardware could never make an efficient HLS desing unless it was very simple.
And HLS it can save a good amount of time compared to writing VHDL manually. Epsecially if you have very complex designs.
And yes what I try to make is more or less a bus splitter...Unfortunately it is part of a very much larger design that I implement in HLS and i need to describe it in C that the HLS can translate to hardware.
08-20-2013 09:09 AM
08-23-2013 01:27 AM
I do not think so...What I did is implement a check bit function using shifting but i stiil need to know which bit I need,hence the devisions....
08-27-2013 08:53 AM
Hi everyone!
All those messages intriged me.. anything that is supported in C is supported by VHLS!
Please use this toy example to make your own tests...
As I understand this question was just a side question/issue to what you originally intented - there's more than one way to do it ;)
I hope this helps a bit
cheers - Hervé
/* !!!! the user/reader needs to write its own testbench !!!! */
#include <assert.h>
void top(unsigned int in, unsigned int pos, unsigned int &out_top, unsigned int &out_bottom) {
assert(pos>=0);
assert(pos<=32);
unsigned int bits;
// makes this variable or not!
#if 1
bits = pos;
#else
bits = 5; // note: input pos won't be used
#endif
#if 0
// with operators
out_top = in / (1<<bits);
out_bottom = in % (1<<bits);
#else
// using direct shift
out_top = in >> bits;
// generate a mask followed by bitwise AND
unsigned int lshift = 32 - bits;
unsigned int mask = 0xffffffff >> lshift;
out_bottom = in & mask;
#endif
}
09-02-2013 05:02 AM
Yes this does work and that is what i use....I think the conversaion got a little sidetracked...
To be more specific. I have sth like this:
An array of 10 integers each of 32 bits. Each bit might be a useful value and are placed in sequenced in these integers, bundled in integers to improve I/O transfer.
If for example I need the 55th bit I do these 2 divisions in the first post to see in which integer that bit is placed and its position in that integer (that would be pos in the previous code).
After that I use shifts to take the respetive bit, similarly to what you had in your code.
Thaks for the replies....
09-12-2013 02:51 AM
09-18-2013 10:04 PM - edited 09-18-2013 10:04 PM
> No...no way. Someone that has no clue about hardware could never make an efficient HLS desing unless it was very simple.
I am pretty sure someone somewhere at some time said: "someone that [sic] has no clue about cpu instructions and timing could never write an efficient program unless it was very simple" ;-)