Skip to content

Commit

Permalink
Minimize flushing cache
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenghuama committed Jul 25, 2024
1 parent dbc19c0 commit f1fb55f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions deepsocflow/c/runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ static inline void print_output () {
}

static inline void write_flush_u8(u8*restrict addr, u8 val) {
*addr = val;
flush_cache(addr, 1);
*addr = val; // Leave flushing to the end of bundle
}

#define flatten_nhwc(in,ih,iw,ic, N,H,W,C, optional_debug_info,...)\
Expand Down Expand Up @@ -312,7 +311,7 @@ extern EXT_C u8 model_run() {
while (!get_config(A_DONE_WRITE + ocm_bank)){
// in FPGA, wait for write done
};
flush_cache(&ocm[ocm_bank], PE_ROWS*PE_COLS*sizeof(Y_TYPE)) ;
flush_cache(&ocm[ocm_bank], o_bpt);
usleep(0);
#endif
set_config(A_DONE_WRITE + ocm_bank, 0);
Expand Down Expand Up @@ -538,6 +537,7 @@ extern EXT_C u8 model_run() {
fclose(fp_packed);
}
#endif
flush_cache(p_out_buffer, pb->o_bytes);
set_config(A_BUNDLE_DONE, 1);
} // ib
debug_printf("done all bundles!!\n");
Expand Down
4 changes: 2 additions & 2 deletions run/work/config_tb.svh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

`define VALID_PROB 10
`define READY_PROB 100
`define VALID_PROB 1000
`define READY_PROB 1000
`define CLK_PERIOD 4.0
`define INPUT_DELAY_NS 0.8ns
`define OUTPUT_DELAY_NS 0.8ns
4 changes: 2 additions & 2 deletions run/work/hardware.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"axi_max_burst_len": 16,
"target_cpu_int_bits": 32,
"async_resetn": true,
"valid_prob": 0.01,
"ready_prob": 0.1,
"valid_prob": 1,
"ready_prob": 1,
"data_dir": "vectors"
}

0 comments on commit f1fb55f

Please sign in to comment.