def __init__(self, dw=8):
        self.dw = dw
        self.submodules.phy_model = phy.PHY(8, debug=False)
        self.submodules.mac_model = mac.MAC(self.phy_model,
                                            debug=False,
                                            loopback=False)
        self.submodules.arp_model = arp.ARP(self.mac_model,
                                            mac_address,
                                            ip_address,
                                            debug=False)
        self.submodules.ip_model = ip.IP(self.mac_model,
                                         mac_address,
                                         ip_address,
                                         debug=False,
                                         loopback=False)
        self.submodules.udp_model = udp.UDP(self.ip_model,
                                            ip_address,
                                            debug=False,
                                            loopback=True)

        self.submodules.core = LiteEthUDPIPCore(self.phy_model, mac_address,
                                                ip_address, 100000)
        udp_port = self.core.udp.crossbar.get_port(0x5678, dw)
        self.submodules.streamer = PacketStreamer(eth_udp_user_description(dw))
        self.submodules.logger = PacketLogger(eth_udp_user_description(dw))
        self.comb += [
            Record.connect(self.streamer.source, udp_port.sink),
            udp_port.sink.ip_address.eq(0x12345678),
            udp_port.sink.src_port.eq(0x1234),
            udp_port.sink.dst_port.eq(0x5678),
            udp_port.sink.length.eq(64 // (dw // 8)),
            Record.connect(udp_port.source, self.logger.sink)
        ]
Ejemplo n.º 2
0
    def __init__(self):
        self.submodules.phy_model = phy.PHY(8, debug=False)
        self.submodules.mac_model = mac.MAC(self.phy_model, debug=False, loopback=False)
        self.submodules.arp_model = arp.ARP(self.mac_model, mac_address, ip_address, debug=False)
        self.submodules.ip_model = ip.IP(self.mac_model, mac_address, ip_address, debug=False, loopback=True)

        self.submodules.ip = LiteEthIPCore(self.phy_model, mac_address, ip_address, 100000)
        self.ip_port = self.ip.ip.crossbar.get_port(udp_protocol)
Ejemplo n.º 3
0
    def __init__(self):
        self.submodules.phy_model = phy.PHY(8, debug=False)
        self.submodules.mac_model = mac.MAC(self.phy_model, debug=False, loopback=False)
        self.submodules.arp_model = arp.ARP(self.mac_model, mac_address, ip_address, debug=False)
        self.submodules.ip_model = ip.IP(self.mac_model, mac_address, ip_address, debug=False, loopback=False)
        self.submodules.udp_model = udp.UDP(self.ip_model, ip_address, debug=False, loopback=False)
        self.submodules.etherbone_model = etherbone.Etherbone(self.udp_model, debug=False)

        self.submodules.core = LiteEthUDPIPCore(self.phy_model, mac_address, ip_address, 100000)
        self.submodules.etherbone = LiteEthEtherbone(self.core.udp, 20000)

        self.submodules.sram = wishbone.SRAM(1024)
        self.submodules.interconnect = wishbone.InterconnectPointToPoint(self.etherbone.master.bus, self.sram.bus)
Ejemplo n.º 4
0
    def __init__(self):
        self.submodules.phy_model = phy.PHY(8, debug=False)
        self.submodules.mac_model = mac.MAC(self.phy_model,
                                            debug=False,
                                            loopback=False)
        self.submodules.arp_model = arp.ARP(self.mac_model,
                                            mac_address,
                                            ip_address,
                                            debug=False)

        self.submodules.mac = LiteEthMAC(self.phy_model,
                                         dw=8,
                                         with_preamble_crc=True)
        self.submodules.arp = LiteEthARP(self.mac, mac_address, ip_address,
                                         100000)
Ejemplo n.º 5
0
    def __init__(self):
        self.submodules.phy_model = phy.PHY(8, debug=True)
        self.submodules.mac_model = mac.MAC(self.phy_model,
                                            debug=True,
                                            loopback=False)
        self.submodules.arp_model = arp.ARP(self.mac_model,
                                            mac_address,
                                            ip_address,
                                            debug=True)
        self.submodules.ip_model = ip.IP(self.mac_model,
                                         mac_address,
                                         ip_address,
                                         debug=True,
                                         loopback=False)
        self.submodules.icmp_model = icmp.ICMP(self.ip_model,
                                               ip_address,
                                               debug=True)

        self.submodules.ip = LiteEthIPCore(self.phy_model, mac_address,
                                           ip_address, 100000)
    def __init__(self):
        D = 8  # Datapath width [bytes]

        self.clock_domains.cd_sys = ClockDomain()
        self.clock_domains.eth_tx = ClockDomain()
        self.clock_domains.eth_rx = ClockDomain()

        self.clk_freq = 100000
        self.submodules.ethphy = phy.PHY(D * 8, debug=True)
        self.submodules.mac_model = mac.MAC(self.ethphy,
                                            debug=True,
                                            loopback=False)
        self.submodules.arp_model = arp.ARP(self.mac_model,
                                            dst_mac,
                                            dst_ip,
                                            debug=True)
        self.submodules.ip_model = ip.IP(self.mac_model,
                                         dst_mac,
                                         dst_ip,
                                         debug=True,
                                         loopback=False)
        self.submodules.icmp_model = icmp.ICMP(self.ip_model,
                                               dst_ip,
                                               debug=True)

        ethcore = LiteEthUDPIPCore(phy=self.ethphy,
                                   mac_address=local_mac,
                                   ip_address=local_ip,
                                   clk_freq=self.clk_freq,
                                   dw=self.ethphy.dw)
        self.submodules.ethcore = ethcore

        # ----------------------
        #  UDP packet sender
        # ----------------------
        self.udpp = self.ethcore.udp.crossbar.get_port(1337, D * 8)
        self.submodules.udp_sender = UdpSender(D=D, dst_ip="192.168.1.10")
        self.comb += [
            self.udp_sender.source.connect(self.udpp.sink),
            self.udpp.source.ready.eq(1)
        ]