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

[Scratchpads] Needed packages for scratchpads and ahb peripheral bus #2458

Open
wants to merge 34 commits into
base: feature/scratchpads
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
1b8f2ad
Add packages for scratchpad and AHB periph.
CoralieAllioux Aug 23, 2024
e6b4236
Merge branch 'scratchpad-periphbus-packages' into feature/scratchpads
CoralieAllioux Aug 23, 2024
887be36
Remove patch
CoralieAllioux Aug 23, 2024
b3feeb7
Add address decoder for scratchpad and ahb periph regions
CoralieAllioux Aug 23, 2024
b58ae5d
Merge branch 'scratchpads/address_decoder' into feature/scratchpads
CoralieAllioux Aug 23, 2024
2ab02dd
Add parameters for ahb peripheral bus, data and instruction scratchpads
CoralieAllioux Aug 26, 2024
aa276ed
Add new parameters in all cva6 configurations
CoralieAllioux Aug 26, 2024
ba33f04
Add function to check if an address is inside scratchpads / ahb peirp…
CoralieAllioux Aug 26, 2024
b0aa116
Apply verible
CoralieAllioux Aug 26, 2024
2aae707
Merge branch 'scratchpads/parameters' into feature/scratchpads
CoralieAllioux Aug 27, 2024
400f176
Add ahb master adapter: used for ahb peripheral bus
CoralieAllioux Aug 26, 2024
a105964
Merge branch 'periph_bus/ahb_master' into feature/scratchpads
CoralieAllioux Aug 27, 2024
273a67a
Add AHB peripheral bus module
CoralieAllioux Aug 26, 2024
679d19b
Merge branch 'periph_bus/periph_bus' into feature/scratchpads
CoralieAllioux Aug 27, 2024
b10e82d
Add sram_controller: used for scratchpads
CoralieAllioux Aug 26, 2024
2f76258
Merge branch 'scratchpad/sram_controller' into feature/scratchpads
CoralieAllioux Aug 27, 2024
0b39bcf
Add AHB slave module
CoralieAllioux Aug 29, 2024
dd817f5
Add ahb slave in flist and missing files
CoralieAllioux Aug 29, 2024
a8f0a11
Add data scratchpad controller module
CoralieAllioux Aug 29, 2024
60cbf57
Add dscr controller to filelist
CoralieAllioux Aug 29, 2024
3013a54
Add instruction scratchpad controller
CoralieAllioux Aug 29, 2024
7e7fcc7
Add iscr controller to filelist
CoralieAllioux Aug 29, 2024
cb5d33f
Integrate address decoder in store buffer for scratchpads and create …
CoralieAllioux Aug 30, 2024
16754f5
Merge branch 'scratchpad/store_buffer' into feature/scratchpads
CoralieAllioux Aug 30, 2024
7193e34
Integrate new port list for store_buffer and handle exceptions with n…
CoralieAllioux Aug 30, 2024
195cced
Merge branch 'scratchpad/store_unit' into feature/scratchpads
CoralieAllioux Aug 30, 2024
3553487
Integrate new port list for store_unit and load_unit in load_store_un…
CoralieAllioux Aug 30, 2024
acf2531
Merge branch 'scratchpad/ex_stage' into feature/scratchpads
CoralieAllioux Aug 30, 2024
483caa0
Add needed localparam type for scratchpads and ahb pierphe + integrat…
CoralieAllioux Aug 30, 2024
664917a
Declare needed signals to integrate scratchpads and periph bus
CoralieAllioux Aug 30, 2024
bb52e97
Instantiate ex_stage with additional IOs
CoralieAllioux Aug 30, 2024
9b2c9db
Add address decoder after frontend to support scratchpad targets
CoralieAllioux Aug 30, 2024
71c8fa2
Instantiate dscr and iscr sram and associate controllers; instantiate…
CoralieAllioux Aug 30, 2024
d8b7f5c
Merge branch 'scratchpad/cva6_top' into feature/scratchpads
CoralieAllioux Aug 30, 2024
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
5 changes: 4 additions & 1 deletion core/Flist.cva6
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ ${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/build_config_pkg.sv
${CVA6_REPO_DIR}/core/include/ahb_pkg.sv
${CVA6_REPO_DIR}/core/include/address_decoder_pkg.sv
${CVA6_REPO_DIR}/core/include/scratchpad_pkg.sv

//CVXIF
${CVA6_REPO_DIR}/core/include/cvxif_pkg.sv
Expand Down Expand Up @@ -193,4 +196,4 @@ ${CVA6_REPO_DIR}/core/cva6_mmu/cva6_ptw.sv
${CVA6_REPO_DIR}/core/cva6_mmu/cva6_tlb.sv
${CVA6_REPO_DIR}/core/cva6_mmu/cva6_shared_tlb.sv

// end of manifest
// end of manifest
23 changes: 23 additions & 0 deletions core/include/address_decoder_pkg.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//-----------------------------------------------------------------------------
// Copyright 2024 Robert Bosch GmbH
//
// SPDX-License-Identifier: SHL-0.51
//
// Original Author: Coralie Allioux - Robert Bosch France SAS
//-----------------------------------------------------------------------------

package address_decoder_pkg;

// ----------------------
// Address Decoder Mode
// ----------------------

localparam DECODER_MODE_WIDTH = 2;
typedef enum logic [DECODER_MODE_WIDTH-1:0] {
DECODER_MODE_CACHE,
DECODER_MODE_DSCR,
DECODER_MODE_ISCR,
DECODER_MODE_AHB_PERIPH
} addr_dec_mode_e;

endpackage
29 changes: 29 additions & 0 deletions core/include/ahb_pkg.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//-----------------------------------------------------------------------------
// Copyright 2024 Robert Bosch GmbH
//
// SPDX-License-Identifier: SHL-0.51
//
// Original Author: Coralie Allioux - Robert Bosch France SAS
//-----------------------------------------------------------------------------

package ahb_pkg;

localparam AHBSizeWidth = 3;
localparam AHBTransWidth = 2;
localparam AHBBurstWidth = 3;
localparam AHBProtWidth = 4;

typedef logic [AHBSizeWidth-1:0] size_t;
typedef logic [AHBTransWidth-1:0] trans_t;
typedef logic [AHBBurstWidth-1:0] burst_t;
typedef logic [AHBProtWidth-1:0] prot_t;

// htrans values
typedef enum logic [AHBTransWidth-1:0] {
AHB_TRANS_IDLE,
AHB_TRANS_BUSY,
AHB_TRANS_NONSEQ,
AHB_TRANS_SEQ
} ahb_trans_e;

endpackage
38 changes: 38 additions & 0 deletions core/include/scratchpad_pkg.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//-----------------------------------------------------------------------------
// Copyright 2024 Robert Bosch GmbH
//
// SPDX-License-Identifier: SHL-0.51
//
// Original Author: Coralie Allioux - Robert Bosch France SAS
//-----------------------------------------------------------------------------

package scratchpad_pkg;

// ----------------------
// Instruction Scratchpad Mode
// ----------------------
typedef enum logic {
ISCR_MODE_FUNCTIONAL,
ISCR_MODE_PRELOAD
} iscr_mode_t;

// ----------------------
// Arbit values
// ----------------------
localparam DSCR_ARBIT_NUM_IN = 3;
localparam ISCR_ARBIT_NUM_IN = 4;

typedef enum logic [$clog2(ISCR_ARBIT_NUM_IN)-1:0] {
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
typedef enum logic [$clog2(ISCR_ARBIT_NUM_IN)-1:0] {
typedef enum logic [$clog2(
ISCR_ARBIT_NUM_IN
)-1:0] {

ISCR_ARBIT_LOAD,
ISCR_ARBIT_STORE,
ISCR_ARBIT_AHB,
ISCR_ARBIT_FRONTEND
} iscr_arbit_e;

typedef enum logic [$clog2(DSCR_ARBIT_NUM_IN)-1:0] {
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
typedef enum logic [$clog2(DSCR_ARBIT_NUM_IN)-1:0] {
typedef enum logic [$clog2(
DSCR_ARBIT_NUM_IN
)-1:0] {

DSCR_ARBIT_LOAD,
DSCR_ARBIT_STORE,
DSCR_ARBIT_AHB
} dscr_arbit_e;

endpackage
129 changes: 129 additions & 0 deletions scratchpad-periphbus-packages.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
diff --git a/core/Flist.cva6 b/core/Flist.cva6
index aa885261..b22d2849 100644
--- a/core/Flist.cva6
+++ b/core/Flist.cva6
@@ -69,6 +69,9 @@ ${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/build_config_pkg.sv
+${CVA6_REPO_DIR}/core/include/ahb_pkg.sv
+${CVA6_REPO_DIR}/core/include/address_decoder_pkg.sv
+${CVA6_REPO_DIR}/core/include/scratchpad_pkg.sv

//CVXIF
${CVA6_REPO_DIR}/core/include/cvxif_pkg.sv
@@ -193,4 +196,4 @@ ${CVA6_REPO_DIR}/core/cva6_mmu/cva6_ptw.sv
${CVA6_REPO_DIR}/core/cva6_mmu/cva6_tlb.sv
${CVA6_REPO_DIR}/core/cva6_mmu/cva6_shared_tlb.sv

-// end of manifest
+// end of manifest
\ No newline at end of file
diff --git a/core/include/address_decoder_pkg.sv b/core/include/address_decoder_pkg.sv
new file mode 100644
index 00000000..4f4073e7
--- /dev/null
+++ b/core/include/address_decoder_pkg.sv
@@ -0,0 +1,23 @@
+//-----------------------------------------------------------------------------
+// Copyright 2024 Robert Bosch GmbH
+//
+// SPDX-License-Identifier: SHL-0.51
+//
+// Original Author: Coralie Allioux - Robert Bosch France SAS
+//-----------------------------------------------------------------------------
+
+package address_decoder_pkg;
+
+ // ----------------------
+ // Address Decoder Mode
+ // ----------------------
+
+ localparam DECODER_MODE_WIDTH = 2;
+ typedef enum logic [DECODER_MODE_WIDTH-1:0] {
+ DECODER_MODE_CACHE,
+ DECODER_MODE_DSCR,
+ DECODER_MODE_ISCR,
+ DECODER_MODE_AHB_PERIPH
+ } addr_dec_mode_e;
+
+endpackage
diff --git a/core/include/ahb_pkg.sv b/core/include/ahb_pkg.sv
new file mode 100644
index 00000000..ed9be392
--- /dev/null
+++ b/core/include/ahb_pkg.sv
@@ -0,0 +1,29 @@
+//-----------------------------------------------------------------------------
+// Copyright 2024 Robert Bosch GmbH
+//
+// SPDX-License-Identifier: SHL-0.51
+//
+// Original Author: Coralie Allioux - Robert Bosch France SAS
+//-----------------------------------------------------------------------------
+
+package ahb_pkg;
+
+ localparam AHBSizeWidth = 3;
+ localparam AHBTransWidth = 2;
+ localparam AHBBurstWidth = 3;
+ localparam AHBProtWidth = 4;
+
+ typedef logic [AHBSizeWidth-1:0] size_t;
+ typedef logic [AHBTransWidth-1:0] trans_t;
+ typedef logic [AHBBurstWidth-1:0] burst_t;
+ typedef logic [AHBProtWidth-1:0] prot_t;
+
+ // htrans values
+ typedef enum logic [AHBTransWidth-1:0] {
+ AHB_TRANS_IDLE,
+ AHB_TRANS_BUSY,
+ AHB_TRANS_NONSEQ,
+ AHB_TRANS_SEQ
+ } ahb_trans_e;
+
+endpackage
diff --git a/core/include/scratchpad_pkg.sv b/core/include/scratchpad_pkg.sv
new file mode 100644
index 00000000..f9173ae5
--- /dev/null
+++ b/core/include/scratchpad_pkg.sv
@@ -0,0 +1,38 @@
+//-----------------------------------------------------------------------------
+// Copyright 2024 Robert Bosch GmbH
+//
+// SPDX-License-Identifier: SHL-0.51
+//
+// Original Author: Coralie Allioux - Robert Bosch France SAS
+//-----------------------------------------------------------------------------
+
+package scratchpad_pkg;
+
+ // ----------------------
+ // Instruction Scratchpad Mode
+ // ----------------------
+ typedef enum logic {
+ ISCR_MODE_FUNCTIONAL,
+ ISCR_MODE_PRELOAD
+ } iscr_mode_t;
+
+ // ----------------------
+ // Arbit values
+ // ----------------------
+ localparam DSCR_ARBIT_NUM_IN = 3;
+ localparam ISCR_ARBIT_NUM_IN = 4;
+
+ typedef enum logic [$clog2(ISCR_ARBIT_NUM_IN)-1:0] {
+ ISCR_ARBIT_LOAD,
+ ISCR_ARBIT_STORE,
+ ISCR_ARBIT_AHB,
+ ISCR_ARBIT_FRONTEND
+ } iscr_arbit_e;
+
+ typedef enum logic [$clog2(DSCR_ARBIT_NUM_IN)-1:0] {
+ DSCR_ARBIT_LOAD,
+ DSCR_ARBIT_STORE,
+ DSCR_ARBIT_AHB
+ } dscr_arbit_e;
+
+endpackage
Loading