Skip to content

Commit

Permalink
Switched to dynamically allocated scoreboard
Browse files Browse the repository at this point in the history
  • Loading branch information
otoomey committed Feb 25, 2024
1 parent 680694e commit ff67933
Show file tree
Hide file tree
Showing 10 changed files with 415 additions and 32 deletions.
3 changes: 3 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"image": "ghcr.io/pulp-platform/snitch_cluster:main"
}
2 changes: 2 additions & 0 deletions Bender.yml
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ sources:
- hw/snitch_cluster/src/snitch_cluster_peripheral/snitch_cluster_peripheral_reg_top.sv
- hw/snitch_cluster/src/snitch_cluster_peripheral/snitch_cluster_peripheral.sv
- hw/snitch_cluster/src/snitch_fpu.sv
- hw/snitch_cluster/src/snitch_sb_ipool.sv
- hw/snitch_cluster/src/snitch_sb.sv
- hw/snitch_cluster/src/snitch_sequencer.sv
- hw/snitch_cluster/src/snitch_tcdm_interconnect.sv
# Level 1
Expand Down
32 changes: 31 additions & 1 deletion hw/snitch/src/snitch_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ package snitch_pkg;
typedef enum logic [1:0] {
SrcSnitch = 0,
SrcFpu = 1,
SrcFpuSeq = 2
SrcFpuSeq = 2,
SrcFpuSB = 3
} trace_src_e;

typedef struct packed {
Expand Down Expand Up @@ -284,6 +285,7 @@ package snitch_pkg;
longint lsu_rd;
longint acc_wb_ready;
longint fpu_out_acc;
longint fpu_out_rd;
longint fpr_waddr;
longint fpr_wdata;
longint fpr_we;
Expand Down Expand Up @@ -322,6 +324,7 @@ package snitch_pkg;
extras_str = $sformatf("%s'%s': 0x%0x, ", extras_str, "lsu_rd", fpu_trace.lsu_rd);
extras_str = $sformatf("%s'%s': 0x%0x, ", extras_str, "acc_wb_ready", fpu_trace.acc_wb_ready);
extras_str = $sformatf("%s'%s': 0x%0x, ", extras_str, "fpu_out_acc", fpu_trace.fpu_out_acc);
extras_str = $sformatf("%s'%s': 0x%0x, ", extras_str, "fpu_out_rd", fpu_trace.fpu_out_rd);
extras_str = $sformatf("%s'%s': 0x%0x, ", extras_str, "fpr_waddr", fpu_trace.fpr_waddr);
extras_str = $sformatf("%s'%s': 0x%0x, ", extras_str, "fpr_wdata", fpu_trace.fpr_wdata);
extras_str = $sformatf("%s'%s': 0x%0x, ", extras_str, "fpr_we", fpu_trace.fpr_we);
Expand Down Expand Up @@ -351,6 +354,33 @@ package snitch_pkg;
extras_str = $sformatf("%s}", extras_str);
return extras_str;
endfunction

typedef struct packed {
longint source;
longint push_rd_addr_i;
longint push_valid_i;
longint entry_index_o;
longint pop_index_i;
longint pop_valid_i;
longint test_addr_i;
longint test_addr_present_o;
longint full_o;
} fpu_sb_trace_port_t;
// pragma translate_on

function automatic string print_fpu_sb_trace(fpu_sb_trace_port_t fpu_sb);
string extras_str = "{";
extras_str = $sformatf("%s'%s': 0x%0x, ", extras_str, "source", fpu_sb.source);
extras_str = $sformatf("%s'%s': 0x%0x, ", extras_str, "push_rd_addr_i", fpu_sb.push_rd_addr_i);
extras_str = $sformatf("%s'%s': 0x%0x, ", extras_str, "push_valid_i", fpu_sb.push_valid_i);
extras_str = $sformatf("%s'%s': 0x%0x, ", extras_str, "entry_index_o", fpu_sb.entry_index_o);
extras_str = $sformatf("%s'%s': 0x%0x, ", extras_str, "pop_index_i", fpu_sb.pop_index_i);
extras_str = $sformatf("%s'%s': 0x%0x, ", extras_str, "pop_valid_i", fpu_sb.pop_valid_i);
extras_str = $sformatf("%s'%s': 0x%0x, ", extras_str, "test_addr_i", fpu_sb.test_addr_i);
extras_str = $sformatf("%s'%s': 0x%0x, ", extras_str, "test_addr_present_o", fpu_sb.test_addr_present_o);

Check warning on line 380 in hw/snitch/src/snitch_pkg.sv

View workflow job for this annotation

GitHub Actions / verible-verilog-lint

[verible-verilog-lint] hw/snitch/src/snitch_pkg.sv#L380

Line length exceeds max: 100; is: 109 [Style: line-length] [line-length]
Raw output
message:"Line length exceeds max: 100; is: 109 [Style: line-length] [line-length]" location:{path:"./hw/snitch/src/snitch_pkg.sv" range:{start:{line:380 column:101}}} severity:WARNING source:{name:"verible-verilog-lint" url:"https://github.com/chipsalliance/verible"}
extras_str = $sformatf("%s'%s': 0x%0x, ", extras_str, "full_o", fpu_sb.full_o);
extras_str = $sformatf("%s}", extras_str);
return extras_str;
endfunction

endpackage
12 changes: 12 additions & 0 deletions hw/snitch_cluster/src/snitch_cc.sv
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ module snitch_cc #(
// pragma translate_off
snitch_pkg::fpu_trace_port_t fpu_trace;
snitch_pkg::fpu_sequencer_trace_port_t fpu_sequencer_trace;
snitch_pkg::fpu_sb_trace_port_t fpu_sb_trace;
// pragma translate_on

logic [2:0][4:0] ssr_raddr;
Expand Down Expand Up @@ -489,6 +490,7 @@ module snitch_cc #(
// pragma translate_off
.trace_port_o ( fpu_trace ),
.sequencer_tracer_port_o ( fpu_sequencer_trace ),
.sb_tracer_port_o ( fpu_sb_trace ),
// pragma translate_on
.hart_id_i ( hart_id_i ),
.acc_req_i ( acc_snitch_req ),
Expand Down Expand Up @@ -846,6 +848,7 @@ module snitch_cc #(
automatic snitch_pkg::snitch_trace_port_t extras_snitch;
automatic snitch_pkg::fpu_trace_port_t extras_fpu;
automatic snitch_pkg::fpu_sequencer_trace_port_t extras_fpu_seq_out;
automatic snitch_pkg::fpu_sb_trace_port_t extras_fpu_sb_out;

if (rst_ni) begin
extras_snitch = '{
Expand Down Expand Up @@ -894,6 +897,7 @@ module snitch_cc #(
if (Xfrep) begin
// Addenda to FPU extras iff popping sequencer
extras_fpu_seq_out = fpu_sequencer_trace;
extras_fpu_sb_out = fpu_sb_trace;
end
end

Expand Down Expand Up @@ -931,6 +935,14 @@ module snitch_cc #(
$fwrite(f, trace_entry);
end
end

if (extras_fpu_sb_out.push_valid_i || extras_fpu_sb_out.pop_valid_i) begin
$sformat(trace_entry, "%t %1d %8d 0x%h DASM(%h) #; %s\n",
$time, cycle, i_snitch.priv_lvl_q, 32'hz, 64'hz,
snitch_pkg::print_fpu_sb_trace(extras_fpu_sb_out));
$fwrite(f, trace_entry);
end

end
end else begin
cycle = '0;
Expand Down
Loading

0 comments on commit ff67933

Please sign in to comment.