mirror of
https://github.com/alexforencich/verilog-ethernet.git
synced 2025-01-14 06:43:18 +08:00
Update testbenches for python 3
This commit is contained in:
parent
101d963c09
commit
5a4b480c7e
10
tb/arp_ep.py
10
tb/arp_ep.py
@ -25,9 +25,13 @@ THE SOFTWARE.
|
||||
from myhdl import *
|
||||
import axis_ep
|
||||
import eth_ep
|
||||
from Queue import Queue
|
||||
import struct
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
class ARPFrame(object):
|
||||
def __init__(self,
|
||||
eth_dest_mac=0,
|
||||
@ -116,9 +120,9 @@ class ARPFrame(object):
|
||||
self.arp_hlen = struct.unpack('B', data.payload.data[4:5])[0]
|
||||
self.arp_plen = struct.unpack('B', data.payload.data[5:6])[0]
|
||||
self.arp_oper = struct.unpack('>H', data.payload.data[6:8])[0]
|
||||
self.arp_sha = struct.unpack('>Q', '\x00\x00'+data.payload.data[8:14])[0]
|
||||
self.arp_sha = struct.unpack('>Q', b'\x00\x00'+data.payload.data[8:14])[0]
|
||||
self.arp_spa = struct.unpack('>L', data.payload.data[14:18])[0]
|
||||
self.arp_tha = struct.unpack('>Q', '\x00\x00'+data.payload.data[18:24])[0]
|
||||
self.arp_tha = struct.unpack('>Q', b'\x00\x00'+data.payload.data[18:24])[0]
|
||||
self.arp_tpa = struct.unpack('>L', data.payload.data[24:28])[0]
|
||||
|
||||
def __eq__(self, other):
|
||||
|
10
tb/eth_ep.py
10
tb/eth_ep.py
@ -24,10 +24,14 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import axis_ep
|
||||
from Queue import Queue
|
||||
import struct
|
||||
import zlib
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
class EthFrame(object):
|
||||
def __init__(self, payload=b'', eth_dest_mac=0, eth_src_mac=0, eth_type=0, eth_fcs=None):
|
||||
self._payload = axis_ep.AXIStreamFrame()
|
||||
@ -92,8 +96,8 @@ class EthFrame(object):
|
||||
|
||||
def parse_axis(self, data):
|
||||
data = axis_ep.AXIStreamFrame(data).data
|
||||
self.eth_dest_mac = struct.unpack('>Q', '\x00\x00'+data[0:6])[0]
|
||||
self.eth_src_mac = struct.unpack('>Q', '\x00\x00'+data[6:12])[0]
|
||||
self.eth_dest_mac = struct.unpack('>Q', b'\x00\x00'+data[0:6])[0]
|
||||
self.eth_src_mac = struct.unpack('>Q', b'\x00\x00'+data[6:12])[0]
|
||||
self.eth_type = struct.unpack('>H', data[12:14])[0]
|
||||
data = data[14:]
|
||||
self.payload = axis_ep.AXIStreamFrame(data)
|
||||
|
@ -55,7 +55,7 @@ def GMIISource(clk, rst,
|
||||
if len(frame) == 0:
|
||||
ifg_cnt = 12
|
||||
elif not fifo.empty():
|
||||
frame = fifo.get()
|
||||
frame = list(fifo.get())
|
||||
if name is not None:
|
||||
print("[%s] Sending frame %s" % (name, repr(frame)))
|
||||
txd.next = frame.pop(0)
|
||||
|
10
tb/ip_ep.py
10
tb/ip_ep.py
@ -25,11 +25,15 @@ THE SOFTWARE.
|
||||
from myhdl import *
|
||||
import axis_ep
|
||||
import eth_ep
|
||||
from Queue import Queue
|
||||
import struct
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
class IPFrame(object):
|
||||
def __init__(self, payload='',
|
||||
def __init__(self, payload=b'',
|
||||
eth_dest_mac=0,
|
||||
eth_src_mac=0,
|
||||
eth_type=0,
|
||||
@ -145,7 +149,7 @@ class IPFrame(object):
|
||||
|
||||
def build_eth(self):
|
||||
self.build()
|
||||
data = ''
|
||||
data = b''
|
||||
|
||||
data += struct.pack('B', self.ip_version << 4 | self.ip_ihl)
|
||||
data += struct.pack('B', self.ip_dscp << 2 | self.ip_ecn)
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import eth_ep
|
||||
import arp_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import eth_ep
|
||||
import arp_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import arp_ep
|
||||
import eth_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import arp_ep
|
||||
import eth_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import axis_ep
|
||||
import eth_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import axis_ep
|
||||
import eth_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2015 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import axis_ep
|
||||
import eth_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2015 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import axis_ep
|
||||
import eth_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2015 Alex Forencich
|
||||
@ -25,10 +25,14 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
import struct
|
||||
import zlib
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import axis_ep
|
||||
import eth_ep
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2015 Alex Forencich
|
||||
@ -25,10 +25,14 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
import struct
|
||||
import zlib
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import axis_ep
|
||||
import eth_ep
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2015 Alex Forencich
|
||||
@ -25,10 +25,14 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
import struct
|
||||
import zlib
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import axis_ep
|
||||
import eth_ep
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2015 Alex Forencich
|
||||
@ -25,10 +25,14 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
import struct
|
||||
import zlib
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import axis_ep
|
||||
import eth_ep
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2015 Alex Forencich
|
||||
@ -25,10 +25,14 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
import struct
|
||||
import zlib
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import axis_ep
|
||||
import eth_ep
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import eth_ep
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import eth_ep
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import axis_ep
|
||||
import eth_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import axis_ep
|
||||
import eth_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import axis_ep
|
||||
import eth_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import axis_ep
|
||||
import eth_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import eth_ep
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import eth_ep
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2015 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import axis_ep
|
||||
import eth_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2015 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import axis_ep
|
||||
import eth_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2015 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import axis_ep
|
||||
import eth_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import eth_ep
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import eth_ep
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import eth_ep
|
||||
import ip_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import eth_ep
|
||||
import ip_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import ip_ep
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import ip_ep
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import eth_ep
|
||||
import arp_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import eth_ep
|
||||
import arp_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import ip_ep
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import ip_ep
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import eth_ep
|
||||
import ip_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import eth_ep
|
||||
import ip_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import eth_ep
|
||||
import ip_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import eth_ep
|
||||
import ip_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import ip_ep
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import ip_ep
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import eth_ep
|
||||
import ip_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import eth_ep
|
||||
import ip_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import udp_ep
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import udp_ep
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import eth_ep
|
||||
import arp_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import eth_ep
|
||||
import arp_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import udp_ep
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import udp_ep
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import eth_ep
|
||||
import ip_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import eth_ep
|
||||
import ip_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import eth_ep
|
||||
import ip_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import eth_ep
|
||||
import ip_ep
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import udp_ep
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
|
||||
Copyright (c) 2014 Alex Forencich
|
||||
@ -25,7 +25,11 @@ THE SOFTWARE.
|
||||
|
||||
from myhdl import *
|
||||
import os
|
||||
from Queue import Queue
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
import udp_ep
|
||||
|
||||
|
10
tb/udp_ep.py
10
tb/udp_ep.py
@ -26,11 +26,15 @@ from myhdl import *
|
||||
import axis_ep
|
||||
import eth_ep
|
||||
import ip_ep
|
||||
from Queue import Queue
|
||||
import struct
|
||||
|
||||
try:
|
||||
from queue import Queue
|
||||
except ImportError:
|
||||
from Queue import Queue
|
||||
|
||||
class UDPFrame(object):
|
||||
def __init__(self, payload='',
|
||||
def __init__(self, payload=b'',
|
||||
eth_dest_mac=0,
|
||||
eth_src_mac=0,
|
||||
eth_type=0,
|
||||
@ -204,7 +208,7 @@ class UDPFrame(object):
|
||||
|
||||
def build_ip(self):
|
||||
self.build()
|
||||
data = ''
|
||||
data = b''
|
||||
|
||||
data += struct.pack('>H', self.udp_source_port)
|
||||
data += struct.pack('>H', self.udp_dest_port)
|
||||
|
Loading…
x
Reference in New Issue
Block a user