liteeth: small logic optimizations on mac (eases timings on spartan6)
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Sun, 5 Jul 2015 10:31:52 +0000 (12:31 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Sun, 5 Jul 2015 10:31:52 +0000 (12:31 +0200)
misoclib/com/liteeth/core/mac/core/crc.py
misoclib/com/liteeth/core/mac/core/preamble.py

index ba7c53191fd8fe0d888b4f9930f102fad252d1ce..f08302b164d4733c2a5cc4d933ae70d2372c05e0 100644 (file)
@@ -258,15 +258,14 @@ class LiteEthMACCRCChecker(Module):
             fifo.reset.eq(1),
             NextState("IDLE"),
         )
+        self.comb += crc.data.eq(sink.data)
         fsm.act("IDLE",
-            crc.data.eq(sink.data),
             If(sink.stb & sink.sop & sink.ack,
                 crc.ce.eq(1),
                 NextState("COPY")
             )
         )
         fsm.act("COPY",
-            crc.data.eq(sink.data),
             If(sink.stb & sink.ack,
                 crc.ce.eq(1),
                 If(sink.eop,
index 18e86f835ce18874581419a9672885ccd66c256d..b761a673e6fbe4484aac7545425d7f535af736cc 100644 (file)
@@ -41,8 +41,13 @@ class LiteEthMACPreambleInserter(Module):
                 inc_cnt.eq(self.source.ack)
             )
         )
+
+        self.comb += [
+            self.source.data.eq(self.sink.data),
+            self.source.last_be.eq(self.sink.last_be)
+        ]
         fsm.act("COPY",
-            Record.connect(self.sink, self.source),
+            Record.connect(self.sink, self.source, leave_out=["data", "last_be"]),
             self.source.sop.eq(0),
 
             If(self.sink.stb & self.sink.eop & self.source.ack,
@@ -130,8 +135,12 @@ class LiteEthMACPreambleChecker(Module):
                 )
             )
         )
+        self.comb += [
+            self.source.data.eq(self.sink.data),
+            self.source.last_be.eq(self.sink.last_be)
+        ]
         fsm.act("COPY",
-            Record.connect(self.sink, self.source),
+            Record.connect(self.sink, self.source, leave_out=["data", "last_be"]),
             self.source.sop.eq(sop),
             clr_sop.eq(self.source.stb & self.source.ack),