class DCachePendingHit(Elaboratable):
def __init__(self, tlb_pte_way, tlb_valid_way, tlb_hit_way,
- cache_valid_bits, cache_tag_set,
+ cache_valid_idx, cache_tag_set,
req_addr,
hit_set):
self.tlb_hit_way = tlb_hit_way
self.tlb_pte_way = tlb_pte_way
self.tlb_valid_way = tlb_valid_way
- self.cache_valid_bits = cache_valid_bits
+ self.cache_valid_idx = cache_valid_idx
self.cache_tag_set = cache_tag_set
self.req_addr = req_addr
self.hit_set = hit_set
is_hit = self.is_hit
tlb_pte_way = self.tlb_pte_way
tlb_valid_way = self.tlb_valid_way
- cache_valid_bits = self.cache_valid_bits
+ cache_valid_idx = self.cache_valid_idx
cache_tag_set = self.cache_tag_set
req_addr = self.req_addr
tlb_hit_way = self.tlb_hit_way
for i in range(NUM_WAYS):
is_tag_hit = Signal()
- comb += is_tag_hit.eq(go & cache_valid_bits[req_index][i] &
+ comb += is_tag_hit.eq(go & cache_valid_idx[i] &
(read_tag(i, cache_tag_set) == s_tag)
& tlb_valid_way[j])
with m.If(is_tag_hit):
comb += s_tag.eq(get_tag(req_addr))
for i in range(NUM_WAYS):
is_tag_hit = Signal()
- comb += is_tag_hit.eq(go & cache_valid_bits[req_index][i] &
+ comb += is_tag_hit.eq(go & cache_valid_idx[i] &
read_tag(i, cache_tag_set) == s_tag)
with m.If(is_tag_hit):
comb += hit_way.eq(i)
go = Signal()
nc = Signal()
hit_set = Array(Signal() for i in range(TLB_NUM_WAYS))
+ cache_valid_idx = Signal(INDEX_BITS)
# Extract line, row and tag from request
comb += req_index.eq(get_index(r0.req.addr))
comb += req_tag.eq(get_tag(ra))
comb += go.eq(r0_valid & ~(r0.tlbie | r0.tlbld) & ~r1.ls_error)
+ comb += cache_valid_idx.eq(cache_valid_bits[req_index])
m.submodules.dcache_pend = dc = DCachePendingHit(tlb_pte_way,
tlb_valid_way, tlb_hit_way,
- cache_valid_bits, cache_tag_set,
+ cache_valid_idx, cache_tag_set,
r0.req.addr,
hit_set)