Skip to content

Commit 47e598f

Browse files
[target] update target to save 1 cycle of latency
1 parent 60bc52f commit 47e598f

4 files changed

Lines changed: 145 additions & 168 deletions

File tree

Bender.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dependencies:
1616
cv32e40x : { git: "https://github.com/pulp-platform/cv32e40x.git" , rev: "redmule-v1.0" }
1717
ibex : { git: "https://github.com/pulp-platform/ibex.git" , rev: pulpissimo-v6.1.2 }
1818
hwpe-stream : { git: "https://github.com/pulp-platform/hwpe-stream.git" , version: 1.9.2 }
19-
hwpe-ctrl : { git: "https://github.com/pulp-platform/hwpe-ctrl.git" , version: 3.0.0 }
19+
hwpe-ctrl : { git: "https://github.com/pulp-platform/hwpe-ctrl.git" , version: 3.0.2 }
2020
hci : { git: "https://github.com/pulp-platform/hci.git" , version: 2.3.0 }
2121
fpnew : { git: "https://github.com/pulp-platform/cvfpu.git" , rev: "pulp-v0.1.3" }
2222
common_cells : { git: "https://github.com/pulp-platform/common_cells.git" , version: 1.21.0 }

rtl/ctrl/gen_regif.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,16 @@
33
# Solderpad Hardware License, Version 0.51, see LICENSE for details.
44
# SPDX-License-Identifier: SHL-0.51
55

6-
peakrdl regblock redmule_regif.rdl -o regif/ --cpuif obi-flat --default-reset arst_n --hwif-report --addr-width 32
6+
peakrdl regblock redmule_regif.rdl -o regif/ --cpuif passthrough --default-reset arst_n --hwif-report --addr-width 32
77
peakrdl html redmule_regif.rdl -o regif/html/
88
peakrdl c-header redmule_regif.rdl -o regif/hwpe_ctrl_target.h
99
# PeakRDL uses unpacked structs to avoid issues at compile time, which is commendable, but incompatible with FIFOing the output of the job! (use portable sed syntax that works on both Linux and macOS)
1010
sed -E 's/typedef[[:space:]]+struct([[:space:]])/typedef struct packed\1/g' regif/redmule_regif_pkg.sv > regif/redmule_regif_pkg.sv.tmp && mv regif/redmule_regif_pkg.sv.tmp regif/redmule_regif_pkg.sv
11+
12+
# PeakRDL does not emit a license header; prepend the repository's SPDX header to the generated SystemVerilog.
13+
HEADER='// Copyright 2025 ETH Zurich and University of Bologna.
14+
// Solderpad Hardware License, Version 0.51, see LICENSE for details.
15+
// SPDX-License-Identifier: SHL-0.51'
16+
for f in regif/redmule_regif.sv regif/redmule_regif_pkg.sv; do
17+
printf '%s\n' "$HEADER" | cat - "$f" > "$f.tmp" && mv "$f.tmp" "$f"
18+
done

rtl/ctrl/redmule_target_decoder.sv

Lines changed: 42 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ module redmule_target_decoder
3535
logic job_dep_regs_valid;
3636
redmule_regif__hwpe_ctrl_job_dep__out_t job_dep_regs;
3737

38-
// OBI plug target <-> regif
39-
logic target_obi_req;
40-
logic target_obi_gnt;
41-
logic [31:0] target_obi_addr;
42-
logic target_obi_we;
43-
logic [3:0] target_obi_be;
44-
logic [31:0] target_obi_wdata;
45-
logic [OpIdWidth-1:0] target_obi_aid;
46-
logic target_obi_rvalid;
47-
logic target_obi_rready;
48-
logic [31:0] target_obi_rdata;
49-
logic target_obi_err;
50-
logic [OpIdWidth-1:0] target_obi_rid;
38+
// cpuif plug target <-> regif (PeakRDL "passthrough")
39+
logic target_cpuif_req;
40+
logic target_cpuif_req_is_wr;
41+
logic [31:0] target_cpuif_addr;
42+
logic [31:0] target_cpuif_wr_data;
43+
logic [31:0] target_cpuif_wr_biten;
44+
logic target_cpuif_req_stall_wr;
45+
logic target_cpuif_req_stall_rd;
46+
logic target_cpuif_rd_ack;
47+
logic target_cpuif_rd_err;
48+
logic [31:0] target_cpuif_rd_data;
49+
logic target_cpuif_wr_ack;
50+
logic target_cpuif_wr_err;
5151

5252
redmule_regif__in_t hwif_in;
5353
redmule_regif__in_t hwif_in_target;
@@ -73,42 +73,40 @@ module redmule_target_decoder
7373
.job_indep_regs_o ( job_indep_regs ),
7474
.job_dep_regs_valid_o ( job_dep_regs_valid ),
7575
.job_dep_regs_o ( job_dep_regs ),
76-
.target_obi_req_o ( target_obi_req ),
77-
.target_obi_gnt_i ( target_obi_gnt ),
78-
.target_obi_addr_o ( target_obi_addr ),
79-
.target_obi_we_o ( target_obi_we ),
80-
.target_obi_be_o ( target_obi_be ),
81-
.target_obi_wdata_o ( target_obi_wdata ),
82-
.target_obi_aid_o ( target_obi_aid ),
83-
.target_obi_rvalid_i ( target_obi_rvalid ),
84-
.target_obi_rready_o ( target_obi_rready ),
85-
.target_obi_rdata_i ( target_obi_rdata ),
86-
.target_obi_err_i ( target_obi_err ),
87-
.target_obi_rid_i ( target_obi_rid ),
76+
.target_cpuif_req_o ( target_cpuif_req ),
77+
.target_cpuif_req_is_wr_o ( target_cpuif_req_is_wr ),
78+
.target_cpuif_addr_o ( target_cpuif_addr ),
79+
.target_cpuif_wr_data_o ( target_cpuif_wr_data ),
80+
.target_cpuif_wr_biten_o ( target_cpuif_wr_biten ),
81+
.target_cpuif_req_stall_wr_i ( target_cpuif_req_stall_wr ),
82+
.target_cpuif_req_stall_rd_i ( target_cpuif_req_stall_rd ),
83+
.target_cpuif_rd_ack_i ( target_cpuif_rd_ack ),
84+
.target_cpuif_rd_err_i ( target_cpuif_rd_err ),
85+
.target_cpuif_rd_data_i ( target_cpuif_rd_data ),
86+
.target_cpuif_wr_ack_i ( target_cpuif_wr_ack ),
87+
.target_cpuif_wr_err_i ( target_cpuif_wr_err ),
8888
.hwif_in ( hwif_in_target ),
8989
.hwif_out ( hwif_out )
9090
);
9191

9292
/* RedMulE SystemRDL-generated register interface */
93-
redmule_regif #(
94-
.ID_WIDTH ( OpIdWidth )
95-
) i_regif (
96-
.clk ( clk_i ),
97-
.arst_n ( rst_ni ),
98-
.s_obi_req ( target_obi_req ),
99-
.s_obi_gnt ( target_obi_gnt ),
100-
.s_obi_addr ( target_obi_addr ),
101-
.s_obi_we ( target_obi_we ),
102-
.s_obi_be ( target_obi_be ),
103-
.s_obi_wdata ( target_obi_wdata ),
104-
.s_obi_aid ( target_obi_aid ),
105-
.s_obi_rvalid ( target_obi_rvalid ),
106-
.s_obi_rready ( target_obi_rready ),
107-
.s_obi_rdata ( target_obi_rdata ),
108-
.s_obi_err ( target_obi_err ),
109-
.s_obi_rid ( target_obi_rid ),
110-
.hwif_in ( hwif_in ),
111-
.hwif_out ( hwif_out )
93+
redmule_regif i_regif (
94+
.clk ( clk_i ),
95+
.arst_n ( rst_ni ),
96+
.s_cpuif_req ( target_cpuif_req ),
97+
.s_cpuif_req_is_wr ( target_cpuif_req_is_wr ),
98+
.s_cpuif_addr ( target_cpuif_addr ),
99+
.s_cpuif_wr_data ( target_cpuif_wr_data ),
100+
.s_cpuif_wr_biten ( target_cpuif_wr_biten ),
101+
.s_cpuif_req_stall_wr ( target_cpuif_req_stall_wr ),
102+
.s_cpuif_req_stall_rd ( target_cpuif_req_stall_rd ),
103+
.s_cpuif_rd_ack ( target_cpuif_rd_ack ),
104+
.s_cpuif_rd_err ( target_cpuif_rd_err ),
105+
.s_cpuif_rd_data ( target_cpuif_rd_data ),
106+
.s_cpuif_wr_ack ( target_cpuif_wr_ack ),
107+
.s_cpuif_wr_err ( target_cpuif_wr_err ),
108+
.hwif_in ( hwif_in ),
109+
.hwif_out ( hwif_out )
112110
);
113111

114112
assign job_done = op_done_i;

0 commit comments

Comments
 (0)