Skip to content

Commit 68a038c

Browse files
DiyouSalex96295
authored andcommitted
LLC Partition: Add LLC partitioning part into cheshire.
Update the axi-test for llc partitioning tests. WIP: Ensure correct FPGA behavior (CI test)
1 parent 7a2d040 commit 68a038c

File tree

10 files changed

+2046
-1839
lines changed

10 files changed

+2046
-1839
lines changed

Bender.lock

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ packages:
1515
- apb
1616
- register_interface
1717
axi:
18-
revision: bfee21757bf090ec8e358456314b0b0fd3c90809
19-
version: 0.39.0
18+
revision: 4fb5a02ef5c96396ac2157bcaf09bb6a05b6a87d
19+
version: null
2020
source:
2121
Git: https://github.com/pulp-platform/axi.git
2222
dependencies:
2323
- common_cells
2424
- common_verification
2525
- tech_cells_generic
2626
axi_llc:
27-
revision: 559bcbd09a5a884dbe31e2d72fd95d024e357f39
28-
version: 0.2.1
27+
revision: 39ee9575279b3d1fe119616be07f485eb33df52b
28+
version: null
2929
source:
3030
Git: https://github.com/pulp-platform/axi_llc.git
3131
dependencies:
@@ -179,9 +179,20 @@ packages:
179179
- axi
180180
- common_cells
181181
- register_interface
182+
tagger:
183+
revision: 044d92c17728e7c608cd6678d01ec2d749c7ab83
184+
version: null
185+
source:
186+
Git: [email protected]:dishen/tagger.git
187+
dependencies:
188+
- axi
189+
- common_cells
190+
- common_verification
191+
- register_interface
192+
- tech_cells_generic
182193
tech_cells_generic:
183-
revision: 298b7297d220ba2601d0f24f684f97ff32f61123
184-
version: 0.2.12
194+
revision: c53f93c327ec3cceceef46a38fb03bcd93c166db
195+
version: null
185196
source:
186197
Git: https://github.com/pulp-platform/tech_cells_generic.git
187198
dependencies:

Bender.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ package:
1313

1414
dependencies:
1515
apb_uart: { git: "https://github.com/pulp-platform/apb_uart.git", version: 0.2.1 }
16-
axi: { git: "https://github.com/pulp-platform/axi.git", version: 0.39.0 }
17-
axi_llc: { git: "https://github.com/pulp-platform/axi_llc.git", version: 0.2.1 }
16+
axi: { git: "https://github.com/pulp-platform/axi", rev: 4fb5a02 }
17+
axi_llc: { git: "https://github.com/pulp-platform/axi_llc", rev: 39ee957 }
1818
axi_riscv_atomics: { git: "https://github.com/pulp-platform/axi_riscv_atomics.git", version: 0.8.1 }
1919
axi_rt: { git: "https://github.com/pulp-platform/axi_rt.git", rev: 6c00b92 }
2020
axi_vga: { git: "https://github.com/pulp-platform/axi_vga.git", version: 0.1.1 }
@@ -30,6 +30,7 @@ dependencies:
3030
clic: { git: "https://github.com/pulp-platform/clic.git", version: 2.0.0 }
3131
irq_router: { git: "https://github.com/pulp-platform/irq_router.git", rev: d1d3135 } # TODO: master commit; use next release once out
3232
bus_err_unit: { git: "[email protected]:carfield/bus_err_unit.git", rev: "47a6436" } # branch: main
33+
tagger: { git: "[email protected]:dishen/tagger.git", rev: 044d92c }
3334

3435
export_include_dirs:
3536
- hw/include

cheshire.mk

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@ BENDER ?= bender
1111
VLOG_ARGS ?= -suppress 2583 -suppress 13314
1212
VSIM ?= vsim
1313

14+
MAXPARTITION ?= 16
15+
CACHE_PARTITION ?= 1
16+
17+
1418
# Define used paths (prefixed to avoid name conflicts)
1519
CHS_ROOT ?= $(shell $(BENDER) path cheshire)
1620
CHS_REG_DIR := $(shell $(BENDER) path register_interface)
1721
CHS_SLINK_DIR := $(shell $(BENDER) path serial_link)
1822
CHS_LLC_DIR := $(shell $(BENDER) path axi_llc)
23+
CHS_TAGGER_DIR := $(shell $(BENDER) path tagger)
1924

2025
# Define paths used in dependencies
2126
OTPROOT := $(shell $(BENDER) path opentitan_peripherals)
@@ -102,12 +107,24 @@ $(CHS_SLINK_DIR)/.generated: $(CHS_ROOT)/hw/serial_link.hjson
102107
cp $< $(dir $@)/src/regs/serial_link_single_channel.hjson
103108
flock -x $@ $(MAKE) -C $(CHS_SLINK_DIR) update-regs && touch $@
104109

110+
# LLC partitioning configuration
111+
$(CHS_LLC_DIR)/.generated:
112+
$(MAKE) -C $(CHS_LLC_DIR) REGWIDTH=64 CACHENUMLINES=256 MAXPARTITION=$(MAXPARTITION) CACHE_PARTITION=$(CACHE_PARTITION) regs
113+
@touch $@
114+
115+
# Tagger configuration
116+
$(CHS_TAGGER_DIR)/.generated:
117+
$(MAKE) -C $(CHS_TAGGER_DIR) REGWIDTH=32 MAXPARTITION=$(MAXPARTITION) PATID_LEN=5 regs
118+
@touch $@
119+
105120
CHS_HW_ALL += $(CHS_ROOT)/hw/regs/cheshire_reg_pkg.sv $(CHS_ROOT)/hw/regs/cheshire_reg_top.sv
106121
CHS_HW_ALL += $(CLINTROOT)/.generated
107122
CHS_HW_ALL += $(OTPROOT)/.generated
108123
CHS_HW_ALL += $(AXIRTROOT)/.generated
109124
CHS_HW_ALL += $(AXI_VGA_ROOT)/.generated
110125
CHS_HW_ALL += $(CHS_SLINK_DIR)/.generated
126+
CHS_HW_ALL += $(CHS_LLC_DIR)/.generated
127+
CHS_HW_ALL += $(CHS_TAGGER_DIR)/.generated
111128

112129
#####################
113130
# Generate Boot ROM #

hw/bootrom/cheshire_bootrom.S

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,44 @@ _start:
6262
andi t0, t0, 2 // regs.HW_FEATURES.llc
6363
beqz t0, _prom_check_run
6464
la t0, __base_llc
65+
// Only configure half of LLC as SPM
6566
_wait_llc_bist:
6667
lw t1, 72(t0) // llc.BIST_STATUS_DONE_BIT
6768
beqz t1, _wait_llc_bist
69+
70+
// Cache partitioning
71+
72+
// li t1, 0xFF // Flush LLC
73+
// sw t1, 8(t0)
74+
// li t1, 1
75+
// sw t1, 16(t0)
76+
77+
// Set tagger region
78+
lui t1, 0x9
79+
add t0, t1, t0
80+
lui t1, 0xFFFFF // 0xFFFF_F000
81+
sw t1, 4(t0)
82+
83+
// set patid to 0
84+
li t1, 0
85+
sw t1, 68(t0) // 0x44
86+
87+
// set mode to TOR
88+
li t1, 0x1
89+
sw t1, 80(t0) // 0x50
90+
91+
// commit changes
92+
li t1, 0x1
93+
sw t1, 0(t0)
94+
95+
la t0, __base_llc
96+
97+
// lui t1, 0x4 // give partition 2 size 64
98+
// sw t1, 84(t0) // partition table configuration
99+
// li t1, 1
100+
// sw t1, 100(t0) // commit partition configuration
101+
102+
68103
li t1, -1
69104
sw t1, 0(t0) // llc.CFG_SPM_LOW
70105
sw t1, 4(t0) // llc.CFG_SPM_HIGH

0 commit comments

Comments
 (0)