put inversion of write-enable into its own signal
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 9 Mar 2019 22:23:14 +0000 (22:23 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 9 Mar 2019 22:23:14 +0000 (22:23 +0000)
TLB/src/Cam.py

index e4340fcd1696d6ca0889cdc2f7851af053bcef03..937811fb47f794d5046b57c2d198fbd6ae353bba 100644 (file)
@@ -70,12 +70,16 @@ class Cam():
             self.decoder.n.eq(0)
         ]
 
+        # XXX change name of write_enable interface to write_enable_n ?
+        wen = Signal(reset_less=True)
+        m.d.comb += wen.eq(~self.write_enable)
+
         with m.If(self.enable):
             # Set the key value for every CamEntry
             for index in range(self.cam_size):
 
                 # Read Operation
-                with m.If(~self.write_enable):
+                with m.If(wen):
                     m.d.comb += entry_array[index].command.eq(1)
 
                 # Write Operation