UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor sgrandpre
Visitor
425 Views
Registered: ‎03-20-2014

Align outputs from HLS function so they are valid on the same cycle

I'm writing a function with multiple outputs in HLS.  Since I want all of the outputs to be valid on the same clock cycle, I put them in a struct.  HLS breaks up the struct into multiple output ports, which is fine - but each one gets its own valid signal generated, and they are not all valid at the same time.  Is there a way to direct HLS to wait until all outputs are valid to send them?  

0 Kudos
1 Reply
Xilinx Employee
Xilinx Employee
375 Views
Registered: ‎09-05-2018

Re: Align outputs from HLS function so they are valid on the same cycle

Hey @sgrandpre,

I think the easiest option is to check if the set_directive_data_pack optimization works for you. It's documented on page 456 of UG902, but you basically just want to add the following into your function:

#pragma HLS data_pack variable=<your_struct_variable_name>

The other option I might recommend for sending the variables at the same time would be to just declare a temporary struct internally and wait until the end to copy them to the output struct.

I hope one of those two options works for you. If not, I might be able to investigate more thoroughly if you could share an example in code.

Nicholas Moellers

Xilinx Worldwide Technical Support
0 Kudos