From: Luke Kenneth Casson Leighton Date: Mon, 22 Apr 2019 03:18:04 +0000 (+0100) Subject: tidyup hit/multiple, move to main block X-Git-Tag: div_pipeline~2189 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=32bd12b36a25e7c388cb5fc5915d6996c4b8953c;p=soc.git tidyup hit/multiple, move to main block --- diff --git a/TLB/src/SetAssociativeCache.py b/TLB/src/SetAssociativeCache.py index 1d1f94e7..f0a6c7ba 100644 --- a/TLB/src/SetAssociativeCache.py +++ b/TLB/src/SetAssociativeCache.py @@ -110,31 +110,25 @@ class SetAssociativeCache(): # Only one entry should be marked # This is due to already verifying the tags # matched and the valid bit is high - with m.If(self.encoder.single_match): + with m.If(self.hit): m.next = "FINISHED_READ" # Pull out data from the read port - data = 0 read_port = self.mem_array[self.encoder.o].r data = read_port.data[self.data_start:self.data_end] - m.d.comb += [ - self.hit.eq(1), - self.multiple_hit.eq(0), self.data_o.eq(data) ] self.access_plru(m) # Oh no! Seal the gates! Multiple tags matched?!? kasd;ljkafdsj;k - with m.Elif(self.encoder.multiple_match): + with m.Elif(self.multiple_hit): + # XXX TODO, m.next = "FINISHED_READ" ? otherwise stuck m.d.comb += [ - self.hit.eq(0), - self.multiple_hit.eq(1), self.data_o.eq(0) ] # No tag matches means no data with m.Else(): + # XXX TODO, m.next = "FINISHED_READ" ? otherwise stuck m.d.comb += [ - self.hit.eq(0), - self.multiple_hit.eq(0), self.data_o.eq(0) ] @@ -203,6 +197,12 @@ class SetAssociativeCache(): m.submodules.AddressEncoder = self.encoder m.submodules += self.mem_array + # do these all the time? + m.d.comb += [ + self.hit.eq(self.encoder.single_match), + self.multiple_hit.eq(self.encoder.multiple_match), + ] + with m.If(self.enable): with m.Switch(self.command): # Search all sets at a particular tag