same trick with encoder, remove switch, use encoder.o
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 22 Apr 2019 02:40:39 +0000 (03:40 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 22 Apr 2019 02:40:39 +0000 (03:40 +0100)
TLB/src/SetAssociativeCache.py

index 1bc1e97d8728c0e97f1222ae0a2d5dda85dad1bd..819bc4ac932dac78089f8fbd88177472228f1152 100644 (file)
@@ -102,11 +102,8 @@ class SetAssociativeCache():
             m.next = "FINISHED_READ"
             # Pull out data from the read port
             data = 0
-            with m.Switch(self.encoder.o):
-                for i in range(self.way_count):
-                    with m.Case(i):
-                        read_port = self.read_array[i]
-                        data = read_port.data[self.data_start:self.data_end]
+            read_port = self.read_array[self.encoder.o]
+            data = read_port.data[self.data_start:self.data_end]
 
             m.d.comb += [
                 self.hit.eq(1),