Skip to content

Commit 535145f

Browse files
collucaRaphael RothLore0599fischeti
authored
treewide: Support reduction and DCA (#260)
Co-authored-by: Raphael Roth <[email protected]> Co-authored-by: Lorenzo Leone <[email protected]> Co-authored-by: Tim Fischer <[email protected]>
1 parent f8f2fe5 commit 535145f

File tree

80 files changed

+2604
-1155
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+2604
-1155
lines changed

Bender.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ packages:
77
dependencies:
88
- common_cells
99
axi:
10-
revision: bd1abffc0812f8170902e5fb93142c7785c0b8c1
10+
revision: 06410c36819924e32db2afa428d244dbdbcd5d4e
1111
version: null
1212
source:
13-
Git: https://github.com/colluca/axi.git
13+
Git: https://github.com/colluca/axi
1414
dependencies:
1515
- common_cells
1616
- common_verification
@@ -42,7 +42,7 @@ packages:
4242
- scm
4343
- tech_cells_generic
4444
common_cells:
45-
revision: bef3d3c5ed0e2cc211e69a6dbd81c4fe3a97025c
45+
revision: ca9d577f2fbc45ec557ab4e0905bbfc154441540
4646
version: null
4747
source:
4848
Git: https://github.com/pulp-platform/common_cells.git
@@ -71,8 +71,8 @@ packages:
7171
dependencies:
7272
- common_cells
7373
idma:
74-
revision: 7829f71691a62c1e2e5e3230f370f222c7a83087
75-
version: null
74+
revision: 28a36e5e07705549e59fc33db96ab681bc1ca88e
75+
version: 0.6.5
7676
source:
7777
Git: https://github.com/pulp-platform/iDMA.git
7878
dependencies:

Bender.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,32 @@ package:
1919
- Matheus Cavalcante <[email protected]>
2020

2121
dependencies:
22-
axi: { git: https://github.com/colluca/axi, rev: multicast }
22+
axi: { git: https://github.com/colluca/axi, rev: multicast }
2323
axi_riscv_atomics: { git: https://github.com/pulp-platform/axi_riscv_atomics, version: 0.6.0 }
2424
common_cells: { git: https://github.com/pulp-platform/common_cells, rev: snitch }
2525
apb: { git: https://github.com/pulp-platform/apb.git, version: 0.2.2 }
2626
FPnew: { git: https://github.com/pulp-platform/cvfpu.git, rev: pulp-v0.1.3 }
2727
tech_cells_generic: { git: https://github.com/pulp-platform/tech_cells_generic, version: 0.2.13 }
2828
riscv-dbg: { git: https://github.com/pulp-platform/riscv-dbg, version: 0.8.0 }
2929
cluster_icache: { git: https://github.com/pulp-platform/cluster_icache.git, rev: 64e21ae455bbdde850c4df13bef86ea55ac42537 }
30-
idma: { git: https://github.com/pulp-platform/iDMA.git, rev: __deploy__bebefa3__master }
30+
idma: { git: https://github.com/pulp-platform/iDMA.git, version: 0.6.5 }
3131

3232
export_include_dirs:
3333
- hw/reqrsp_interface/include
3434
- hw/mem_interface/include
3535
- hw/tcdm_interface/include
36+
- hw/dca_interface/include
3637
- hw/snitch/include
38+
- hw/snitch_fp_ss/include
3739
- hw/snitch_ssr/include
3840
- hw/generated
3941

4042
sources:
4143
# reqrsp_interface
4244
- files:
4345
# Level 0
46+
- hw/reqrsp_interface/src/generic_reqrsp_cut.sv
47+
- hw/reqrsp_interface/src/generic_reqrsp_mux.sv
4448
- hw/reqrsp_interface/src/reqrsp_pkg.sv
4549
# Level 1
4650
- hw/reqrsp_interface/src/reqrsp_intf.sv
@@ -89,6 +93,10 @@ sources:
8993
- hw/tcdm_interface/test/reqrsp_to_tcdm_tb.sv
9094
- hw/tcdm_interface/test/tcdm_mux_tb.sv
9195

96+
# dca_interface
97+
- files:
98+
- hw/dca_interface/src/dca_fork.sv
99+
92100
# snitch
93101
- files:
94102
# Level 0
@@ -149,20 +157,25 @@ sources:
149157
# Level 1
150158
- hw/snitch_ipu/src/snitch_ipu.sv
151159

160+
# snitch_fp_ss
161+
- files:
162+
# Level 0
163+
- hw/snitch_fp_ss/src/snitch_fpu.sv
164+
- hw/snitch_fp_ss/src/snitch_sequencer.sv
165+
# Level 1
166+
- hw/snitch_fp_ss/src/snitch_fp_ss.sv
167+
152168
# snitch_cluster
153169
- files:
154170
# Level 0
155171
- hw/snitch_cluster/src/snitch_amo_shim.sv
156172
- hw/snitch_cluster/src/snitch_cluster_peripheral/snitch_cluster_peripheral_reg_pkg.sv
157173
- hw/snitch_cluster/src/snitch_cluster_peripheral/snitch_cluster_peripheral_reg.sv
158174
- hw/snitch_cluster/src/snitch_cluster_peripheral/snitch_cluster_peripheral.sv
159-
- hw/snitch_cluster/src/snitch_fpu.sv
160-
- hw/snitch_cluster/src/snitch_sequencer.sv
161175
- hw/snitch_cluster/src/snitch_tcdm_fc_interconnect.sv
162176
- hw/bootrom/snitch_bootrom.sv
163177
# Level 1
164178
- hw/snitch_cluster/src/snitch_barrier.sv
165-
- hw/snitch_cluster/src/snitch_fp_ss.sv
166179
- hw/snitch_cluster/src/snitch_tcdm_interconnect.sv
167180
# Level 2
168181
- hw/snitch_cluster/src/snitch_cc.sv

cfg/default.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
cluster_base_hartid: 0,
1010
addr_width: 48,
1111
data_width: 64,
12-
atomic_id_width: 5, // clog2(total number of clusters)
13-
user_width: 53, // addr_width + atomic_id_width
12+
atomic_id_width: 5,
1413
tcdm: {
1514
size: 128,
1615
banks: 32,
@@ -23,8 +22,6 @@
2322
dma_req_fifo_depth: 8,
2423
narrow_trans: 4,
2524
wide_trans: 32,
26-
dma_user_width: 48,
27-
enable_multicast: true,
2825
// We don't need Snitch debugging in Occamy
2926
enable_debug: false,
3027
// We don't need Snitch (core-internal) virtual memory support

cfg/dma_mchan.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
cluster_base_hartid: 0,
1010
addr_width: 48,
1111
data_width: 64,
12-
atomic_id_width: 5, // clog2(total number of clusters)
13-
user_width: 53, // addr_width + atomic_id_width
12+
atomic_id_width: 5,
1413
tcdm: {
1514
size: 128,
1615
banks: 32,
@@ -24,8 +23,6 @@
2423
dma_req_fifo_depth: 8,
2524
narrow_trans: 4,
2625
wide_trans: 32,
27-
dma_user_width: 48,
28-
enable_multicast: true,
2926
// We don't need Snitch debugging in Occamy
3027
enable_debug: false,
3128
// We don't need Snitch (core-internal) virtual memory support

cfg/frep_xl.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
cluster_base_hartid: 0,
1010
addr_width: 48,
1111
data_width: 64,
12-
atomic_id_width: 5, // clog2(total number of clusters)
13-
user_width: 53, // addr_width + atomic_id_width
12+
atomic_id_width: 5,
1413
tcdm: {
1514
size: 128,
1615
banks: 32,
@@ -23,8 +22,6 @@
2322
dma_req_fifo_depth: 8,
2423
narrow_trans: 4,
2524
wide_trans: 32,
26-
dma_user_width: 48,
27-
enable_multicast: true,
2825
// We don't need Snitch debugging in Occamy
2926
enable_debug: false,
3027
// We don't need Snitch (core-internal) virtual memory support

cfg/frep_xs.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
cluster_base_hartid: 0,
1010
addr_width: 48,
1111
data_width: 64,
12-
user_width: 5, // clog2(total number of clusters)
12+
atomic_id_width: 5,
1313
tcdm: {
1414
size: 128,
1515
banks: 32,
@@ -22,7 +22,6 @@
2222
dma_req_fifo_depth: 8,
2323
narrow_trans: 4,
2424
wide_trans: 32,
25-
dma_user_width: 1,
2625
// We don't need Snitch debugging in Occamy
2726
enable_debug: false,
2827
// We don't need Snitch (core-internal) virtual memory support

cfg/github-ci.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
cluster_base_hartid: 0,
1010
addr_width: 48,
1111
data_width: 64,
12-
atomic_id_width: 5, // clog2(total number of clusters)
13-
user_width: 53, // addr_width + atomic_id_width
12+
atomic_id_width: 5,
1413
tcdm: {
1514
size: 128,
1615
banks: 32,
@@ -23,8 +22,6 @@
2322
dma_req_fifo_depth: 8,
2423
narrow_trans: 4,
2524
wide_trans: 32,
26-
dma_user_width: 48,
27-
enable_multicast: true,
2825
// We don't need Snitch debugging in Occamy
2926
enable_debug: false,
3027
// We don't need Snitch (core-internal) virtual memory support

cfg/omega.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
cluster_base_hartid: 0,
1010
addr_width: 48,
1111
data_width: 64,
12-
atomic_id_width: 5, // clog2(total number of clusters)
13-
user_width: 53, // addr_width + atomic_id_width
12+
atomic_id_width: 5,
1413
tcdm: {
1514
size: 128,
1615
banks: 32,
@@ -24,8 +23,6 @@
2423
dma_req_fifo_depth: 8,
2524
narrow_trans: 4,
2625
wide_trans: 32,
27-
dma_user_width: 48,
28-
enable_multicast: true,
2926
// We don't need Snitch debugging in Occamy
3027
enable_debug: false,
3128
// We don't need Snitch (core-internal) virtual memory support

experiments/frep/experiments.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77

88
from copy import deepcopy
99
from snitch.target.SimResults import SimRegion
10-
from snitch.target.experiment_utils import ExperimentManager
10+
import snitch.target.experiment_utils as eu
1111
import random
1212

13-
from mako.template import Template
1413
from pathlib import Path
1514

1615
NUM_GEMM_SIZES = 50
@@ -57,11 +56,10 @@
5756
'zonl64dobu': str(Path.cwd() / 'hw/zonl64dobu/bin/snitch_cluster.vsim'),
5857
'zonl48dobu': str(Path.cwd() / 'hw/zonl48dobu/bin/snitch_cluster.vsim'),
5958
}
60-
DATA_DIR = Path('data').absolute()
6159
VERIFY_PY = Path('../../../../sw/blas/gemm/scripts/verify.py').absolute()
6260

6361

64-
class FrepExperimentManager(ExperimentManager):
62+
class FrepExperimentManager(eu.ExperimentManager):
6563

6664
def derive_axes(self, experiment):
6765
return {
@@ -72,16 +70,7 @@ def derive_axes(self, experiment):
7270
}
7371

7472
def derive_data_cfg(self, experiment):
75-
# Create parent directory for configuration file
76-
cfg_path = DATA_DIR / experiment['name'] / 'cfg.json'
77-
cfg_path.parent.mkdir(parents=True, exist_ok=True)
78-
79-
# Fill in configuration template and write configuration file
80-
with open('cfg.json.tpl') as f:
81-
cfg = Template(f.read()).render(experiment=experiment)
82-
with open(cfg_path, 'w') as f:
83-
f.write(cfg)
84-
return cfg_path
73+
return eu.derive_data_cfg_from_template(experiment)
8574

8675
def derive_hw_cfg(self, experiment):
8776
return Path.cwd() / 'cfg' / f'{experiment["hw"]}.json'

hw/bootrom/bootrom.S

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ _snitch_park:
3131
wfi
3232

3333
_snitch_resume:
34-
auipc t0, 0
34+
la t0, _snitch_park
3535
# We need to know the address of the scratch1 register in
3636
# the peripherals, which is a constant offset of our current PC,
3737
# independent of the cluster configuration.
3838
# This offset can be calculated as follows:
39-
# - 0x20 (start of this bootrom)
39+
# _snitch_park (start of this bootrom)
4040
# + 0x1000 (bootrom size 4kB)
4141
# + 0x188 (offset of the scratch1 register)
42-
li t1, 0x1168
42+
li t1, 0x1188
4343
add t0, t0, t1
4444
lw t0, 0(t0)
4545
jalr ra, 0(t0)

0 commit comments

Comments
 (0)