diff --git a/machines/arch_filelist.mk b/machines/arch_filelist.mk index 26c7acf34..988df6860 100644 --- a/machines/arch_filelist.mk +++ b/machines/arch_filelist.mk @@ -190,4 +190,3 @@ VSOURCES += $(BSG_MANYCORE_DIR)/v/bsg_manycore_dram_hash_function.v VSOURCES += $(BSG_MANYCORE_DIR)/v/bsg_manycore_link_sif_tieoff.v VSOURCES += $(BSG_MANYCORE_DIR)/v/bsg_manycore_ruche_x_link_sif_tieoff.v VSOURCES += $(BSG_MANYCORE_DIR)/v/bsg_ruche_buffer.v -VSOURCES += $(BSG_MANYCORE_DIR)/v/bsg_ruche_anti_buffer.v diff --git a/software/py/vanilla_parser/blood_graph.py b/software/py/vanilla_parser/blood_graph.py index 0ec47ef4c..9470bafb5 100644 --- a/software/py/vanilla_parser/blood_graph.py +++ b/software/py/vanilla_parser/blood_graph.py @@ -101,6 +101,7 @@ class BloodGraph: "lr_aq", "amoswap", "amoor", + "amoadd", "beq", "bne", "blt", diff --git a/software/py/vanilla_parser/stats_parser.py b/software/py/vanilla_parser/stats_parser.py index 04e78bb7e..07202e7ff 100644 --- a/software/py/vanilla_parser/stats_parser.py +++ b/software/py/vanilla_parser/stats_parser.py @@ -598,6 +598,7 @@ def __prettify(self, df): doc += "\t RISC-V Atomic Operations:\n" doc += "\t\t-instr_amoswap: Atomic Swap\n" doc += "\t\t-instr_amoor: Atomic OR\n" + doc += "\t\t-instr_amoadd: Atomic ADD\n" doc += "\t Cache Stall Operations:\n" doc += "\t\t-stall_miss: Miss Operation (Stall)\n" doc += "\t\t-stall_idle: Idle Operation (Stall)\n" diff --git a/software/py/vanilla_parser/vcache_stall_graph.py b/software/py/vanilla_parser/vcache_stall_graph.py index 7abe6b6bf..feced65e2 100644 --- a/software/py/vanilla_parser/vcache_stall_graph.py +++ b/software/py/vanilla_parser/vcache_stall_graph.py @@ -77,6 +77,7 @@ class VcacheStallGraph: "atomic", "amoswap", "amoor", + "amoadd", "miss_ld", "miss_st", "dma_read_req", @@ -115,6 +116,7 @@ class VcacheStallGraph: "atomic" : (0x00, 0x00, 0x00) , ## white "amoswap" : (0x00, 0x00, 0x00) , ## white "amoor" : (0x00, 0x00, 0x00) , ## white + "amoadd" : (0x00, 0x00, 0x00) , ## white "miss_ld" : (0x00, 0xff, 0x00) , ## green "miss_st" : (0x00, 0x00, 0xff) , ## blue "dma_read_req" : (0xff, 0xff, 0xff) , ## white @@ -154,6 +156,7 @@ class VcacheStallGraph: "atomic" : (0x00, 0x00, 0x00) , ## white "amoswap" : (0x00, 0x00, 0x00) , ## white "amoor" : (0x00, 0x00, 0x00) , ## white + "amoadd" : (0x00, 0x00, 0x00) , ## white "miss_ld" : (0x00, 0xff, 0x00) , ## green "miss_st" : (0x00, 0x00, 0xff) , ## blue "dma_read_req" : (0xff, 0xff, 0xff) , ## white diff --git a/software/spmd/bsg_print_stat/main.c b/software/spmd/bsg_print_stat/main.c index 5ac288496..36736721a 100644 --- a/software/spmd/bsg_print_stat/main.c +++ b/software/spmd/bsg_print_stat/main.c @@ -17,7 +17,7 @@ int main() { int sum = 0; - bsg_print_stat(0); + bsg_cuda_print_stat_start(0); for (int i = 0; i < N; i++) { @@ -36,7 +36,7 @@ int main() product = product * idata[i]; } - bsg_print_stat(1); + bsg_cuda_print_stat_end(0); if (sum == 30 && dp == 51.0f && product == 12096) bsg_finish(); diff --git a/testbenches/common/v/vanilla_core_profiler.v b/testbenches/common/v/vanilla_core_profiler.v index b5e615359..4f03e88f5 100644 --- a/testbenches/common/v/vanilla_core_profiler.v +++ b/testbenches/common/v/vanilla_core_profiler.v @@ -179,6 +179,7 @@ module vanilla_core_profiler wire lr_aq_inc = exe_r.decode.is_lr_aq_op; wire amoswap_inc = exe_r.decode.is_amo_op & (exe_r.decode.amo_type == e_vanilla_amoswap); wire amoor_inc = exe_r.decode.is_amo_op & (exe_r.decode.amo_type == e_vanilla_amoor); + wire amoadd_inc = exe_r.decode.is_amo_op & (exe_r.decode.amo_type == e_vanilla_amoadd); // branch & jump wire beq_inc = exe_r.decode.is_branch_op & (exe_r.instruction ==? `RV32_BEQ); @@ -636,6 +637,7 @@ module vanilla_core_profiler integer lr_aq; integer amoswap; integer amoor; + integer amoadd; integer beq; integer bne; @@ -786,6 +788,7 @@ module vanilla_core_profiler else if (lr_aq_inc) stat_r.lr_aq++; else if (amoswap_inc) stat_r.amoswap++; else if (amoor_inc) stat_r.amoor++; + else if (amoadd_inc) stat_r.amoadd++; else if (beq_inc) begin stat_r.beq++; @@ -962,6 +965,7 @@ module vanilla_core_profiler $fwrite(fd, "instr_lr_aq,"); $fwrite(fd, "instr_amoswap,"); $fwrite(fd, "instr_amoor,"); + $fwrite(fd, "instr_amoadd,"); $fwrite(fd, "instr_beq,"); $fwrite(fd, "instr_bne,"); @@ -1057,7 +1061,7 @@ module vanilla_core_profiler always @(negedge clk_i) begin // stat printing - if (~reset_i & print_stat_v_i & print_stat_tag.y_cord == global_y_i & print_stat_tag.x_cord == global_x_i) begin + if (~reset_i & print_stat_v_i & print_stat_tag.y_cord == (global_y_i-origin_y_cord_p) & print_stat_tag.x_cord == (global_x_i-origin_x_cord_p)) begin $display("[BSG_INFO][VCORE_PROFILER] t=%0t x,y=%02d,%02d printing stats.", $time, global_x_i, global_y_i); fd = $fopen(logfile_lp, "a"); @@ -1121,6 +1125,7 @@ module vanilla_core_profiler $fwrite(fd, "%0d,", stat_r.lr_aq); $fwrite(fd, "%0d,", stat_r.amoswap); $fwrite(fd, "%0d,", stat_r.amoor); + $fwrite(fd, "%0d,", stat_r.amoadd); $fwrite(fd, "%0d,", stat_r.beq); $fwrite(fd, "%0d,", stat_r.bne); @@ -1262,6 +1267,7 @@ module vanilla_core_profiler else if (lr_aq_inc) print_operation_trace(fd2, "lr_aq", exe_pc); else if (amoswap_inc) print_operation_trace(fd2, "amoswap", exe_pc); else if (amoor_inc) print_operation_trace(fd2, "amoor", exe_pc); + else if (amoadd_inc) print_operation_trace(fd2, "amoadd", exe_pc); else if (beq_inc) print_operation_trace(fd2, "beq", exe_pc); else if (bne_inc) print_operation_trace(fd2, "bne", exe_pc); diff --git a/testbenches/common/v/vcache_profiler.v b/testbenches/common/v/vcache_profiler.v index be4084125..896027595 100644 --- a/testbenches/common/v/vcache_profiler.v +++ b/testbenches/common/v/vcache_profiler.v @@ -97,6 +97,7 @@ module vcache_profiler wire inc_atomic = v_o & yumi_i & decode_v_r.atomic_op; // atomic wire inc_amoswap = inc_atomic & (decode_v_r.amo_subop == e_cache_amo_swap); // atomic swap wire inc_amoor = inc_atomic & (decode_v_r.amo_subop == e_cache_amo_or); // atomic or + wire inc_amoadd = inc_atomic & (decode_v_r.amo_subop == e_cache_amo_add); // atomic add wire inc_miss_ld = v_o & yumi_i & decode_v_r.ld_op & miss_v; // miss on load wire inc_miss_st = v_o & yumi_i & decode_v_r.st_op & miss_v; // miss on store @@ -149,6 +150,7 @@ module vcache_profiler integer atomic_count; integer amoswap_count; integer amoor_count; + integer amoadd_count; integer miss_ld_count; integer miss_st_count; @@ -202,6 +204,7 @@ module vcache_profiler if (inc_atomic) stat_r.atomic_count++; if (inc_amoswap) stat_r.amoswap_count++; if (inc_amoor) stat_r.amoor_count++; + if (inc_amoadd) stat_r.amoadd_count++; if (inc_miss_ld) stat_r.miss_ld_count++; if (inc_miss_st) stat_r.miss_st_count++; @@ -240,7 +243,7 @@ module vcache_profiler $fwrite(log_fd, "instr_st,instr_sm_sd,instr_sm_sw,instr_sm_sh,instr_sm_sb,"); $fwrite(log_fd, "instr_tagst,instr_tagfl,instr_taglv,instr_tagla,"); $fwrite(log_fd, "instr_afl,instr_aflinv,instr_ainv,instr_alock,instr_aunlock,"); - $fwrite(log_fd, "instr_atomic,instr_amoswap,instr_amoor,"); + $fwrite(log_fd, "instr_atomic,instr_amoswap,instr_amoor,amoadd,"); $fwrite(log_fd, "miss_ld,miss_st,miss_amo,stall_miss,stall_idle,stall_rsp,dma_read_req,dma_write_req,"); $fwrite(log_fd, "replace_invalid,replace_valid,replace_dirty\n"); $fclose(log_fd); @@ -301,10 +304,11 @@ module vcache_profiler stat_r.aunlock_count, ); - $fwrite(log_fd, "%0d,%0d,%0d,", + $fwrite(log_fd, "%0d,%0d,%0d,%0d,", stat_r.atomic_count, stat_r.amoswap_count, stat_r.amoor_count, + stat_r.amoadd_count, ); $fwrite(log_fd, "%0d,%0d,%0d,%0d,%0d,%0d,%0d,%0d,", @@ -412,6 +416,8 @@ module vcache_profiler print_operation_trace(trace_fd, my_name, "amoswap"); else if (inc_amoor) print_operation_trace(trace_fd, my_name, "amoor"); + else if (inc_amoadd) + print_operation_trace(trace_fd, my_name, "amoadd"); else print_operation_trace(trace_fd, my_name, "idle"); end