Skip to content

Commit

Permalink
[VTA] Fix VTA function Vivado Compile Error. (apache#3375)
Browse files Browse the repository at this point in the history
Issue:
when using vivado compile vta.cc with top function 'vta', vivado
report deadlock error like '...with default size is used in a non -dataflow
region, which may result in deadlock Please consider to resize the
stream using the directive ‘set_directive_stream’ or the ‘HL S stream’
pragma.'

Solution:
give the queue a default size as 8.
  • Loading branch information
huajsj authored and Wei Chen committed Jun 26, 2019
1 parent adb2e67 commit b505439
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions vta/hardware/xilinx/src/vta.cc
Original file line number Diff line number Diff line change
Expand Up @@ -586,19 +586,29 @@ void vta(

// Instantiate temporary instruction queues (used for peeking)
hls::stream<insn_T> tmp_load_queue;
PRAGMA_HLS(HLS stream depth=STREAM_IN_DEPTH variable=tmp_load_queue)
hls::stream<insn_T> tmp_gemm_queue;
PRAGMA_HLS(HLS stream depth=STREAM_IN_DEPTH variable=tmp_gemm_queue)
hls::stream<insn_T> tmp_store_queue;
PRAGMA_HLS(HLS stream depth=STREAM_IN_DEPTH variable=tmp_store_queue)

// Instatiate physical instruction queues
hls::stream<insn_T> load_queue;
PRAGMA_HLS(HLS stream depth=STREAM_IN_DEPTH variable=load_queue)
hls::stream<insn_T> gemm_queue;
PRAGMA_HLS(HLS stream depth=STREAM_IN_DEPTH variable=gemm_queue)
hls::stream<insn_T> store_queue;
PRAGMA_HLS(HLS stream depth=STREAM_IN_DEPTH variable=store_queue)

// Dependence queues
hls::stream<bool> l2g_dep_queue;
PRAGMA_HLS(HLS stream depth=STREAM_IN_DEPTH variable=l2g_dep_queue)
hls::stream<bool> s2g_dep_queue;
PRAGMA_HLS(HLS stream depth=STREAM_IN_DEPTH variable=s2g_dep_queue)
hls::stream<bool> g2l_dep_queue;
PRAGMA_HLS(HLS stream depth=STREAM_IN_DEPTH variable=g2s_dep_queue)
hls::stream<bool> g2s_dep_queue;
PRAGMA_HLS(HLS stream depth=STREAM_IN_DEPTH variable=g2s_dep_queue)

// Instantiate memories
inp_vec_T inp_mem[VTA_INP_BUFF_DEPTH][VTA_BATCH];
Expand Down
7 changes: 7 additions & 0 deletions vta/hardware/xilinx/src/vta.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ typedef ap_int<VTA_ALUOP_IMM_BIT_WIDTH> aluop_imm_T;
/* \typedef aluop_opcode_T ALU operation shift immediate datatype*/
typedef ap_int<VTA_LOG_ACC_WIDTH> aluop_sh_imm_T;

/*!
* Define HLS stream depth
*/
#define PRAGMA_SUB(x) _Pragma (#x)
#define PRAGMA_HLS(x) PRAGMA_SUB(x)
#define STREAM_IN_DEPTH 8

/*!
* \brief Fetch module.
* Reads in \a insn_count instructions via DMA and pushes them to the
Expand Down

0 comments on commit b505439

Please sign in to comment.