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 afortunatov
Visitor
7,070 Views
Registered: ‎09-25-2013

pragma data_pack example from UG902 causes "[HLS-102] Encountered an internal error"

Hello!

We are trying to make pragma data_pack work. The attachment contains the example from page #176 of XIlinx UG902 (HLS2013.2). If we run C-synthesis of this project on HLS 2013.2 it fails with the following message:

 

@E [HLS-102] Encountered an internal error;
For technical support on this issue, please visit http://www.xilinx.com/support.

 

 

Thanks!

Tags (2)
0 Kudos
3 Replies
Xilinx Employee
Xilinx Employee
7,065 Views
Registered: ‎08-17-2011

Re: pragma data_pack example from UG902 causes "[HLS-102] Encountered an internal error"

Hello A,

 

You apply the packing directive inside a function. I don't think it makes sense to have the datapack directive to internal ports.

 

It makes sense when applied to the top level function's ports (because the top level ports are what are turned into something meaningful).

 

1- if you set "foo" as top, it should work?

2- if you propagate the inputs / outputs to the top it should also work, if you change the directives accordignly

3- if you don't set the directive, it should not have issues.

 

I hope this helps! Does it makes sense?

Hervé

</hr></br>

typedef struct{
 unsigned char A;
 unsigned char B[320];
 unsigned char C;
} my_data;

my_data foo(my_data a_in)  ////////// you apply the directives here on a_in and the return
{
 int i;
 my_data b_out;
 b_out.A = (a_in.A >> 1) + 10;
 b_out.C = (a_in.C >> 3) + 100;
 for(i = 0; i <= 319; i++){
  b_out.B[i] = (a_in.B[i] + a_in.A + a_in.C);
 }
 return b_out;
}

int DoArrayTests() {     ////////////// that's your top
 my_data input;
 my_data output = foo(input);
 return output.A;
}

- Hervé

SIGNATURE:
* New Dedicated Vivado HLS forums* http://forums.xilinx.com/t5/High-Level-Synthesis-HLS/bd-p/hls
* Readme/Guidance* http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

* Please mark the Answer as "Accept as solution" if information provided is helpful.
* Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos
Xilinx Employee
Xilinx Employee
7,029 Views
Registered: ‎08-17-2011

Re: pragma data_pack example from UG902 causes "[HLS-102] Encountered an internal error"

this issue does not appear in internal versions of 2013.3

- Hervé

SIGNATURE:
* New Dedicated Vivado HLS forums* http://forums.xilinx.com/t5/High-Level-Synthesis-HLS/bd-p/hls
* Readme/Guidance* http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

* Please mark the Answer as "Accept as solution" if information provided is helpful.
* Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos
Newbie avolkov
Newbie
7,017 Views
Registered: ‎10-03-2013

Re: pragma data_pack example from UG902 causes "[HLS-102] Encountered an internal error"

>1- if you set "foo" as top, it should work?

>3- if you don't set the directive, it should not have issues.

Yes, it doesn't crash if I make foo top-level or there are no DATA_PACK directives.

But it's not what I want to accomplish. I want to read/write from/to a big array of my_data structs and I want to prevent HLS from creating a channel for each struct field like it normally does.

 

Is DATA_PACK only applicable to the top-level function? (If so, why do we need to write the function name in the directive?)

How can I apply DATA_PACK to the extern global arrays that are exposed as RTL ports?

 

I want the following code to have a single port for Buffer instead of 4 separate ports (each with its own address port). How can I make this code read/write whole structures instead of reading/writing them one field at a time?

 

struct MyData {

char A;

char B;

char C;

char D;

};

 

extern MyData Buffer[1000000];

 

MyData Read(int srcIdx) {

return Buffer[srcIdx];

}

 

void Write(int dstIdx, MyData value) {

Buffer[dstIdx] = value;

}

 

void Copy(int srcIdx, int dstIdx) {

Write(dstIdx, Read(srcIdx));

}

 

int DoArrayTests() { //Top-level

for(int i = 0; i < 200; i++) {

Copy(i, i + 1000);

}

return Buffer[0].A;

}

 

As of now I get this in my log:

@I [RTGEN-500] Setting interface mode on port 'DoArrayTests/Buffer_A' to 'ap_memory'.

@I [RTGEN-500] Setting interface mode on port 'DoArrayTests/Buffer_B' to 'ap_memory'.

@I [RTGEN-500] Setting interface mode on port 'DoArrayTests/Buffer_C' to 'ap_memory'.

@I [RTGEN-500] Setting interface mode on port 'DoArrayTests/Buffer_D' to 'ap_memory'.

0 Kudos