Remove wen term and shift If blocks to remove NOT need
authorDaniel Benusovich <flyingmonkeys1996@gmail.com>
Sun, 10 Mar 2019 19:34:13 +0000 (12:34 -0700)
committerDaniel Benusovich <flyingmonkeys1996@gmail.com>
Sun, 10 Mar 2019 19:34:13 +0000 (12:34 -0700)
TLB/src/Cam.py

index de9be90adb069c22acdf89efe19bc9f7cbd2bd0c..3606234b1180c96324480bb71d13ca73150d6b41 100644 (file)
@@ -70,24 +70,20 @@ 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(wen):
-                    m.d.comb += entry_array[index].command.eq(1)
-
                 # Write Operation
-                with m.Else():
+                with m.If(self.write_enable):
                     with m.If(self.decoder.o[index]):
                         m.d.comb += entry_array[index].command.eq(2)
                     with m.Else():
-                        m.d.comb += entry_array[index].command.eq(0)
+                        m.d.comb += entry_array[index].command.eq(0)                    
+
+                # Read Operation
+                with m.Else():
+                    m.d.comb += entry_array[index].command.eq(1)
 
                 # Send data input to all entries
                 m.d.comb += entry_array[index].data_in.eq(self.data_in)