targets/udp: create udp loopback on port 8000 with dw=32 (to test data_width converters)
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Tue, 10 Feb 2015 15:23:12 +0000 (16:23 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Tue, 10 Feb 2015 15:24:45 +0000 (16:24 +0100)
targets/udp.py

index 27b605e04abe82f79154c4d61e55f58ab721b24b..32d8ee9c38011266f5ea3ce17d0331efb9024955 100644 (file)
@@ -114,13 +114,17 @@ class UDPSoC(GenSoC, AutoCSR):
                self.submodules.phy = LiteEthPHYGMII(platform.request("eth_clocks"), platform.request("eth"))
                self.submodules.core = LiteEthUDPIPCore(self.phy, 0x10e2d5000000, convert_ip("192.168.1.40"), clk_freq)
 
-               # Create loopback on UDP port 6000
-               loopback_port = self.core.udp.crossbar.get_port(6000)
-               self.submodules.loopback_buffer = PacketBuffer(eth_udp_user_description(8), 8192, 8)
-               self.comb += [
-                       Record.connect(loopback_port.source, self.loopback_buffer.sink),
-                       Record.connect(self.loopback_buffer.source, loopback_port.sink)
-               ]
+               # Create loopback on UDP port 6000 (dw=8)
+               loopback_port = self.core.udp.crossbar.get_port(6000, dw=8)
+               loopback_buffer = PacketBuffer(eth_udp_user_description(8), 8192, 8)
+               self.submodules += loopback_buffer
+               self.comb += Port.connect(loopback_port, loopback_buffer)
+
+               # Create loopback on UDP port 8000 (dw=32)
+               loopback_port = self.core.udp.crossbar.get_port(8000, dw=32)
+               loopback_buffer = PacketBuffer(eth_udp_user_description(32), 2048, 8)
+               self.submodules += loopback_buffer
+               self.comb += Port.connect(loopback_port, loopback_buffer)
 
 class UDPSoCDevel(UDPSoC, AutoCSR):
        csr_map = {