dcache.py move Reservation RecordObject to top of file
authorCole Poirier <colepoirier@gmail.com>
Tue, 25 Aug 2020 01:01:36 +0000 (18:01 -0700)
committerCole Poirier <colepoirier@gmail.com>
Tue, 25 Aug 2020 01:01:36 +0000 (18:01 -0700)
src/soc/experiment/dcache.py

index 95130adcf71ae0ef0e7f494e843122cbb0d5eeb0..3abbac42d0828c32863d14a3317ccd0bccac1891 100644 (file)
@@ -168,6 +168,15 @@ class RegStage1(RecordObject):
         self.stcx_fail        = Signal()
 
 
+# Reservation information
+class Reservation(RecordObject):
+    def __init__(self):
+        super().__init__()
+        valid = Signal()
+        # TODO LINE_OFF_BITS is 6
+        addr  = Signal(63 downto LINE_OFF_BITS)
+
+
 # Set associative dcache write-through
 #
 # TODO (in no specific order):
@@ -446,21 +455,6 @@ class Dcache(Elaboratable):
 #     signal r1 : reg_stage_1_t;
         r1 = RegStage1()
 
-#     -- Reservation information
-#     --
-#     type reservation_t is record
-#         valid : std_ulogic;
-#         addr  : std_ulogic_vector(63 downto LINE_OFF_BITS);
-#     end record;
-# Reservation information
-
-        class Reservation(RecordObject):
-            def __init__(self):
-                super().__init__()
-                valid = Signal()
-                # TODO LINE_OFF_BITS is 6
-                addr  = Signal(63 downto LINE_OFF_BITS)
-
 #     signal reservation : reservation_t;
         reservation = Reservation()