Skip to content

Commit

Permalink
tmp: port icache to snitch's icache
Browse files Browse the repository at this point in the history
  • Loading branch information
micprog committed Feb 7, 2024
1 parent 885856a commit eb23b9b
Show file tree
Hide file tree
Showing 5 changed files with 409 additions and 366 deletions.
31 changes: 11 additions & 20 deletions Bender.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
packages:
axi:
revision: fd60be8b51a4fa7476856be162ce3334474592ba
version: 0.39.0-beta.4
revision: fccffb5953ec8564218ba05e20adbedec845e014
version: 0.39.1
source:
Git: https://github.com/pulp-platform/axi.git
dependencies:
Expand Down Expand Up @@ -105,18 +105,6 @@ packages:
- cluster_interconnect
- hwpe-stream
- l2_tcdm_hybrid_interco
hier-icache:
revision: fc231dfc9559c6715c3577049eae3d1887282cb0
version: null
source:
Git: https://github.com/pulp-platform/hier-icache.git
dependencies:
- axi
- axi_slice
- common_cells
- icache-intc
- scm
- tech_cells_generic
hwpe-ctrl:
revision: 1916c72f024175f1fe351acc3db3c6e9925a117d
version: 1.7.3
Expand Down Expand Up @@ -147,12 +135,6 @@ packages:
Git: https://github.com/lowRISC/ibex.git
dependencies:
- tech_cells_generic
icache-intc:
revision: 663c3b6d3c2bf63ff25cda46f33c799c647b3985
version: 1.0.1
source:
Git: https://github.com/pulp-platform/icache-intc.git
dependencies: []
l2_tcdm_hybrid_interco:
revision: fa55e72859dcfb117a2788a77352193bef94ff2b
version: 1.0.0
Expand All @@ -179,6 +161,15 @@ packages:
source:
Git: https://github.com/pulp-platform/scm.git
dependencies: []
snitch_icache:
revision: null
version: null
source:
Path: ../snitch_icache
dependencies:
- axi
- common_cells
- tech_cells_generic
tech_cells_generic:
revision: 7968dd6e6180df2c644636bc6d2908a49f2190cf
version: 0.2.13
Expand Down
5 changes: 3 additions & 2 deletions Bender.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ dependencies:
cluster_interconnect: { git: "https://github.com/pulp-platform/cluster_interconnect.git", version: 1.1.1 }
event_unit_flex: { git: "https://github.com/pulp-platform/event_unit_flex.git", rev: "1.4.1" }
mchan: { git: "https://github.com/pulp-platform/mchan.git", version: 1.2.3 }
hier-icache: { git: "https://github.com/pulp-platform/hier-icache.git", rev: "fc231dfc9559c6715c3577049eae3d1887282cb0" }
# hier-icache: { git: "https://github.com/pulp-platform/hier-icache.git", rev: "fc231dfc9559c6715c3577049eae3d1887282cb0" }
snitch_icache: { path: "../snitch_icache" }
# icache_mp_128_pf: { git: "https://github.com/pulp-platform/icache_mp_128_pf.git", rev: "6f2e54102001230db9c82432bf9e011842419a48" }
# icache_private: { git: "https://github.com/pulp-platform/icache_private.git", rev: "1d4cdbcbec3ab454c09d378fc55631b60450fccd" }
cluster_peripherals: { git: "https://github.com/pulp-platform/cluster_peripherals.git", version: 2.1.0 }
fpu_interco: { git: "https://github.com/pulp-platform/fpu_interco.git", rev: "66b4084117546d5b748c30b5500769805f489d2f" }
axi: { git: "https://github.com/pulp-platform/axi.git", version: =0.39.0-beta.4 }
axi: { git: "https://github.com/pulp-platform/axi.git", version: 0.39.1 }
axi_slice: { git: "https://github.com/pulp-platform/axi_slice.git", version: 1.1.4 } # deprecated, replaced by axi_cut (in axi repo)
timer_unit: { git: "https://github.com/pulp-platform/timer_unit.git", version: 1.0.2 }
common_cells: { git: "https://github.com/pulp-platform/common_cells.git", version: 1.21.0 }
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ sim_clean:
rm -rf work

scripts/compile.tcl: | Bender.lock
$(call generate_vsim, $@, -t rtl -t test -t cluster_standalone,..)
$(call generate_vsim, $@, -t rtl -t test -t pulp -t cluster_standalone,..)
echo 'vlog "$(realpath $(ROOT_DIR))/tb/dpi/elfloader.cpp" -ccflags "-std=c++11"' >> $@

$(library):
Expand Down
103 changes: 55 additions & 48 deletions rtl/cluster_peripherals.sv
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import pulp_cluster_package::*;

`include "pulp_soc_defines.sv"
`include "common_cells/registers.svh"

module cluster_peripherals
#(
Expand Down Expand Up @@ -292,58 +293,64 @@ module cluster_peripherals
//******************** icache_ctrl_unit ******************
//********************************************************


assign enable_l1_l15_prefetch_o = '1;
assign speriph_slave[SPER_ICACHE_CTRL].gnt = '1;
assign speriph_slave[SPER_ICACHE_CTRL].r_rdata = '0;
assign speriph_slave[SPER_ICACHE_CTRL].r_opc = '0;

`FF(speriph_slave[SPER_ICACHE_CTRL].r_valid, speriph_slave[SPER_ICACHE_CTRL].req, '0);
`FF(speriph_slave[SPER_ICACHE_CTRL].r_id, speriph_slave[SPER_ICACHE_CTRL].id, '0);

`ifdef PRIVATE_ICACHE //to be integrated hier_icache
// `ifdef PRIVATE_ICACHE //to be integrated hier_icache

hier_icache_ctrl_unit_wrap #(
.NB_CACHE_BANKS ( NB_CACHE_BANKS ),
.NB_CORES ( NB_CORES ),
.ID_WIDTH ( NB_CORES+NB_MPERIPHS )
) icache_ctrl_unit_i (
.clk_i ( clk_i ),
.rst_ni ( rst_ni ),
// hier_icache_ctrl_unit_wrap #(
// .NB_CACHE_BANKS ( NB_CACHE_BANKS ),
// .NB_CORES ( NB_CORES ),
// .ID_WIDTH ( NB_CORES+NB_MPERIPHS )
// ) icache_ctrl_unit_i (
// .clk_i ( clk_i ),
// .rst_ni ( rst_ni ),

.speriph_slave ( speriph_slave[SPER_ICACHE_CTRL] ),
.IC_ctrl_unit_bus_pri ( IC_ctrl_unit_bus_pri ),
.IC_ctrl_unit_bus_main ( IC_ctrl_unit_bus_main ),
.enable_l1_l15_prefetch_o ( enable_l1_l15_prefetch_o )
);
// .speriph_slave ( speriph_slave[SPER_ICACHE_CTRL] ),
// .IC_ctrl_unit_bus_pri ( IC_ctrl_unit_bus_pri ),
// .IC_ctrl_unit_bus_main ( IC_ctrl_unit_bus_main ),
// .enable_l1_l15_prefetch_o ( enable_l1_l15_prefetch_o )
// );

`else
`ifdef MP_ICACHE
mp_pf_icache_ctrl_unit #(
.NB_CACHE_BANKS ( NB_CACHE_BANKS ),
.NB_CORES ( NB_CORES ),
.ID_WIDTH ( NB_CORES+NB_MPERIPHS ),
.FEATURE_STAT ( FEATURE_STAT )
) icache_ctrl_unit_i (
.clk_i ( clk_i ),
.rst_ni ( rst_ni ),

.speriph_slave ( speriph_slave[SPER_ICACHE_CTRL] ),
.IC_ctrl_unit_master_if ( IC_ctrl_unit_bus ),
.pf_event_o ( )
);
`else
`ifdef SP_ICACHE
sp_icache_ctrl_unit #(
.NB_CACHE_BANKS ( NB_CACHE_BANKS ),
.NB_CORES ( NB_CORES ),
.ID_WIDTH ( NB_CORES+NB_MPERIPHS ),
.OFFSET ( 4 ),
.FEATURE_STAT ( FEATURE_STAT )
) icache_ctrl_unit_i (
.clk_i ( clk_i ),
.rst_ni ( rst_ni ),

.speriph_slave ( speriph_slave[SPER_ICACHE_CTRL] ),
.IC_ctrl_unit_master_if ( IC_ctrl_unit_bus ),
.L0_ctrl_unit_master_if ( L0_ctrl_unit_bus )
);
`endif
`endif
`endif
// `else
// `ifdef MP_ICACHE
// mp_pf_icache_ctrl_unit #(
// .NB_CACHE_BANKS ( NB_CACHE_BANKS ),
// .NB_CORES ( NB_CORES ),
// .ID_WIDTH ( NB_CORES+NB_MPERIPHS ),
// .FEATURE_STAT ( FEATURE_STAT )
// ) icache_ctrl_unit_i (
// .clk_i ( clk_i ),
// .rst_ni ( rst_ni ),

// .speriph_slave ( speriph_slave[SPER_ICACHE_CTRL] ),
// .IC_ctrl_unit_master_if ( IC_ctrl_unit_bus ),
// .pf_event_o ( )
// );
// `else
// `ifdef SP_ICACHE
// sp_icache_ctrl_unit #(
// .NB_CACHE_BANKS ( NB_CACHE_BANKS ),
// .NB_CORES ( NB_CORES ),
// .ID_WIDTH ( NB_CORES+NB_MPERIPHS ),
// .OFFSET ( 4 ),
// .FEATURE_STAT ( FEATURE_STAT )
// ) icache_ctrl_unit_i (
// .clk_i ( clk_i ),
// .rst_ni ( rst_ni ),

// .speriph_slave ( speriph_slave[SPER_ICACHE_CTRL] ),
// .IC_ctrl_unit_master_if ( IC_ctrl_unit_bus ),
// .L0_ctrl_unit_master_if ( L0_ctrl_unit_bus )
// );
// `endif
// `endif
// `endif

//********************************************************
//******************** DMA CL CONFIG PORT ****************
Expand Down
Loading

0 comments on commit eb23b9b

Please sign in to comment.