cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ks14ch93
Contributor
Contributor
1,989 Views
Registered: ‎11-07-2016

Reducing latency

Hello everyone, I need your advise about the following nested loop.

legalizeEdge_label1: while (n > 0) { 
			
legalizeEdge_label4: for (int i = 0; i < 6; i++) {
	if (((Edges[i].mA != 0 && Edges[i].mB != 0)|| (Edges[i].mB != 0 && Edges[i].mC != 0)|| (Edges[i].mC != 0 && Edges[i].mA != 0))&& done == 0) {
         ..........................
         .......................... 
         }
legalizeEdge_label5: for (int i = 0; i < MAX_NO_TRIANGLES; i++) {
        if ((Triangles[i].mA == v2 || Triangles[i].mB == v2 || Triangles[i].mC ==v2) && done < 2) {
        if (Triangles[i].mA == v3 || Triangles[i].mB == v3|| Triangles[i].mC == v3) {
        if (Triangles[i].mA == v1 || Triangles[i].mB == v1|| Triangles[i].mC == v1) {
         .................. 
         }
         }
         }
}

This nested loop has the following analysis window.

 

Analysis window

Is there any way (directives or change the code) to reduce latency cycles....??

I already convert all the float variables into fixed point and I reduce latency a lot of cycles  but I need to do something more.

 

Thanks in advance...!!!!

0 Kudos
4 Replies
u4223374
Advisor
Advisor
1,977 Views
Registered: ‎04-26-2015

Is the "label4" loop pipelined?

 

It looks like the main problem is that it's trying to do lots of reads from Edges simultaneously. What is "Edges"? An array of structs? If so, using DATAPACK on it might do what you need.

0 Kudos
ks14ch93
Contributor
Contributor
1,944 Views
Registered: ‎11-07-2016

No pipeline for any loop. I try a lot of directives before but no one effects to the latency.

"Edges" is array of class with 3 integers members.

0 Kudos
u4223374
Advisor
Advisor
1,935 Views
Registered: ‎04-26-2015

Try pipelining both the "label4" and "label5" loops. At least then HLS will give you more information about which parts are limiting your performance - almost always either dependencies or limited ports.

 

 

 

0 Kudos
ks14ch93
Contributor
Contributor
1,916 Views
Registered: ‎11-07-2016

Vivado_hls don't give me the option of DATAPACK for an array of struct. What to do about that..??

The only way that I have the option to use DATAPACK is only for the member variables of the struct.

0 Kudos