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 gknowles
Visitor
2,621 Views
Registered: ‎01-12-2014

dataflow and loops in HLS

Hi
I am having a problem with a systolic array design in HLS. I want to use the
dataflow directive to generate no_proc-1 copies of pe_wrapper. However,
(looking at the VHDL) it only generates 1 copy and muxes all the signals into that.

The output of synthesis is:
INFO: [HLS 200-10] Checking synthesizability ...
INFO: [XFORM 203-602] Inlining function 'pe' into 'pe_wrapper' (pe_array.c:303) automatically.
INFO: [HLS 200-111] Finished Checking Synthesizability Time (s): cpu = 00:00:03 ; elapsed = 00:00:02 . Memory (MB): peak = 348.473 ; gain = 12.602 ; free physical = 22980 ; free virtual = 68436
INFO: [XFORM 203-602] Inlining function 'pe' into 'pe_wrapper' (pe_array.c:303) automatically.
INFO: [XFORM 203-721] Changing loop 'Loop_1_proc' (pe_array.c:341) to a process function for dataflow in function 'all_pe_loop_wrapper'.
WARNING: [XFORM 203-713] All the elements of global array 'h' (pe_array.c:332) should be updated in process function 'Loop_1_proc' (pe_array.c:335:64), otherwise it may not be synthesized correctly.
INFO: [XFORM 203-712] Applying dataflow to function 'all_pe_loop_wrapper' (pe_array.c:328), detected/extracted 1 process function(s):
'Loop_1_proc'.
INFO: [HLS 200-111] Finished Pre-synthesis Time (s): cpu = 00:00:03 ; elapsed = 00:00:02 . Memory (MB): peak = 476.453 ; gain = 140.582 ; free physical = 22960 ; free virtual = 68416
INFO: [HLS 200-111] Finished Architecture Synthesis Time (s): cpu = 00:00:03 ; elapsed = 00:00:02 . Memory (MB): peak = 476.453 ; gain = 140.582 ; free physical = 22952 ; free virtual = 68407
INFO: [HLS 200-10] Starting hardware synthesis ...
INFO: [HLS 200-10] Synthesizing 'all_pe_loop_wrapper' ...
INFO: [HLS 200-10] ----------------------------------------------------------------
INFO: [HLS 200-42] -- Implementing module 'pe_wrapper'
INFO: [HLS 200-10] ----------------------------------------------------------------
INFO: [SCHED 204-11] Starting scheduling ...
INFO: [SCHED 204-11] Finished scheduling.
INFO: [HLS 200-111] Elapsed time: 1.92 seconds; current allocated memory: 78.235 MB.
INFO: [BIND 205-100] Starting micro-architecture generation ...
INFO: [BIND 205-101] Performing variable lifetime analysis.
INFO: [BIND 205-101] Exploring resource sharing.
INFO: [BIND 205-101] Binding ...
INFO: [BIND 205-100] Finished micro-architecture generation.
INFO: [HLS 200-111] Elapsed time: 0.02 seconds; current allocated memory: 78.387 MB.
INFO: [HLS 200-10] ----------------------------------------------------------------
INFO: [HLS 200-42] -- Implementing module 'Loop_1_proc'
INFO: [HLS 200-10] ----------------------------------------------------------------
INFO: [SCHED 204-11] Starting scheduling ...
INFO: [SCHED 204-11] Finished scheduling.
INFO: [HLS 200-111] Elapsed time: 0.04 seconds; current allocated memory: 78.674 MB.
INFO: [BIND 205-100] Starting micro-architecture generation ...
INFO: [BIND 205-101] Performing variable lifetime analysis.
INFO: [BIND 205-101] Exploring resource sharing.
INFO: [BIND 205-101] Binding ...
INFO: [BIND 205-100] Finished micro-architecture generation.
INFO: [HLS 200-111] Elapsed time: 0.02 seconds; current allocated memory: 78.838 MB.
INFO: [HLS 200-10] ----------------------------------------------------------------
INFO: [HLS 200-42] -- Implementing module 'all_pe_loop_wrapper'
INFO: [HLS 200-10] ----------------------------------------------------------------
INFO: [SCHED 204-11] Starting scheduling ...
INFO: [SCHED 204-11] Finished scheduling.
INFO: [HLS 200-111] Elapsed time: 0.04 seconds; current allocated memory: 78.933 MB.
INFO: [BIND 205-100] Starting micro-architecture generation ...
INFO: [BIND 205-101] Performing variable lifetime analysis.
INFO: [BIND 205-101] Exploring resource sharing.
INFO: [BIND 205-101] Binding ...
INFO: [BIND 205-100] Finished micro-architecture generation.
INFO: [HLS 200-111] Elapsed time: 0.02 seconds; current allocated memory: 78.978 MB.
INFO: [HLS 200-10] ----------------------------------------------------------------
INFO: [HLS 200-10] -- Generating RTL for module 'pe_wrapper'
INFO: [HLS 200-10] ----------------------------------------------------------------
INFO: [RTGEN 206-100] Finished creating RTL model for 'pe_wrapper'.
INFO: [HLS 200-111] Elapsed time: 0.04 seconds; current allocated memory: 79.223 MB.
INFO: [HLS 200-10] ----------------------------------------------------------------
INFO: [HLS 200-10] -- Generating RTL for module 'Loop_1_proc'
INFO: [HLS 200-10] ----------------------------------------------------------------
INFO: [SYN 201-210] Renamed object name 'Loop_1_proc_diagonal' to 'Loop_1_proc_diagobkb' due to the length limit 20
INFO: [RTGEN 206-100] Finished creating RTL model for 'Loop_1_proc'.
INFO: [HLS 200-111] Elapsed time: 0.06 seconds; current allocated memory: 80.113 MB.
INFO: [HLS 200-10] ----------------------------------------------------------------
INFO: [HLS 200-10] -- Generating RTL for module 'all_pe_loop_wrapper'
INFO: [HLS 200-10] ----------------------------------------------------------------
INFO: [RTGEN 206-500] Setting interface mode on port 'all_pe_loop_wrapper/delay_reset' to 'ap_memory'.
INFO: [RTGEN 206-500] Setting interface mode on port 'all_pe_loop_wrapper/query_vec' to 'ap_memory'.
INFO: [RTGEN 206-500] Setting interface mode on port 'all_pe_loop_wrapper/subject_vec' to 'ap_memory'.
INFO: [RTGEN 206-500] Setting interface mode on port 'all_pe_loop_wrapper/traceback' to 'ap_memory'.
INFO: [RTGEN 206-500] Setting interface mode on port 'all_pe_loop_wrapper/h' to 'ap_memory'.
INFO: [RTGEN 206-500] Setting interface mode on function 'all_pe_loop_wrapper' to 'ap_ctrl_hs'.

Any ideas?


void all_pe_loop_wrapper( bool delay_reset[no_proc+1], unsigned char query_vec[no_proc], unsigned char subject_vec[no_proc], unsigned char traceback[no_proc], signed short h[no_proc] ) { signed short diagonal[no_proc+1]; signed short left[no_proc+1]; signed short eleft[no_proc+1]; #pragma HLS dataflow #pragma HLS unroll for(int i = 1; i < no_proc; i++) { pe_wrapper(delay_reset[i+1],delay_reset[i+1], query_vec[i],subject_vec[i],diagonal[i],left[i],eleft[i],OPEN_DEL + i*EXTEND_DEL,OPEN_DEL + (i-1)*EXTEND_DEL, &diagonal[i+1],&left[i+1],&eleft[i+1],&traceback[i],&h[i]); } }
0 Kudos
2 Replies
Scholar u4223374
Scholar
2,613 Views
Registered: ‎04-26-2015

Re: dataflow and loops in HLS

The "unroll" pragma needs to be inside the loop. You can use the "allocation" pragma to tell HLS to build lots of copies of a function, so that might be worth a try too.

0 Kudos
Highlighted
Visitor gknowles
Visitor
2,443 Views
Registered: ‎01-12-2014

Re: dataflow and loops in HLS

HI

 

Moving the #pragma HLS unroll into the loop works, it looks like it now generates the no_proc-1 copies. However, it complains 

about the query_vec/subject_vec etc being connected to multiple processes.  Doesn't it understand these are vectors?

 

Here is the synthesis ouput with no_proc = 10:

 

INFO: [XFORM 203-602] Inlining function 'pe' into 'pe_wrapper' (pe_array.c:303) automatically.
INFO: [HLS 200-111] Finished Checking Synthesizability Time (s): cpu = 00:00:03 ; elapsed = 00:00:02 . Memory (MB): peak = 348.473 ; gain = 12.602 ; free physical = 24833 ; free virtual = 69310
INFO: [XFORM 203-501] Unrolling loop 'Loop-1' (pe_array.c:340) in function 'all_pe_loop_wrapper' completely.
INFO: [XFORM 203-102] Partitioning array 'diagonal' (pe_array.c:335) automatically.
INFO: [XFORM 203-102] Partitioning array 'left' (pe_array.c:336) automatically.
INFO: [XFORM 203-102] Partitioning array 'eleft' (pe_array.c:337) automatically.
INFO: [XFORM 203-602] Inlining function 'pe' into 'pe_wrapper8' (pe_array.c:303) automatically.
INFO: [XFORM 203-602] Inlining function 'pe' into 'pe_wrapper9' (pe_array.c:303) automatically.
INFO: [XFORM 203-602] Inlining function 'pe' into 'pe_wrapper10' (pe_array.c:303) automatically.
INFO: [XFORM 203-602] Inlining function 'pe' into 'pe_wrapper11' (pe_array.c:303) automatically.
INFO: [XFORM 203-602] Inlining function 'pe' into 'pe_wrapper12' (pe_array.c:303) automatically.
INFO: [XFORM 203-602] Inlining function 'pe' into 'pe_wrapper13' (pe_array.c:303) automatically.
INFO: [XFORM 203-602] Inlining function 'pe' into 'pe_wrapper14' (pe_array.c:303) automatically.
INFO: [XFORM 203-602] Inlining function 'pe' into 'pe_wrapper15' (pe_array.c:303) automatically.
INFO: [XFORM 203-602] Inlining function 'pe' into 'pe_wrapper16' (pe_array.c:303) automatically.
ERROR: [XFORM 203-711] Array 'query_vec' (pe_array.c:329) failed dataflow checking: it can only be connected at most 2 processes.
WARNING: [XFORM 203-713] Argument 'query_vec' has read operations in process function 'Block_codeRepl69_proc' (pe_array.c:342:2).
WARNING: [XFORM 203-713] Argument 'query_vec' has read operations in process function 'Block_codeRepl6971_proc' (pe_array.c:342:2).
WARNING: [XFORM 203-713] Argument 'query_vec' has read operations in process function 'Block_codeRepl6973_proc' (pe_array.c:342:2).
WARNING: [XFORM 203-713] Argument 'query_vec' has read operations in process function 'Block_codeRepl6976_proc' (pe_array.c:342:2).
WARNING: [XFORM 203-713] Argument 'query_vec' has read operations in process function 'Block_codeRepl6979_proc' (pe_array.c:342:2).
WARNING: [XFORM 203-713] Argument 'query_vec' has read operations in process function 'Block_codeRepl6982_proc' (pe_array.c:342:2).
WARNING: [XFORM 203-713] Argument 'query_vec' has read operations in process function 'Block_codeRepl6985_proc' (pe_array.c:342:2).
WARNING: [XFORM 203-713] Argument 'query_vec' has read operations in process function 'Block_codeRepl6988_proc' (pe_array.c:342:2).
WARNING: [XFORM 203-713] Argument 'query_vec' has read operations in process function 'Block_codeRepl6991_proc' (pe_array.c:342:2).
ERROR: [XFORM 203-711] Array 'subject_vec' (pe_array.c:330) failed dataflow checking: it can only be connected at most 2 processes.
WARNING: [XFORM 203-713] Argument 'subject_vec' has read operations in process function 'Block_codeRepl69_proc' (pe_array.c:342:2).
WARNING: [XFORM 203-713] Argument 'subject_vec' has read operations in process function 'Block_codeRepl6971_proc' (pe_array.c:342:2).
WARNING: [XFORM 203-713] Argument 'subject_vec' has read operations in process function 'Block_codeRepl6973_proc' (pe_array.c:342:2).
WARNING: [XFORM 203-713] Argument 'subject_vec' has read operations in process function 'Block_codeRepl6976_proc' (pe_array.c:342:2).
WARNING: [XFORM 203-713] Argument 'subject_vec' has read operations in process function 'Block_codeRepl6979_proc' (pe_array.c:342:2).
WARNING: [XFORM 203-713] Argument 'subject_vec' has read operations in process function 'Block_codeRepl6982_proc' (pe_array.c:342:2).
WARNING: [XFORM 203-713] Argument 'subject_vec' has read operations in process function 'Block_codeRepl6985_proc' (pe_array.c:342:2).
WARNING: [XFORM 203-713] Argument 'subject_vec' has read operations in process function 'Block_codeRepl6988_proc' (pe_array.c:342:2).
WARNING: [XFORM 203-713] Argument 'subject_vec' has read operations in process function 'Block_codeRepl6991_proc' (pe_array.c:342:2).
ERROR: [XFORM 203-711] Argument 'h' (pe_array.c:332) failed dataflow checking: it can only be written in one process function.
WARNING: [XFORM 203-713] Argument 'h' has write operations in process function 'pe_wrapper8' (pe_array.c:226:2).
WARNING: [XFORM 203-713] Argument 'h' has write operations in process function 'pe_wrapper9' (pe_array.c:207:2).
WARNING: [XFORM 203-713] Argument 'h' has write operations in process function 'pe_wrapper10' (pe_array.c:207:2).
WARNING: [XFORM 203-713] Argument 'h' has write operations in process function 'pe_wrapper11' (pe_array.c:207:2).
WARNING: [XFORM 203-713] Argument 'h' has write operations in process function 'pe_wrapper12' (pe_array.c:207:2).
WARNING: [XFORM 203-713] Argument 'h' has write operations in process function 'pe_wrapper13' (pe_array.c:207:2).
WARNING: [XFORM 203-713] Argument 'h' has write operations in process function 'pe_wrapper14' (pe_array.c:207:2).
WARNING: [XFORM 203-713] Argument 'h' has write operations in process function 'pe_wrapper15' (pe_array.c:207:2).
WARNING: [XFORM 203-713] Argument 'h' has write operations in process function 'pe_wrapper16' (pe_array.c:207:2).
WARNING: [XFORM 203-713] All the elements of global array 'h' (pe_array.c:332) should be updated in process function 'pe_wrapper8' (pe_array.c:226:2), otherwise it may not be synthesized correctly.
WARNING: [XFORM 203-713] All the elements of global array 'h' (pe_array.c:332) should be updated in process function 'pe_wrapper9' (pe_array.c:207:2), otherwise it may not be synthesized correctly.
WARNING: [XFORM 203-713] All the elements of global array 'h' (pe_array.c:332) should be updated in process function 'pe_wrapper10' (pe_array.c:207:2), otherwise it may not be synthesized correctly.
WARNING: [XFORM 203-713] All the elements of global array 'h' (pe_array.c:332) should be updated in process function 'pe_wrapper11' (pe_array.c:207:2), otherwise it may not be synthesized correctly.
WARNING: [XFORM 203-713] All the elements of global array 'h' (pe_array.c:332) should be updated in process function 'pe_wrapper12' (pe_array.c:207:2), otherwise it may not be synthesized correctly.
WARNING: [XFORM 203-713] All the elements of global array 'h' (pe_array.c:332) should be updated in process function 'pe_wrapper13' (pe_array.c:207:2), otherwise it may not be synthesized correctly.
WARNING: [XFORM 203-713] All the elements of global array 'h' (pe_array.c:332) should be updated in process function 'pe_wrapper14' (pe_array.c:207:2), otherwise it may not be synthesized correctly.
WARNING: [XFORM 203-713] All the elements of global array 'h' (pe_array.c:332) should be updated in process function 'pe_wrapper15' (pe_array.c:207:2), otherwise it may not be synthesized correctly.
WARNING: [XFORM 203-713] All the elements of global array 'h' (pe_array.c:332) should be updated in process function 'pe_wrapper16' (pe_array.c:207:2), otherwise it may not be synthesized correctly.
ERROR: [XFORM 203-711] Array 'h' (pe_array.c:332) failed dataflow checking: it can only be connected at most 2 processes.
WARNING: [XFORM 203-713] Argument 'h' has write operations in process function 'pe_wrapper8' (pe_array.c:226:2).
WARNING: [XFORM 203-713] Argument 'h' has write operations in process function 'pe_wrapper9' (pe_array.c:207:2).
WARNING: [XFORM 203-713] Argument 'h' has write operations in process function 'pe_wrapper10' (pe_array.c:207:2).
WARNING: [XFORM 203-713] Argument 'h' has write operations in process function 'pe_wrapper11' (pe_array.c:207:2).
WARNING: [XFORM 203-713] Argument 'h' has write operations in process function 'pe_wrapper12' (pe_array.c:207:2).
WARNING: [XFORM 203-713] Argument 'h' has write operations in process function 'pe_wrapper13' (pe_array.c:207:2).
WARNING: [XFORM 203-713] Argument 'h' has write operations in process function 'pe_wrapper14' (pe_array.c:207:2).
WARNING: [XFORM 203-713] Argument 'h' has write operations in process function 'pe_wrapper15' (pe_array.c:207:2).
WARNING: [XFORM 203-713] Argument 'h' has write operations in process function 'pe_wrapper16' (pe_array.c:207:2).
WARNING: [XFORM 203-713] Reading dataflow channel 'delay_reset' (pe_array.c:328) in the middle of dataflow may stall the dataflow pipeline:
WARNING: [XFORM 203-713] Argument 'delay_reset' has read operations in process function 'Block_codeRepl6971_proc' (pe_array.c:342:2).
ERROR: [XFORM 203-711] Array 'delay_reset' (pe_array.c:328) failed dataflow checking: it can only be connected at most 2 processes.
WARNING: [XFORM 203-713] Argument 'delay_reset' has read operations in process function 'Block_codeRepl6971_proc' (pe_array.c:342:2).
WARNING: [XFORM 203-713] Argument 'delay_reset' has read operations in process function 'Block_codeRepl6973_proc' (pe_array.c:342:2).
WARNING: [XFORM 203-713] Argument 'delay_reset' has read operations in process function 'Block_codeRepl6976_proc' (pe_array.c:342:2).
WARNING: [XFORM 203-713] Argument 'delay_reset' has read operations in process function 'Block_codeRepl6979_proc' (pe_array.c:342:2).
WARNING: [XFORM 203-713] Argument 'delay_reset' has read operations in process function 'Block_codeRepl6982_proc' (pe_array.c:342:2).
WARNING: [XFORM 203-713] Argument 'delay_reset' has read operations in process function 'Block_codeRepl6985_proc' (pe_array.c:342:2).
WARNING: [XFORM 203-713] Argument 'delay_reset' has read operations in process function 'Block_codeRepl6988_proc' (pe_array.c:342:2).
WARNING: [XFORM 203-713] Argument 'delay_reset' has read operations in process function 'Block_codeRepl6991_proc' (pe_array.c:342:2).
ERROR: [HLS 200-70] Pre-synthesis failed.

0 Kudos