Skip to content

Commit c3cdca6

Browse files
committed
fix some issues for missunit
1 parent 432bdaf commit c3cdca6

7 files changed

Lines changed: 1124 additions & 1185 deletions

File tree

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,31 @@
11
ICacheMissUnit:
22
- "wire _prefetchMSHRs_9_io_req_ready"
33
- "wire _prefetchMSHRs_9_io_acquire_valid"
4-
- "wire [41:0] _prefetchMSHRs_9_io_resp_bits_blkPaddr"
5-
- "wire [7:0] _prefetchMSHRs_9_io_resp_bits_vSetIdx"
64
- "wire _prefetchMSHRs_8_io_req_ready"
75
- "wire _prefetchMSHRs_8_io_acquire_valid"
8-
- "wire [41:0] _prefetchMSHRs_8_io_resp_bits_blkPaddr"
9-
- "wire [7:0] _prefetchMSHRs_8_io_resp_bits_vSetIdx"
106
- "wire _prefetchMSHRs_7_io_req_ready"
117
- "wire _prefetchMSHRs_7_io_acquire_valid"
12-
- "wire [41:0] _prefetchMSHRs_7_io_resp_bits_blkPaddr"
13-
- "wire [7:0] _prefetchMSHRs_7_io_resp_bits_vSetIdx"
148
- "wire _prefetchMSHRs_6_io_req_ready"
159
- "wire _prefetchMSHRs_6_io_acquire_valid"
16-
- "wire [41:0] _prefetchMSHRs_6_io_resp_bits_blkPaddr"
17-
- "wire [7:0] _prefetchMSHRs_6_io_resp_bits_vSetIdx"
1810
- "wire _prefetchMSHRs_5_io_req_ready"
1911
- "wire _prefetchMSHRs_5_io_acquire_valid"
20-
- "wire [41:0] _prefetchMSHRs_5_io_resp_bits_blkPaddr"
21-
- "wire [7:0] _prefetchMSHRs_5_io_resp_bits_vSetIdx"
2212
- "wire _prefetchMSHRs_4_io_req_ready"
2313
- "wire _prefetchMSHRs_4_io_acquire_valid"
24-
- "wire [41:0] _prefetchMSHRs_4_io_resp_bits_blkPaddr"
25-
- "wire [7:0] _prefetchMSHRs_4_io_resp_bits_vSetIdx"
2614
- "wire _prefetchMSHRs_3_io_req_ready"
2715
- "wire _prefetchMSHRs_3_io_acquire_valid"
28-
- "wire [41:0] _prefetchMSHRs_3_io_resp_bits_blkPaddr"
29-
- "wire [7:0] _prefetchMSHRs_3_io_resp_bits_vSetIdx"
3016
- "wire _prefetchMSHRs_2_io_req_ready"
3117
- "wire _prefetchMSHRs_2_io_acquire_valid"
32-
- "wire [41:0] _prefetchMSHRs_2_io_resp_bits_blkPaddr"
33-
- "wire [7:0] _prefetchMSHRs_2_io_resp_bits_vSetIdx"
3418
- "wire _prefetchMSHRs_1_io_req_ready"
3519
- "wire _prefetchMSHRs_1_io_acquire_valid"
36-
- "wire [41:0] _prefetchMSHRs_1_io_resp_bits_blkPaddr"
37-
- "wire [7:0] _prefetchMSHRs_1_io_resp_bits_vSetIdx"
3820
- "wire _prefetchMSHRs_0_io_req_ready"
3921
- "wire _prefetchMSHRs_0_io_acquire_valid"
40-
- "wire [41:0] _prefetchMSHRs_0_io_resp_bits_blkPaddr"
41-
- "wire [7:0] _prefetchMSHRs_0_io_resp_bits_vSetIdx"
4222

4323
- "wire _fetchMSHRs_3_io_req_ready"
4424
- "wire _fetchMSHRs_3_io_acquire_valid"
45-
- "wire [41:0] _fetchMSHRs_3_io_resp_bits_blkPaddr"
46-
- "wire [7:0] _fetchMSHRs_3_io_resp_bits_vSetIdx"
4725
- "wire _fetchMSHRs_2_io_req_ready"
4826
- "wire _fetchMSHRs_2_io_acquire_valid"
49-
- "wire [41:0] _fetchMSHRs_2_io_resp_bits_blkPaddr"
50-
- "wire [7:0] _fetchMSHRs_2_io_resp_bits_vSetIdx"
5127
- "wire _fetchMSHRs_1_io_req_ready"
5228
- "wire _fetchMSHRs_1_io_acquire_valid"
53-
- "wire [41:0] _fetchMSHRs_1_io_resp_bits_blkPaddr"
54-
- "wire [7:0] _fetchMSHRs_1_io_resp_bits_vSetIdx"
5529
- "wire _fetchMSHRs_0_io_req_ready"
5630
- "wire _fetchMSHRs_0_io_acquire_valid"
57-
- "wire [41:0] _fetchMSHRs_0_io_resp_bits_blkPaddr"
58-
- "wire [7:0] _fetchMSHRs_0_io_resp_bits_vSetIdx"
5931

60-
- "wire _prefetchDemux_io_chosen"
61-
- "wire _prefetchDemux_io_in_ready"
62-
- "wire _prefetchDemux_io_in_valid_T_1"
63-
- "wire _fetchDemux_io_in_ready"
64-
- "wire _fetchDemux_io_in_valid_T_1"
65-
66-
- "wire prefetchHit"
67-
- "wire fetchHit"
68-
69-
- "wire last_fire"
70-
- "reg last_fire_r"
71-
72-
- "wire _priorityFIFO_io_enq_ready"
73-
- "wire _priorityFIFO_io_enq_valid_T_probe"
74-
- "wire _priorityFIFO_io_deq_valid"
75-
- "wire _priorityFIFO_io_deq_ready_T"
76-
- "wire _priorityFIFO_io_deq_bits"

ut_frontend/icache/missunit/ICacheMissUnit模块验证报告.md

Lines changed: 0 additions & 351 deletions
This file was deleted.

ut_frontend/icache/missunit/agent/missunit_agent.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ async def drive_respond_with_grant(self,
160160
data_beats: list,
161161
beat_size_code: int = 6,
162162
op_code: int = 5,
163-
is_corrupt_list: list = None
163+
is_corrupt_list: list = None,
164+
pre_beat_hook=None,
165+
post_beat_hook=None
164166
):
165167
num_beats = len(data_beats)
166168
if is_corrupt_list is None:
@@ -182,9 +184,14 @@ async def drive_respond_with_grant(self,
182184
self.bundle.io._mem._grant._valid.value = 1
183185

184186
toffee.info(f"Sending Grant beat {i+1}/{num_beats}: data={hex(current_beat_data)}, corrupt={current_corrupt}")
187+
if pre_beat_hook is not None:
188+
await pre_beat_hook(i)
189+
await self.bundle.step()
190+
if post_beat_hook is not None:
191+
await post_beat_hook(i)
192+
self.bundle.io._mem._grant._valid.value = 0
185193
await self.bundle.step()
186194

187-
self.bundle.io._mem._grant._valid.value = 0
188195
toffee.info(f"Grant transmission finished for source_id={source_id}.")
189196

190197
async def drive_get_fetch_response(self, timeout_cycles: int = 20) -> dict | None:
@@ -204,4 +211,4 @@ async def drive_get_fetch_response(self, timeout_cycles: int = 20) -> dict | Non
204211
await self.bundle.step()
205212

206213
toffee.info(f"Timeout: Did not capture fetch response after {timeout_cycles} cycles.")
207-
return None
214+
return None

ut_frontend/icache/missunit/bundle/missunit_bundle.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
class _0Bundle(Bundle):
44
_acquire_valid, _req_ready = Signals(2)
5-
_resp_bits_blkPaddr, _resp_bits_vSetIdx = Signals(2)
65

76
class _1Bundle(Bundle):
87
_io = _0Bundle.from_prefix("_io")
@@ -28,8 +27,6 @@ class _3Bundle(Bundle):
2827
class _4Bundle(Bundle):
2928
_prefetchMSHRs = _3Bundle.from_prefix("_prefetchMSHRs")
3029
_fetchMSHRs = _2Bundle.from_prefix("_fetchMSHRs")
31-
last_fire_r, last_fire = Signals(2)
32-
fetchHit, prefetchHit = Signals(2)
3330

3431
class _5Bundle(Bundle):
3532
_data, _virIdx, _waymask = Signals(3)
@@ -62,7 +59,6 @@ class _12Bundle(Bundle):
6259
class _13Bundle(Bundle):
6360
_bits = _12Bundle.from_prefix("_bits")
6461
_valid, _ready = Signals(2)
65-
_valid_T_probe,_ready_T = Signals(2)
6662

6763
class _14Bundle(Bundle):
6864
_source, _corrupt, _data, _size, _opcode = Signals(5)
@@ -98,19 +94,7 @@ class _21Bundle(Bundle):
9894
_prefetch_req = _8Bundle.from_prefix("_prefetch_req")
9995
_fencei, _flush, _hartId = Signals(3)
10096

101-
class _22Bundle(Bundle):
102-
_io_enq = _13Bundle.from_prefix("_io_enq")
103-
_io_deq = _13Bundle.from_prefix("_io_deq")
104-
_io_deq_bits = Signal()
105-
106-
107-
class _24Bundle(Bundle):
108-
_io_chosen, _io_in_ready, _io_in_valid_T_1 = Signals(3)
109-
11097
class ICacheMissUnitBundle(Bundle):
11198
io = _21Bundle.from_prefix("io")
112-
priorityFIFO = _22Bundle.from_prefix("ICacheMissUnit__priorityFIFO")
11399
ICacheMissUnit_ = _4Bundle.from_prefix("ICacheMissUnit_")
114-
prefetchDemux = _24Bundle.from_prefix("ICacheMissUnit__prefetchDemux")
115-
fetchDemux = _24Bundle.from_prefix("ICacheMissUnit__fetchDemux")
116100
reset, clock = Signals(2)

0 commit comments

Comments
 (0)