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 dory96
Visitor
183 Views
Registered: ‎07-06-2018

Cosimulation freeze, SDK not updating

Hi guys,

Some background:

I'm trying to use Zedboard as an acceelerator (run software on ARM then pass computational intensive parts to the FPGA). I have designed an IP Core in Vivado HLS, connected it to the ARM using a block diagram in Vivado and afterwards exported to the SDK. After writing the code in the SDK I noticed that an array, passed as argument, is not modified after running through the FPGA, so I stripped my design A LOT and ended up with this:

The cosimulation freezes when trying to use it against a very simple code (see below). The C simulation is fine. I've tried other values for depth as well.

I have this code in Vivado HLS. Please nevermind name of variables, I kept messing with the code hoping that I'll finally find a solution, but I didn't.

void interpreter_loop(int *instructions,
int *constants, int *sizes,
int *output){

#pragma HLS INTERFACE s_axilite port=return bundle=CONTROL_BUS
#pragma HLS INTERFACE m_axi depth=1000 port=instructions offset=slave bundle=INSTRUCTIONS
#pragma HLS INTERFACE m_axi depth=1000 port=constants offset=slave bundle=CONSTANTS
#pragma HLS INTERFACE m_axi depth=1000 port=sizes offset=slave bundle=SIZES
#pragma HLS INTERFACE m_axi depth=1000 port=output offset=slave bundle=OUTPUT

// xilly_puts("Hello, world\n");

int x = 1;
memset(sizes, 1, sizeof(int));

}

 

And I have this code in my test_banch:

void interpreter_loop(int *instructions,
int *constants, int *sizes,
int *output);

int main(void)
{
int input, instr, sizes, output;
output = 0;
int result;
memset(&result, 1, sizeof(int));
interpreter_loop(&input, &instr, &sizes, &output);
if (sizes == result){
// printf("succes\n");
return 0;
} else{
// printf("fail\n");
return 1;
}

}

 

My questions are:

1) What exactly is depth (note that I have a very strong C background, but minimal when it comes to FPGAs)? In my understanding, in order for HLS to be able to correctly synthetize the design I need to tell the length of the vector as depth argument (say I have 2 elements in vector then I say depth 2).

 

2) Any idea why that stalls in cosimulation? It doesn't even fail, it just freezes, and if I try to stop it then the who HLS IDE freezes.

 

3) Any idea why that code won't show any modification to the sizes argument when running on the Zedboard?

By the way, I'm using Vivado 2018.3.

 

Best,

Dorin

0 Kudos
2 Replies
Visitor dory96
Visitor
170 Views
Registered: ‎07-06-2018

Re: Cosimulation freeze, SDK not updating

block_diag.png

If it helps, this is my block diagram

0 Kudos
Visitor dory96
Visitor
65 Views
Registered: ‎07-06-2018

Re: Cosimulation freeze, SDK not updating

In case anybody else encounters this problem, on number 3 I managed to find the solution:

The ARM Core doesn't know that something else might modify the data in the RAM, so it takes the data from the cache, even though it is outdated. The solution was to force a cache flush in the code running on the ARM Core.

It turns out that the cosimulation freezing doesn't mean than the hardware design is wrong, but I still don't understand why it freezes. Maybe it is a bug.

0 Kudos