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: 
Visitor icebergyy
Visitor
202 Views
Registered: ‎02-20-2019

Generated IP is not float

Jump to solution
#ifndef XC1_H
#define XC1_H
....
u32 XC1_Write_filter_w_Words(XC1 *InstancePtr, int offset, int *data, int length);
u32 XC1_Read_filter_w_Words(XC1 *InstancePtr, int offset, int *data, int length);
u32 XC1_Write_filter_w_Bytes(XC1 *InstancePtr, int offset, char *data, int length);
u32 XC1_Read_filter_w_Bytes(XC1 *InstancePtr, int offset, char *data, int length);
....
void c1(
		fp_data input_image[c1_input_width][c1_input_width],
		float filter_w[c1_filter*c1_filter_size*c1_filter_size],
		float filter_b[c1_filter],
		fp_data output[c1_output_width*c1_output_size*c1_output_size]
		){

	#pragma HLS INTERFACE axis port=output
	#pragma HLS INTERFACE axis port=input_image
	#pragma HLS INTERFACE s_axilite port=return bundle=CRTL_BUS
	#pragma HLS INTERFACE s_axilite port=filter_w bundle=KERNEL_BUS
	#pragma HLS INTERFACE s_axilite port=filter_b bundle=KERNEL_BUS
......

Hi everyone

the generated function is type of integer or bytes instead of float, how can I change it to float?

 

Thanks

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Scholar u4223374
Scholar
167 Views
Registered: ‎04-26-2015

Re: Generated IP is not float

Jump to solution

Just cast a float* to and int* and pass that.

 

HLS drivers work either by passing words in the native width of the system (ie 32 bits for Zynq 7000; not sure if UltraScale+ uses 64-bit or not) or bytes. The driver doesn't actually know or care what data type the HLS block is expecting.

 

Since, in this case, sizeof(float) == sizeof(int) one 32-bit "int" (from the drivers point of view) will map neatly to one 32-bit float (from the HLS block's point of view).

1 Reply
Highlighted
Scholar u4223374
Scholar
168 Views
Registered: ‎04-26-2015

Re: Generated IP is not float

Jump to solution

Just cast a float* to and int* and pass that.

 

HLS drivers work either by passing words in the native width of the system (ie 32 bits for Zynq 7000; not sure if UltraScale+ uses 64-bit or not) or bytes. The driver doesn't actually know or care what data type the HLS block is expecting.

 

Since, in this case, sizeof(float) == sizeof(int) one 32-bit "int" (from the drivers point of view) will map neatly to one 32-bit float (from the HLS block's point of view).