Skip to content

Commit 8d33f93

Browse files
authored
Merge pull request #4777 from oharboe/cva6-upstream-rams
asap7/cva6: the RAMs as upstream has them, made macros
2 parents 3f8ab4e + afac85c commit 8d33f93

13 files changed

Lines changed: 705 additions & 112 deletions

File tree

‎flow/designs/asap7/cva6/config.mk‎

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ export VERILOG_FILES = $(sort $(wildcard $(SRC_HOME)/common/local/util/
5252
$(SRC_HOME)/core/cache_subsystem/hpdcache/rtl/src/hwpf_stride/hwpf_stride_wrapper.sv \
5353
$(sort $(wildcard $(SRC_HOME)/core/cache_subsystem/*.sv)) \
5454
$(sort $(wildcard $(SRC_HOME)/core/cache_subsystem/hpdcache/rtl/src/common/*.sv)) \
55-
$(sort $(wildcard $(SRC_HOME)/core/cache_subsystem/hpdcache/rtl/src/common/macros/blackbox/*.sv)) \
55+
$(SRC_HOME)/core/cache_subsystem/hpdcache/rtl/src/common/macros/behav/hpdcache_sram_1rw.sv \
56+
$(SRC_HOME)/core/cache_subsystem/hpdcache/rtl/src/common/macros/behav/hpdcache_sram_wbyteenable_1rw.sv \
5657
$(sort $(wildcard $(SRC_HOME)/core/cache_subsystem/hpdcache/rtl/src/utils/*.sv)) \
5758
$(sort $(wildcard $(SRC_HOME)/core/cva6_mmu/*.sv)) \
5859
$(SRC_HOME)/core/cvfpu/src/fpu_div_sqrt_mvp/hdl/defs_div_sqrt_mvp.sv \
@@ -64,27 +65,27 @@ export VERILOG_FILES = $(sort $(wildcard $(SRC_HOME)/common/local/util/
6465
$(SRC_HOME)/core/cvfpu/src/fpu_div_sqrt_mvp/hdl/preprocess_mvp.sv \
6566
$(SRC_HOME)/core/cvxif_example/include/cvxif_instr_pkg.sv \
6667
$(sort $(wildcard $(SRC_HOME)/core/frontend/*.sv)) \
67-
$(SRC_HOME)/vendor/pulp-platform/tech_cells_generic/src/rtl/tc_sram.sv \
68-
$(PLATFORM_DIR)/verilog/fakeram7_64x256.sv \
69-
$(PLATFORM_DIR)/verilog/fakeram7_128x64.sv \
70-
$(PLATFORM_DIR)/verilog/fakeram7_64x28.sv \
71-
$(PLATFORM_DIR)/verilog/fakeram7_64x25.sv
68+
$(SRC_HOME)/vendor/pulp-platform/tech_cells_generic/src/rtl/tc_sram.sv
7269

7370
export VERILOG_INCLUDE_DIRS = $(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/core/include \
7471
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/core/cvfpu/src/common_cells/include \
7572
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/core/cache_subsystem/hpdcache/rtl/include
7673

7774
export VERILOG_DEFINES += -D HPDCACHE_ASSERT_OFF
7875

79-
export ADDITIONAL_LEFS = $(PLATFORM_DIR)/lef/fakeram7_64x256.lef \
80-
$(PLATFORM_DIR)/lef/fakeram7_128x64.lef \
81-
$(PLATFORM_DIR)/lef/fakeram7_64x28.lef \
82-
$(PLATFORM_DIR)/lef/fakeram7_64x25.lef
76+
# The RAMs are upstream's, the RTL unmodified, and AUTO_MEMORIES makes
77+
# each a macro, cva6.memories naming its pins and byte enables: the
78+
# D-cache data (hpdcache_sram_wbyteenable_1rw) and directory
79+
# (hpdcache_sram_1rw), and the I-cache data and tag, which surgery.py
80+
# puts behind sram_cache's techno cut in place of pulp's tc_sram.
81+
export SYNTH_VERILOG_SURGERY = $(DESIGN_HOME)/$(PLATFORM)/cva6/surgery.py
82+
export AUTO_MEMORIES = 1
83+
export ADDITIONAL_MEMORIES = $(DESIGN_HOME)/$(PLATFORM)/cva6/cva6.memories
8384

84-
export ADDITIONAL_LIBS = $(PLATFORM_DIR)/lib/NLDM/fakeram7_64x256.lib \
85-
$(PLATFORM_DIR)/lib/NLDM/fakeram7_128x64.lib \
86-
$(PLATFORM_DIR)/lib/NLDM/fakeram7_64x28.lib \
87-
$(PLATFORM_DIR)/lib/NLDM/fakeram7_64x25.lib
85+
# Kepler LEC off for now: kepler-formal stops on the macros AUTO_MEMORIES
86+
# makes ("cva6_icache_data_sram cannot be found"). A new kepler-formal is
87+
# in the works; the Kepler team rewires LEC for cva6 with it.
88+
export LEC_CHECK = 0
8889

8990
export SDC_FILE = $(DESIGN_HOME)/$(PLATFORM)/$(DESIGN_NAME)/constraint.sdc
9091

Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
{
2+
"version": 1,
3+
"memories": [
4+
{
5+
"name": "cva6_icache_data_sram",
6+
"rows": 64,
7+
"bits": 256,
8+
"addr_w": 6,
9+
"rw_ports": 1,
10+
"mask_lanes": 32,
11+
"idiomatic": true,
12+
"reason": "the I-cache data RAM behind the techno cut (surgery.py): one read-write port, byte enables",
13+
"pins": [
14+
{
15+
"name": "clk",
16+
"direction": "input",
17+
"width": 1,
18+
"port_id": "RW0",
19+
"function": "clk"
20+
},
21+
{
22+
"name": "cs",
23+
"direction": "input",
24+
"width": 1,
25+
"port_id": "RW0",
26+
"function": "en"
27+
},
28+
{
29+
"name": "we",
30+
"direction": "input",
31+
"width": 1,
32+
"port_id": "RW0",
33+
"function": "wmode"
34+
},
35+
{
36+
"name": "addr",
37+
"direction": "input",
38+
"width": 6,
39+
"port_id": "RW0",
40+
"function": "addr"
41+
},
42+
{
43+
"name": "wdata",
44+
"direction": "input",
45+
"width": 256,
46+
"port_id": "RW0",
47+
"function": "data_in"
48+
},
49+
{
50+
"name": "be",
51+
"direction": "input",
52+
"width": 32,
53+
"port_id": "RW0",
54+
"function": "mask"
55+
},
56+
{
57+
"name": "rdata",
58+
"direction": "output",
59+
"width": 256,
60+
"port_id": "RW0",
61+
"function": "data_out"
62+
}
63+
]
64+
},
65+
{
66+
"name": "cva6_icache_tag_sram",
67+
"rows": 64,
68+
"bits": 25,
69+
"addr_w": 6,
70+
"rw_ports": 1,
71+
"mask_lanes": 4,
72+
"mask_lane_width": 8,
73+
"idiomatic": true,
74+
"reason": "the I-cache tag RAM behind the techno cut (surgery.py): one read-write port, byte enables, the last 1 bit",
75+
"pins": [
76+
{
77+
"name": "clk",
78+
"direction": "input",
79+
"width": 1,
80+
"port_id": "RW0",
81+
"function": "clk"
82+
},
83+
{
84+
"name": "cs",
85+
"direction": "input",
86+
"width": 1,
87+
"port_id": "RW0",
88+
"function": "en"
89+
},
90+
{
91+
"name": "we",
92+
"direction": "input",
93+
"width": 1,
94+
"port_id": "RW0",
95+
"function": "wmode"
96+
},
97+
{
98+
"name": "addr",
99+
"direction": "input",
100+
"width": 6,
101+
"port_id": "RW0",
102+
"function": "addr"
103+
},
104+
{
105+
"name": "wdata",
106+
"direction": "input",
107+
"width": 25,
108+
"port_id": "RW0",
109+
"function": "data_in"
110+
},
111+
{
112+
"name": "be",
113+
"direction": "input",
114+
"width": 4,
115+
"port_id": "RW0",
116+
"function": "mask"
117+
},
118+
{
119+
"name": "rdata",
120+
"direction": "output",
121+
"width": 25,
122+
"port_id": "RW0",
123+
"function": "data_out"
124+
}
125+
]
126+
},
127+
{
128+
"name": "hpdcache_sram_1rw",
129+
"rows": 64,
130+
"bits": 28,
131+
"addr_w": 6,
132+
"rw_ports": 1,
133+
"idiomatic": true,
134+
"reason": "the D-cache directory RAM: one read-write port",
135+
"pins": [
136+
{
137+
"name": "clk",
138+
"direction": "input",
139+
"width": 1,
140+
"port_id": "RW0",
141+
"function": "clk"
142+
},
143+
{
144+
"name": "cs",
145+
"direction": "input",
146+
"width": 1,
147+
"port_id": "RW0",
148+
"function": "en"
149+
},
150+
{
151+
"name": "we",
152+
"direction": "input",
153+
"width": 1,
154+
"port_id": "RW0",
155+
"function": "wmode"
156+
},
157+
{
158+
"name": "addr",
159+
"direction": "input",
160+
"width": 6,
161+
"port_id": "RW0",
162+
"function": "addr"
163+
},
164+
{
165+
"name": "wdata",
166+
"direction": "input",
167+
"width": 28,
168+
"port_id": "RW0",
169+
"function": "data_in"
170+
},
171+
{
172+
"name": "rdata",
173+
"direction": "output",
174+
"width": 28,
175+
"port_id": "RW0",
176+
"function": "data_out"
177+
}
178+
]
179+
},
180+
{
181+
"name": "hpdcache_sram_wbyteenable_1rw",
182+
"rows": 128,
183+
"bits": 64,
184+
"addr_w": 7,
185+
"rw_ports": 1,
186+
"mask_lanes": 8,
187+
"idiomatic": true,
188+
"reason": "the D-cache data RAM, both ways of a set in a word: one read-write port, byte mask",
189+
"pins": [
190+
{
191+
"name": "clk",
192+
"direction": "input",
193+
"width": 1,
194+
"port_id": "RW0",
195+
"function": "clk"
196+
},
197+
{
198+
"name": "cs",
199+
"direction": "input",
200+
"width": 1,
201+
"port_id": "RW0",
202+
"function": "en"
203+
},
204+
{
205+
"name": "we",
206+
"direction": "input",
207+
"width": 1,
208+
"port_id": "RW0",
209+
"function": "wmode"
210+
},
211+
{
212+
"name": "addr",
213+
"direction": "input",
214+
"width": 7,
215+
"port_id": "RW0",
216+
"function": "addr"
217+
},
218+
{
219+
"name": "wdata",
220+
"direction": "input",
221+
"width": 64,
222+
"port_id": "RW0",
223+
"function": "data_in"
224+
},
225+
{
226+
"name": "wbyteenable",
227+
"direction": "input",
228+
"width": 8,
229+
"port_id": "RW0",
230+
"function": "mask"
231+
},
232+
{
233+
"name": "rdata",
234+
"direction": "output",
235+
"width": 64,
236+
"port_id": "RW0",
237+
"function": "data_out"
238+
}
239+
]
240+
}
241+
]
242+
}

0 commit comments

Comments
 (0)