Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: User config #1704

Closed
wants to merge 63 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
c1c0f8d
create cva6_user_cfg_t
cathales Nov 24, 2023
f6c408f
build riscv_pkg before config_pkg
cathales Nov 27, 2023
8ece4bc
propagate CVA6Cfg
cathales Nov 28, 2023
602183c
move XLEN
cathales Nov 27, 2023
89f20ac
inline xlen_t
cathales Nov 27, 2023
14395ee
move VLEN & PLEN
cathales Nov 27, 2023
7b83e63
move bp_resolve_t & branchpredict_sbe_t
cathales Nov 27, 2023
ae4c7ce
move IS_XLEN32 & IS_XLEN64
cathales Nov 27, 2023
a3d00d8
remove unused FPU_EN
cathales Nov 27, 2023
ea82715
move BITMANIP
cathales Nov 27, 2023
1cb902f
move NR_SB_ENTRIES
cathales Nov 27, 2023
7491a5b
move TRANS_ID_BITS
cathales Nov 27, 2023
5149b1f
move ASID_WIDTH
cathales Nov 27, 2023
07892f7
move FPGA_EN
cathales Nov 27, 2023
6864328
move {FETCH,DATA,AXI}_USER_{EN,WIDTH}
cathales Nov 27, 2023
ede0b69
move XLEN_ALIGN_BYTES
cathales Nov 28, 2023
459b88c
move {Mode,ASID,PPN}W
cathales Nov 28, 2023
0d0aff2
move {MODE_,}SV,VPN2
cathales Nov 28, 2023
380deda
move riscv:: constants
cathales Nov 28, 2023
b923412
move satp_t
cathales Nov 28, 2023
17bcbb1
set {VENDOR,ARCH}ID const len to 32 bits
cathales Nov 28, 2023
c1d985b
move btb_update_t
cathales Nov 9, 2023
e5daf25
move btb_prediction_t
cathales Nov 9, 2023
e7b55e2
move ras_t
cathales Nov 9, 2023
fb9bdc1
move bht_update_t
cathales Nov 9, 2023
ec46a8d
move irq_ctrl_t
cathales Nov 9, 2023
7e60a6f
move fu_data_t
cathales Nov 9, 2023
abe3f1c
move lsu_ctrl_t
cathales Nov 9, 2023
165fb39
move fetch_entry_t
cathales Nov 9, 2023
8f64556
move scoreboard_entry_t
cathales Nov 9, 2023
88d00ba
move icache_arsp_t
cathales Nov 10, 2023
73e217f
move icache_dreq_t & icache_drsp_t
cathales Nov 13, 2023
4060d1c
move dcache_req_i_t & dcache_req_o_t
cathales Nov 13, 2023
159aef4
inline uj_imm & sb_imm, remove unused i_imm
cathales Nov 13, 2023
f96775b
inline data_align
cathales Nov 13, 2023
14a860d
inline sext32
cathales Nov 13, 2023
a10f318
fifo_v3: ariane_pkg::FPGA_EN becomes a param
cathales Nov 14, 2023
25a9013
move FETCH_WIDTH & (LOG2_)INSTR_PER_FETCH
cathales Nov 14, 2023
0153114
move icache_areq_t
cathales Nov 14, 2023
d5e9543
move cache config
cathales Nov 14, 2023
e1bc6e7
move tlb_update_t
cathales Nov 14, 2023
da3fc4a
move DCACHE_{BYTE_OFFSET,NUM_WORDS,{DIRTY,CL_IDX,OFFSET}_WIDTH}
cathales Nov 15, 2023
9ea87eb
move cache_line_t & cl_be_t
cathales Nov 23, 2023
0a28bff
move one_hot_to_bin & get_victim_cl
cathales Nov 23, 2023
d1b87ce
move icache_req_t & icache_rtrn_t
cathales Nov 23, 2023
ba4a59f
move exception_t
cathales Dec 4, 2023
e18d7c5
move wbuffer_t
cathales Dec 6, 2023
172f8a7
move tx_stat_t
cathales Dec 6, 2023
57b7522
inline icache_inval_t
cathales Dec 6, 2023
bc0f471
move dcache_{req,rtrn,inval}_t
cathales Dec 6, 2023
daafe1b
move repData{32,64},to_byte_enable[48]
cathales Dec 6, 2023
aad36dc
move L15_SET_ASSOC,L1[5DI]_WAY_WIDTH
cathales Dec 8, 2023
aeae3c0
inline L15_TID_WIDTH
cathales Dec 8, 2023
32a26d6
move l15_{req,rtrn}_t
cathales Dec 11, 2023
5b159c7
move ICACHE_{OFFSET_WIDTH,NUM_WORDS,CL_IDX_WIDTH}
cathales Dec 11, 2023
e8c8945
move DCACHE_NUM_BANKS{,_WIDTH}
cathales Dec 11, 2023
94f3ed2
inline wt_cache_pkg::CACHE_ID_WIDTH
cathales Dec 12, 2023
ee19871
move DCACHE_MAX_TX
cathales Dec 12, 2023
9eba8e7
inline acc_pkg
cathales Dec 12, 2023
577021a
workaround for hpdcache & cvxif
cathales Dec 12, 2023
a73ba9e
corev_apu takes params from CVA6Cfg
cathales Dec 12, 2023
02a2de9
copy CV-X-IF parameters to CVA6Cfg extended config
cathales Dec 14, 2023
06ebf24
WIP DRAFT DO NOT MERGE dirty partial fixes
cathales Dec 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Bender.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ sources:
# Packages
- core/include/wt_cache_pkg.sv
- core/include/std_cache_pkg.sv
- core/include/acc_pkg.sv

# for all the below files use Flist.cva6 as baseline and also look at Makefile pd/synth
# CVXIF
- core/include/instr_tracer_pkg.sv
Expand Down
1 change: 0 additions & 1 deletion Flist.ariane
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ core/include/riscv_pkg.sv
corev_apu/riscv-dbg/src/dm_pkg.sv
vendor/openhwgroup/cvfpu/src/fpnew_pkg.sv
core/include/ariane_pkg.sv
core/include/acc_pkg.sv
corev_apu/tb/ariane_soc_pkg.sv
vendor/pulp-platform/axi/src/axi_pkg.sv
corev_apu/tb/ariane_axi_pkg.sv
Expand Down
6 changes: 4 additions & 2 deletions common/local/util/instr_tracer.sv
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
`include "ex_trace_item.svh"
`include "instr_trace_item.svh"

module instr_tracer (
module instr_tracer #(
parameter config_pkg::cva6_cfg_t CVA6Cfg = config_pkg::cva6_cfg_empty
)(
instr_tracer_if tracer_if,
input logic[riscv::XLEN-1:0] hart_id_i
input logic[CVA6Cfg.XLEN-1:0] hart_id_i
);

// keep the decoded instructions in a queue
Expand Down
3 changes: 1 addition & 2 deletions core/Flist.cva6
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ ${CVA6_REPO_DIR}/vendor/openhwgroup/cvfpu/src/fpu_div_sqrt_mvp/hdl/norm_div_sqrt
${CVA6_REPO_DIR}/vendor/openhwgroup/cvfpu/src/fpu_div_sqrt_mvp/hdl/nrbd_nrsc_mvp.sv
${CVA6_REPO_DIR}/vendor/openhwgroup/cvfpu/src/fpu_div_sqrt_mvp/hdl/preprocess_mvp.sv

${CVA6_REPO_DIR}/core/include/riscv_pkg.sv
${CVA6_REPO_DIR}/core/include/config_pkg.sv
${CVA6_REPO_DIR}/core/include/${TARGET_CFG}_config_pkg.sv
${CVA6_REPO_DIR}/core/include/riscv_pkg.sv
// Note: depends on fpnew_pkg, above
${CVA6_REPO_DIR}/core/include/ariane_pkg.sv
${CVA6_REPO_DIR}/vendor/pulp-platform/axi/src/axi_pkg.sv
Expand All @@ -67,7 +67,6 @@ ${CVA6_REPO_DIR}/vendor/pulp-platform/axi/src/axi_pkg.sv
${CVA6_REPO_DIR}/core/include/wt_cache_pkg.sv
${CVA6_REPO_DIR}/core/include/std_cache_pkg.sv
${CVA6_REPO_DIR}/core/include/instr_tracer_pkg.sv
${CVA6_REPO_DIR}/core/include/acc_pkg.sv

//CVXIF
${CVA6_REPO_DIR}/core/include/cvxif_pkg.sv
Expand Down
57 changes: 45 additions & 12 deletions core/acc_dispatcher.sv
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,40 @@ module acc_dispatcher
import riscv::*;
#(
parameter config_pkg::cva6_cfg_t CVA6Cfg = config_pkg::cva6_cfg_empty,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
parameter config_pkg::cva6_cfg_t CVA6Cfg = config_pkg::cva6_cfg_empty,
parameter config_pkg::cva6_cfg_t CVA6Cfg = config_pkg::cva6_cfg_empty,

parameter type acc_req_t = acc_pkg::accelerator_req_t,
parameter type acc_resp_t = acc_pkg::accelerator_resp_t,
parameter type exception_t = logic,
parameter type fu_data_t = logic,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
parameter type fu_data_t = logic,
parameter type fu_data_t = logic,

parameter type scoreboard_entry_t = logic,
parameter type dcache_req_i_t = logic,
parameter type dcache_req_o_t = logic,
parameter type acc_req_t = struct packed {
logic req_valid;
logic resp_ready;
riscv::instruction_t insn;
logic [CVA6Cfg.XLEN-1:0] rs1;
logic [CVA6Cfg.XLEN-1:0] rs2;
fpnew_pkg::roundmode_e frm;
Comment on lines +27 to +32
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
logic req_valid;
logic resp_ready;
riscv::instruction_t insn;
logic [CVA6Cfg.XLEN-1:0] rs1;
logic [CVA6Cfg.XLEN-1:0] rs2;
fpnew_pkg::roundmode_e frm;
logic req_valid;
logic resp_ready;
riscv::instruction_t insn;
logic [CVA6Cfg.XLEN-1:0] rs1;
logic [CVA6Cfg.XLEN-1:0] rs2;
fpnew_pkg::roundmode_e frm;

logic [CVA6Cfg.TRANS_ID_BITS-1:0] trans_id;
logic store_pending;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
logic store_pending;
logic store_pending;

// Invalidation interface
logic acc_cons_en;
logic inval_ready;
Comment on lines +36 to +37
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
logic acc_cons_en;
logic inval_ready;
logic acc_cons_en;
logic inval_ready;

},
parameter type acc_resp_t = struct packed {
logic req_ready;
logic resp_valid;
logic [CVA6Cfg.XLEN-1:0] result;
Comment on lines +40 to +42
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
logic req_ready;
logic resp_valid;
logic [CVA6Cfg.XLEN-1:0] result;
logic req_ready;
logic resp_valid;
logic [CVA6Cfg.XLEN-1:0] result;

logic [CVA6Cfg.TRANS_ID_BITS-1:0] trans_id;
logic error;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
logic error;
logic error;

// Metadata
logic store_pending;
logic store_complete;
logic load_complete;
logic [4:0] fflags;
logic fflags_valid;
Comment on lines +46 to +50
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
logic store_pending;
logic store_complete;
logic load_complete;
logic [4:0] fflags;
logic fflags_valid;
logic store_pending;
logic store_complete;
logic load_complete;
logic [4:0] fflags;
logic fflags_valid;

// Invalidation interface
logic inval_valid;
logic [63:0] inval_addr;
Comment on lines +52 to +53
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
logic inval_valid;
logic [63:0] inval_addr;
logic inval_valid;
logic [63:0] inval_addr;

},
parameter type acc_cfg_t = logic,
parameter acc_cfg_t AccCfg = '0
Comment on lines 55 to 56
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
parameter type acc_cfg_t = logic,
parameter acc_cfg_t AccCfg = '0
parameter type acc_cfg_t = logic,
parameter acc_cfg_t AccCfg = '0

) (
Expand All @@ -38,8 +70,8 @@ module acc_dispatcher
output logic issue_stall_o,
input fu_data_t fu_data_i,
input scoreboard_entry_t [CVA6Cfg.NrCommitPorts-1:0] commit_instr_i,
output logic [TRANS_ID_BITS-1:0] acc_trans_id_o,
output xlen_t acc_result_o,
output logic [CVA6Cfg.TRANS_ID_BITS-1:0] acc_trans_id_o,
output logic [CVA6Cfg.XLEN-1:0] acc_result_o,
output logic acc_valid_o,
output exception_t acc_exception_o,
// Interface with the execute stage
Expand Down Expand Up @@ -123,14 +155,15 @@ module acc_dispatcher
logic acc_insn_queue_empty;
logic [idx_width(InstructionQueueDepth)-1:0] acc_insn_queue_usage;
logic acc_commit;
logic [ TRANS_ID_BITS-1:0] acc_commit_trans_id;
logic [ CVA6Cfg.TRANS_ID_BITS-1:0] acc_commit_trans_id;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
logic [ CVA6Cfg.TRANS_ID_BITS-1:0] acc_commit_trans_id;
logic [ CVA6Cfg.TRANS_ID_BITS-1:0] acc_commit_trans_id;


assign acc_data = acc_valid_ex_o ? fu_data_i : '0;

fifo_v3 #(
.DEPTH (InstructionQueueDepth),
.FALL_THROUGH(1'b1),
.dtype (fu_data_t)
.dtype (fu_data_t),
.FPGA_EN (CVA6Cfg.FPGA_EN)
) i_acc_insn_queue (
.clk_i (clk_i),
.rst_ni (rst_ni),
Expand All @@ -153,13 +186,13 @@ module acc_dispatcher
**********************************/

// Keep track of the instructions that were received by the dispatcher.
logic [NR_SB_ENTRIES-1:0] insn_pending_d, insn_pending_q;
logic [CVA6Cfg.NR_SB_ENTRIES-1:0] insn_pending_d, insn_pending_q;
`FF(insn_pending_q, insn_pending_d, '0)

// Only non-speculative instructions can be issued to the accelerators.
// The following block keeps track of which transaction IDs reached the
// top of the scoreboard, and are therefore no longer speculative.
logic [NR_SB_ENTRIES-1:0] insn_ready_d, insn_ready_q;
logic [CVA6Cfg.NR_SB_ENTRIES-1:0] insn_ready_d, insn_ready_q;
`FF(insn_ready_q, insn_ready_d, '0)

always_comb begin : p_non_speculative_ff
Expand All @@ -186,13 +219,13 @@ module acc_dispatcher
* Accelerator request *
*************************/

acc_pkg::accelerator_req_t acc_req;
acc_req_t acc_req;
logic acc_req_valid;
logic acc_req_ready;
Comment on lines 223 to 224
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
logic acc_req_valid;
logic acc_req_ready;
logic acc_req_valid;
logic acc_req_ready;


acc_pkg::accelerator_req_t acc_req_int;
acc_req_t acc_req_int;
fall_through_register #(
.T(acc_pkg::accelerator_req_t)
.T(acc_req_t)
) i_accelerator_req_register (
.clk_i (clk_i),
.rst_ni (rst_ni),
Expand Down Expand Up @@ -223,7 +256,7 @@ module acc_dispatcher
acc_req = '0;
acc_req_valid = 1'b0;

// Unpack fu_data_t into accelerator_req_t
// Unpack fu_data_t into acc_req_t
if (!acc_insn_queue_empty) begin
acc_req = '{
// Instruction is forwarded from the decoder as an immediate
Expand Down
Loading