1
0
mirror of https://github.com/corundum/corundum.git synced 2025-01-16 08:12:53 +08:00

merged changes in axis

This commit is contained in:
Alex Forencich 2015-03-21 04:58:56 -07:00
commit ea5809be5e
35 changed files with 1365 additions and 1172 deletions

View File

@ -1,14 +1,13 @@
language: python language: python
python: python:
- "2.7" - "3.4"
virtualenv:
system_site_packages: true
before_install: before_install:
- export d=`pwd` - export d=`pwd`
- export PYTHON_EXE=`which python`
- sudo apt-get update -qq - sudo apt-get update -qq
- sudo apt-get install -y iverilog - sudo apt-get install -y iverilog
- hg clone https://bitbucket.org/alexforencich/myhdl - git clone https://github.com/jandecaluwe/myhdl.git
- cd $d/myhdl && sudo python setup.py install - cd $d/myhdl && sudo $PYTHON_EXE setup.py install
- cd $d/myhdl/cosimulation/icarus && make && sudo install -m 0755 -D ./myhdl.vpi /usr/lib/ivl/myhdl.vpi - cd $d/myhdl/cosimulation/icarus && make && sudo install -m 0755 -D ./myhdl.vpi /usr/lib/ivl/myhdl.vpi
- cd $d - cd $d
script: script:

View File

@ -26,6 +26,7 @@ from myhdl import *
class AXIStreamFrame(object): class AXIStreamFrame(object):
def __init__(self, data=b'', keep=None, user=None): def __init__(self, data=b'', keep=None, user=None):
self.B = 0
self.N = 8 self.N = 8
self.M = 1 self.M = 1
self.WL = 8 self.WL = 8
@ -35,10 +36,13 @@ class AXIStreamFrame(object):
if type(data) is bytes or type(data) is bytearray: if type(data) is bytes or type(data) is bytearray:
self.data = bytearray(data) self.data = bytearray(data)
if type(data) is AXIStreamFrame: elif type(data) is AXIStreamFrame:
self.N = data.N self.N = data.N
self.WL = data.WL self.WL = data.WL
self.data = bytearray(data.data) if type(data.data) is bytearray:
self.data = bytearray(data.data)
else:
self.data = list(data.data)
if data.keep is not None: if data.keep is not None:
self.keep = list(data.keep) self.keep = list(data.keep)
if data.user is not None: if data.user is not None:
@ -46,6 +50,8 @@ class AXIStreamFrame(object):
self.user = data.user self.user = data.user
else: else:
self.user = list(data.user) self.user = list(data.user)
else:
self.data = list(data)
def build(self): def build(self):
if self.data is None: if self.data is None:
@ -62,23 +68,35 @@ class AXIStreamFrame(object):
assert_tuser = True assert_tuser = True
self.user = None self.user = None
while len(f) > 0: if self.B == 0:
data = 0 while len(f) > 0:
keep = 0 data = 0
for j in range(self.M): keep = 0
data = data | (f.pop(0) << (j*self.WL)) for j in range(self.M):
keep = keep | (1 << j) data = data | (f.pop(0) << (j*self.WL))
if len(f) == 0: break keep = keep | (1 << j)
tdata.append(data) if len(f) == 0: break
if self.keep is None: tdata.append(data)
tkeep.append(keep) if self.keep is None:
else: tkeep.append(keep)
tkeep.append(self.keep[i]) else:
if self.user is None: tkeep.append(self.keep[i])
tuser.append(0) if self.user is None:
else: tuser.append(0)
tuser.append(self.user[i]) else:
i += 1 tuser.append(self.user[i])
i += 1
else:
# multiple tdata signals
while len(f) > 0:
data = 0
tdata.append(f.pop(0))
tkeep.append(0)
if self.user is None:
tuser.append(0)
else:
tuser.append(self.user[i])
i += 1
if assert_tuser: if assert_tuser:
tuser[-1] = 1 tuser[-1] = 1
@ -95,14 +113,21 @@ class AXIStreamFrame(object):
self.data = [] self.data = []
self.keep = [] self.keep = []
self.user = [] self.user = []
mask = 2**self.WL-1
for i in range(len(tdata)): if self.B == 0:
for j in range(self.M): mask = 2**self.WL-1
if tkeep[i] & (1 << j):
self.data.append((tdata[i] >> (j*self.WL)) & mask) for i in range(len(tdata)):
self.keep.append(tkeep[i]) for j in range(self.M):
self.user.append(tuser[i]) if tkeep[i] & (1 << j):
self.data.append((tdata[i] >> (j*self.WL)) & mask)
self.keep.append(tkeep[i])
self.user.append(tuser[i])
else:
for i in range(len(tdata)):
self.data.append(tdata[i])
self.keep.append(tkeep[i])
self.user.append(tuser[i])
if self.WL == 8: if self.WL == 8:
self.data = bytearray(self.data) self.data = bytearray(self.data)
@ -142,27 +167,39 @@ def AXIStreamSource(clk, rst,
data = [] data = []
keep = [] keep = []
user = [] user = []
B = 0
N = len(tdata) N = len(tdata)
M = 1 M = len(tkeep)
b = False WL = int((len(tdata)+M-1)/M)
if tkeep is not None:
M = len(tkeep) if type(tdata) is list or type(tdata) is tuple:
WL = (len(tdata)+M-1)/M # multiple tdata signals
if WL == 8: B = len(tdata)
b = True N = [len(b) for b in tdata]
M = 1
WL = [1]*B
while True: while True:
yield clk.posedge, rst.posedge yield clk.posedge, rst.posedge
if rst: if rst:
tdata.next = 0 if B > 0:
for s in tdata:
s.next = 0
else:
tdata.next = 0
tkeep.next = 0 tkeep.next = 0
tvalid_int.next = False tvalid_int.next = False
tlast.next = False tlast.next = False
else: else:
if tready_int and tvalid: if tready_int and tvalid:
if len(data) > 0: if len(data) > 0:
tdata.next = data.pop(0) if B > 0:
l = data.pop(0)
for i in range(B):
tdata[i].next = l[i]
else:
tdata.next = data.pop(0)
tkeep.next = keep.pop(0) tkeep.next = keep.pop(0)
tuser.next = user.pop(0) tuser.next = user.pop(0)
tvalid_int.next = True tvalid_int.next = True
@ -174,14 +211,19 @@ def AXIStreamSource(clk, rst,
if not fifo.empty(): if not fifo.empty():
frame = fifo.get() frame = fifo.get()
frame = AXIStreamFrame(frame) frame = AXIStreamFrame(frame)
frame.B = B
frame.N = N frame.N = N
frame.M = M frame.M = M
frame.WL = WL frame.WL = WL
frame.build() data, keep, user = frame.build()
if name is not None: if name is not None:
print("[%s] Sending frame %s" % (name, repr(frame))) print("[%s] Sending frame %s" % (name, repr(frame)))
data, keep, user = frame.build() if B > 0:
tdata.next = data.pop(0) l = data.pop(0)
for i in range(B):
tdata[i].next = l[i]
else:
tdata.next = data.pop(0)
tkeep.next = keep.pop(0) tkeep.next = keep.pop(0)
tuser.next = user.pop(0) tuser.next = user.pop(0)
tvalid_int.next = True tvalid_int.next = True
@ -215,13 +257,17 @@ def AXIStreamSink(clk, rst,
data = [] data = []
keep = [] keep = []
user = [] user = []
B = 0
N = len(tdata) N = len(tdata)
M = 1
b = False
M = len(tkeep) M = len(tkeep)
WL = (len(tdata)+M-1)/M WL = int((len(tdata)+M-1)/M)
if WL == 8:
b = True if type(tdata) is list or type(tdata) is tuple:
# multiple tdata signals
B = len(tdata)
N = [len(b) for b in tdata]
M = 1
WL = [1]*B
while True: while True:
yield clk.posedge, rst.posedge yield clk.posedge, rst.posedge
@ -236,10 +282,17 @@ def AXIStreamSink(clk, rst,
tready_int.next = True tready_int.next = True
if tvalid_int: if tvalid_int:
data.append(int(tdata)) if B > 0:
l = []
for i in range(B):
l.append(int(tdata[i]))
data.append(l)
else:
data.append(int(tdata))
keep.append(int(tkeep)) keep.append(int(tkeep))
user.append(int(tuser)) user.append(int(tuser))
if tlast: if tlast:
frame.B = B
frame.N = N frame.N = N
frame.M = M frame.M = M
frame.WL = WL frame.WL = WL

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -114,7 +114,10 @@ def bench():
for i in range(32): for i in range(32):
l = [i] l = [i]
request.next = reduce(lambda x, y: x|y, [1<<y for y in l]) k = 0
for y in l:
k = k | 1 << y
request.next = k
yield clk.posedge yield clk.posedge
request.next = 0 request.next = 0
yield clk.posedge yield clk.posedge
@ -134,7 +137,10 @@ def bench():
for i in range(32): for i in range(32):
for j in range(32): for j in range(32):
l = [i, j] l = [i, j]
request.next = reduce(lambda x, y: x|y, [1<<y for y in l]) k = 0
for y in l:
k = k | 1 << y
request.next = k
yield clk.posedge yield clk.posedge
request.next = 0 request.next = 0
yield clk.posedge yield clk.posedge
@ -151,7 +157,10 @@ def bench():
for i in range(32): for i in range(32):
l = [(i*x) % 32 for x in [1,2,3,4,5]] l = [(i*x) % 32 for x in [1,2,3,4,5]]
request.next = reduce(lambda x, y: x|y, [1<<y for y in l]) k = 0
for y in l:
k = k | 1 << y
request.next = k
yield clk.posedge yield clk.posedge
request.next = 0 request.next = 0
yield clk.posedge yield clk.posedge

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -116,7 +116,10 @@ def bench():
for i in range(32): for i in range(32):
l = [i] l = [i]
request.next = reduce(lambda x, y: x|y, [1<<y for y in l]) k = 0
for y in l:
k = k | 1 << y
request.next = k
yield clk.posedge yield clk.posedge
request.next = 0 request.next = 0
yield clk.posedge yield clk.posedge
@ -143,7 +146,10 @@ def bench():
for i in range(32): for i in range(32):
l = [0, 5, 10, 15, 20, 25, 30] l = [0, 5, 10, 15, 20, 25, 30]
request.next = reduce(lambda x, y: x|y, [1<<y for y in l]) k = 0
for y in l:
k = k | 1 << y
request.next = k
yield clk.posedge yield clk.posedge
request.next = 0 request.next = 0
yield clk.posedge yield clk.posedge
@ -171,7 +177,10 @@ def bench():
for i in range(32): for i in range(32):
for j in range(32): for j in range(32):
l = [i, j] l = [i, j]
request.next = reduce(lambda x, y: x|y, [1<<y for y in l]) k = 0
for y in l:
k = k | 1 << y
request.next = k
yield clk.posedge yield clk.posedge
request.next = 0 request.next = 0
yield clk.posedge yield clk.posedge
@ -198,7 +207,10 @@ def bench():
for i in range(32): for i in range(32):
l = [(i*x) % 32 for x in [1,2,3,4,5]] l = [(i*x) % 32 for x in [1,2,3,4,5]]
request.next = reduce(lambda x, y: x|y, [1<<y for y in l]) k = 0
for y in l:
k = k | 1 << y
request.next = k
yield clk.posedge yield clk.posedge
request.next = 0 request.next = 0
yield clk.posedge yield clk.posedge

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -192,9 +196,9 @@ def bench():
print("test 1: test packet, length %d" % payload_len) print("test 1: test packet, length %d" % payload_len)
current_test.next = 1 current_test.next = 1
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(payload_len))) bytearray(range(payload_len)))
for wait in wait_normal, wait_pause_source, wait_pause_sink: for wait in wait_normal, wait_pause_source, wait_pause_sink:
@ -222,13 +226,13 @@ def bench():
print("test 2: back-to-back packets, length %d" % payload_len) print("test 2: back-to-back packets, length %d" % payload_len)
current_test.next = 2 current_test.next = 2
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(payload_len))) bytearray(range(payload_len)))
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(payload_len))) bytearray(range(payload_len)))
for wait in wait_normal, wait_pause_source, wait_pause_sink: for wait in wait_normal, wait_pause_source, wait_pause_sink:
@ -263,13 +267,13 @@ def bench():
print("test 3: tuser assert, length %d" % payload_len) print("test 3: tuser assert, length %d" % payload_len)
current_test.next = 3 current_test.next = 3
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(payload_len))) bytearray(range(payload_len)))
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(payload_len))) bytearray(range(payload_len)))
test_frame1.user = 1 test_frame1.user = 1

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -192,9 +196,9 @@ def bench():
print("test 1: test packet, length %d" % payload_len) print("test 1: test packet, length %d" % payload_len)
current_test.next = 1 current_test.next = 1
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(payload_len))) bytearray(range(payload_len)))
for wait in wait_normal, wait_pause_source, wait_pause_sink: for wait in wait_normal, wait_pause_source, wait_pause_sink:
@ -222,13 +226,13 @@ def bench():
print("test 2: back-to-back packets, length %d" % payload_len) print("test 2: back-to-back packets, length %d" % payload_len)
current_test.next = 2 current_test.next = 2
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(payload_len))) bytearray(range(payload_len)))
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(payload_len))) bytearray(range(payload_len)))
for wait in wait_normal, wait_pause_source, wait_pause_sink: for wait in wait_normal, wait_pause_source, wait_pause_sink:
@ -263,13 +267,13 @@ def bench():
print("test 3: tuser assert, length %d" % payload_len) print("test 3: tuser assert, length %d" % payload_len)
current_test.next = 3 current_test.next = 3
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(payload_len))) bytearray(range(payload_len)))
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(payload_len))) bytearray(range(payload_len)))
test_frame1.user = 1 test_frame1.user = 1

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -262,10 +266,10 @@ def bench():
print("test 1: port 0") print("test 1: port 0")
current_test.next = 1 current_test.next = 1
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x00\x52\x53\x54\x55' + b'\x5A\x00\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_0_queue.put(test_frame) source_0_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -286,10 +290,10 @@ def bench():
print("test 2: port 1") print("test 2: port 1")
current_test.next = 2 current_test.next = 2
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x01\x52\x53\x54\x55' + b'\x5A\x01\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_1_queue.put(test_frame) source_1_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -310,14 +314,14 @@ def bench():
print("test 3: back-to-back packets, same port") print("test 3: back-to-back packets, same port")
current_test.next = 3 current_test.next = 3
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x00\x52\x53\x54\x55' + b'\x5A\x00\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x00\x52\x53\x54\x55' + b'\x5A\x00\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_0_queue.put(test_frame1) source_0_queue.put(test_frame1)
source_0_queue.put(test_frame2) source_0_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -345,14 +349,14 @@ def bench():
print("test 4: back-to-back packets, different ports") print("test 4: back-to-back packets, different ports")
current_test.next = 4 current_test.next = 4
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x01\x52\x53\x54\x55' + b'\x5A\x01\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x02\x52\x53\x54\x55' + b'\x5A\x02\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_1_queue.put(test_frame1) source_1_queue.put(test_frame1)
source_2_queue.put(test_frame2) source_2_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -380,14 +384,14 @@ def bench():
print("test 5: alterate pause source") print("test 5: alterate pause source")
current_test.next = 5 current_test.next = 5
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x01\x52\x53\x54\x55' + b'\x5A\x01\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x02\x52\x53\x54\x55' + b'\x5A\x02\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_1_queue.put(test_frame1) source_1_queue.put(test_frame1)
source_2_queue.put(test_frame2) source_2_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -426,14 +430,14 @@ def bench():
print("test 6: alterate pause sink") print("test 6: alterate pause sink")
current_test.next = 6 current_test.next = 6
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x01\x52\x53\x54\x55' + b'\x5A\x01\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x02\x52\x53\x54\x55' + b'\x5A\x02\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_1_queue.put(test_frame1) source_1_queue.put(test_frame1)
source_2_queue.put(test_frame2) source_2_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -466,14 +470,14 @@ def bench():
print("test 4: back-to-back packets, different ports, arbitration test") print("test 4: back-to-back packets, different ports, arbitration test")
current_test.next = 4 current_test.next = 4
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x01\x52\x53\x54\x55' + b'\x5A\x01\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x02\x52\x53\x54\x55' + b'\x5A\x02\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_1_queue.put(test_frame1) source_1_queue.put(test_frame1)
source_2_queue.put(test_frame2) source_2_queue.put(test_frame2)
source_2_queue.put(test_frame2) source_2_queue.put(test_frame2)

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -287,10 +291,10 @@ def bench():
print("test 1: port 0") print("test 1: port 0")
current_test.next = 1 current_test.next = 1
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x00\x52\x53\x54\x55' + b'\x5A\x00\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_0_queue.put(test_frame) source_0_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -311,10 +315,10 @@ def bench():
print("test 2: port 1") print("test 2: port 1")
current_test.next = 2 current_test.next = 2
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x01\x52\x53\x54\x55' + b'\x5A\x01\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_1_queue.put(test_frame) source_1_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -335,14 +339,14 @@ def bench():
print("test 3: back-to-back packets, same port") print("test 3: back-to-back packets, same port")
current_test.next = 3 current_test.next = 3
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x00\x52\x53\x54\x55' + b'\x5A\x00\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x00\x52\x53\x54\x55' + b'\x5A\x00\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_0_queue.put(test_frame1) source_0_queue.put(test_frame1)
source_0_queue.put(test_frame2) source_0_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -370,14 +374,14 @@ def bench():
print("test 4: back-to-back packets, different ports") print("test 4: back-to-back packets, different ports")
current_test.next = 4 current_test.next = 4
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x01\x52\x53\x54\x55' + b'\x5A\x01\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x02\x52\x53\x54\x55' + b'\x5A\x02\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_1_queue.put(test_frame1) source_1_queue.put(test_frame1)
source_2_queue.put(test_frame2) source_2_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -405,14 +409,14 @@ def bench():
print("test 5: alterate pause source") print("test 5: alterate pause source")
current_test.next = 5 current_test.next = 5
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x01\x52\x53\x54\x55' + b'\x5A\x01\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x02\x52\x53\x54\x55' + b'\x5A\x02\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_1_queue.put(test_frame1) source_1_queue.put(test_frame1)
source_2_queue.put(test_frame2) source_2_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -451,14 +455,14 @@ def bench():
print("test 6: alterate pause sink") print("test 6: alterate pause sink")
current_test.next = 6 current_test.next = 6
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x01\x52\x53\x54\x55' + b'\x5A\x01\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x02\x52\x53\x54\x55' + b'\x5A\x02\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_1_queue.put(test_frame1) source_1_queue.put(test_frame1)
source_2_queue.put(test_frame2) source_2_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -491,14 +495,14 @@ def bench():
print("test 4: back-to-back packets, different ports, arbitration test") print("test 4: back-to-back packets, different ports, arbitration test")
current_test.next = 4 current_test.next = 4
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x01\x52\x53\x54\x55' + b'\x5A\x01\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x02\x52\x53\x54\x55' + b'\x5A\x02\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_1_queue.put(test_frame1) source_1_queue.put(test_frame1)
source_2_queue.put(test_frame2) source_2_queue.put(test_frame2)
source_2_queue.put(test_frame2) source_2_queue.put(test_frame2)

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -177,10 +181,10 @@ def bench():
print("test 1: test packet") print("test 1: test packet")
current_test.next = 1 current_test.next = 1
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield input_clk.posedge yield input_clk.posedge
@ -200,9 +204,9 @@ def bench():
print("test 2: longer packet") print("test 2: longer packet")
current_test.next = 2 current_test.next = 2
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield input_clk.posedge yield input_clk.posedge
@ -221,10 +225,10 @@ def bench():
print("test 3: test packet with pauses") print("test 3: test packet with pauses")
current_test.next = 3 current_test.next = 3
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield input_clk.posedge yield input_clk.posedge
@ -258,14 +262,14 @@ def bench():
print("test 4: back-to-back packets") print("test 4: back-to-back packets")
current_test.next = 4 current_test.next = 4
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield input_clk.posedge yield input_clk.posedge
@ -294,14 +298,14 @@ def bench():
print("test 5: alternate pause source") print("test 5: alternate pause source")
current_test.next = 5 current_test.next = 5
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield input_clk.posedge yield input_clk.posedge
@ -335,14 +339,14 @@ def bench():
print("test 6: alternate pause sink") print("test 6: alternate pause sink")
current_test.next = 6 current_test.next = 6
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield input_clk.posedge yield input_clk.posedge
@ -376,10 +380,10 @@ def bench():
print("test 7: tuser assert") print("test 7: tuser assert")
current_test.next = 7 current_test.next = 7
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame.user = 1 test_frame.user = 1
source_queue.put(test_frame) source_queue.put(test_frame)
yield input_clk.posedge yield input_clk.posedge

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -187,10 +191,10 @@ def bench():
print("test 1: test packet") print("test 1: test packet")
current_test.next = 1 current_test.next = 1
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield input_clk.posedge yield input_clk.posedge
@ -210,9 +214,9 @@ def bench():
print("test 2: longer packet") print("test 2: longer packet")
current_test.next = 2 current_test.next = 2
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield input_clk.posedge yield input_clk.posedge
@ -231,9 +235,9 @@ def bench():
print("test 3: test packet with pauses") print("test 3: test packet with pauses")
current_test.next = 3 current_test.next = 3
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield input_clk.posedge yield input_clk.posedge
@ -268,14 +272,14 @@ def bench():
print("test 4: back-to-back packets") print("test 4: back-to-back packets")
current_test.next = 4 current_test.next = 4
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield input_clk.posedge yield input_clk.posedge
@ -304,14 +308,14 @@ def bench():
print("test 5: alternate pause source") print("test 5: alternate pause source")
current_test.next = 5 current_test.next = 5
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield input_clk.posedge yield input_clk.posedge
@ -345,14 +349,14 @@ def bench():
print("test 6: alternate pause sink") print("test 6: alternate pause sink")
current_test.next = 6 current_test.next = 6
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield input_clk.posedge yield input_clk.posedge
@ -386,10 +390,10 @@ def bench():
print("test 7: tuser assert") print("test 7: tuser assert")
current_test.next = 7 current_test.next = 7
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame.user = 1 test_frame.user = 1
source_queue.put(test_frame) source_queue.put(test_frame)
yield input_clk.posedge yield input_clk.posedge

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -172,10 +176,10 @@ def bench():
print("test 1: test packet") print("test 1: test packet")
current_test.next = 1 current_test.next = 1
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield input_clk.posedge yield input_clk.posedge
@ -195,9 +199,9 @@ def bench():
print("test 2: longer packet") print("test 2: longer packet")
current_test.next = 2 current_test.next = 2
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield input_clk.posedge yield input_clk.posedge
@ -216,10 +220,10 @@ def bench():
print("test 3: test packet with pauses") print("test 3: test packet with pauses")
current_test.next = 3 current_test.next = 3
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield input_clk.posedge yield input_clk.posedge
@ -253,14 +257,14 @@ def bench():
print("test 4: back-to-back packets") print("test 4: back-to-back packets")
current_test.next = 4 current_test.next = 4
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield input_clk.posedge yield input_clk.posedge
@ -289,14 +293,14 @@ def bench():
print("test 5: alternate pause source") print("test 5: alternate pause source")
current_test.next = 5 current_test.next = 5
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield input_clk.posedge yield input_clk.posedge
@ -334,14 +338,14 @@ def bench():
print("test 6: alternate pause sink") print("test 6: alternate pause sink")
current_test.next = 6 current_test.next = 6
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield input_clk.posedge yield input_clk.posedge
@ -375,10 +379,10 @@ def bench():
print("test 7: tuser assert") print("test 7: tuser assert")
current_test.next = 7 current_test.next = 7
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame.user = 1 test_frame.user = 1
source_queue.put(test_frame) source_queue.put(test_frame)
yield input_clk.posedge yield input_clk.posedge
@ -393,9 +397,9 @@ def bench():
print("test 8: single packet overflow") print("test 8: single packet overflow")
current_test.next = 8 current_test.next = 8
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))*2) bytearray(range(256))*2)
source_queue.put(test_frame) source_queue.put(test_frame)
yield input_clk.posedge yield input_clk.posedge

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -182,10 +186,10 @@ def bench():
print("test 1: test packet") print("test 1: test packet")
current_test.next = 1 current_test.next = 1
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield input_clk.posedge yield input_clk.posedge
@ -205,9 +209,9 @@ def bench():
print("test 2: longer packet") print("test 2: longer packet")
current_test.next = 2 current_test.next = 2
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield input_clk.posedge yield input_clk.posedge
@ -226,9 +230,9 @@ def bench():
print("test 3: test packet with pauses") print("test 3: test packet with pauses")
current_test.next = 3 current_test.next = 3
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield input_clk.posedge yield input_clk.posedge
@ -263,14 +267,14 @@ def bench():
print("test 4: back-to-back packets") print("test 4: back-to-back packets")
current_test.next = 4 current_test.next = 4
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield input_clk.posedge yield input_clk.posedge
@ -299,14 +303,14 @@ def bench():
print("test 5: alternate pause source") print("test 5: alternate pause source")
current_test.next = 5 current_test.next = 5
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield input_clk.posedge yield input_clk.posedge
@ -344,14 +348,14 @@ def bench():
print("test 6: alternate pause sink") print("test 6: alternate pause sink")
current_test.next = 6 current_test.next = 6
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield input_clk.posedge yield input_clk.posedge
@ -385,10 +389,10 @@ def bench():
print("test 7: tuser assert") print("test 7: tuser assert")
current_test.next = 7 current_test.next = 7
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame.user = 1 test_frame.user = 1
source_queue.put(test_frame) source_queue.put(test_frame)
yield input_clk.posedge yield input_clk.posedge
@ -403,9 +407,9 @@ def bench():
print("test 8: single packet overflow") print("test 8: single packet overflow")
current_test.next = 8 current_test.next = 8
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))*2) bytearray(range(256))*2)
source_queue.put(test_frame) source_queue.put(test_frame)
yield input_clk.posedge yield input_clk.posedge

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -298,10 +302,10 @@ def bench():
output_2_select.next = 2 output_2_select.next = 2
output_3_select.next = 3 output_3_select.next = 3
test_frame0 = axis_ep.AXIStreamFrame('\x01\x00\x00\xFF\x01\x02\x03\x04') test_frame0 = axis_ep.AXIStreamFrame(b'\x01\x00\x00\xFF\x01\x02\x03\x04')
test_frame1 = axis_ep.AXIStreamFrame('\x01\x01\x01\xFF\x01\x02\x03\x04') test_frame1 = axis_ep.AXIStreamFrame(b'\x01\x01\x01\xFF\x01\x02\x03\x04')
test_frame2 = axis_ep.AXIStreamFrame('\x01\x02\x02\xFF\x01\x02\x03\x04') test_frame2 = axis_ep.AXIStreamFrame(b'\x01\x02\x02\xFF\x01\x02\x03\x04')
test_frame3 = axis_ep.AXIStreamFrame('\x01\x03\x03\xFF\x01\x02\x03\x04') test_frame3 = axis_ep.AXIStreamFrame(b'\x01\x03\x03\xFF\x01\x02\x03\x04')
source_0_queue.put(test_frame0) source_0_queue.put(test_frame0)
source_1_queue.put(test_frame1) source_1_queue.put(test_frame1)
source_2_queue.put(test_frame2) source_2_queue.put(test_frame2)
@ -348,10 +352,10 @@ def bench():
output_2_select.next = 1 output_2_select.next = 1
output_3_select.next = 0 output_3_select.next = 0
test_frame0 = axis_ep.AXIStreamFrame('\x02\x00\x03\xFF\x01\x02\x03\x04') test_frame0 = axis_ep.AXIStreamFrame(b'\x02\x00\x03\xFF\x01\x02\x03\x04')
test_frame1 = axis_ep.AXIStreamFrame('\x02\x01\x02\xFF\x01\x02\x03\x04') test_frame1 = axis_ep.AXIStreamFrame(b'\x02\x01\x02\xFF\x01\x02\x03\x04')
test_frame2 = axis_ep.AXIStreamFrame('\x02\x02\x01\xFF\x01\x02\x03\x04') test_frame2 = axis_ep.AXIStreamFrame(b'\x02\x02\x01\xFF\x01\x02\x03\x04')
test_frame3 = axis_ep.AXIStreamFrame('\x02\x03\x00\xFF\x01\x02\x03\x04') test_frame3 = axis_ep.AXIStreamFrame(b'\x02\x03\x00\xFF\x01\x02\x03\x04')
source_0_queue.put(test_frame0) source_0_queue.put(test_frame0)
source_1_queue.put(test_frame1) source_1_queue.put(test_frame1)
source_2_queue.put(test_frame2) source_2_queue.put(test_frame2)
@ -398,7 +402,7 @@ def bench():
output_2_select.next = 0 output_2_select.next = 0
output_3_select.next = 0 output_3_select.next = 0
test_frame0 = axis_ep.AXIStreamFrame('\x03\x00\xFF\xFF\x01\x02\x03\x04') test_frame0 = axis_ep.AXIStreamFrame(b'\x03\x00\xFF\xFF\x01\x02\x03\x04')
source_0_queue.put(test_frame0) source_0_queue.put(test_frame0)
yield clk.posedge yield clk.posedge

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -338,10 +342,10 @@ def bench():
output_2_select.next = 2 output_2_select.next = 2
output_3_select.next = 3 output_3_select.next = 3
test_frame0 = axis_ep.AXIStreamFrame('\x01\x00\x00\xFF\x01\x02\x03\x04') test_frame0 = axis_ep.AXIStreamFrame(b'\x01\x00\x00\xFF\x01\x02\x03\x04')
test_frame1 = axis_ep.AXIStreamFrame('\x01\x01\x01\xFF\x01\x02\x03\x04') test_frame1 = axis_ep.AXIStreamFrame(b'\x01\x01\x01\xFF\x01\x02\x03\x04')
test_frame2 = axis_ep.AXIStreamFrame('\x01\x02\x02\xFF\x01\x02\x03\x04') test_frame2 = axis_ep.AXIStreamFrame(b'\x01\x02\x02\xFF\x01\x02\x03\x04')
test_frame3 = axis_ep.AXIStreamFrame('\x01\x03\x03\xFF\x01\x02\x03\x04') test_frame3 = axis_ep.AXIStreamFrame(b'\x01\x03\x03\xFF\x01\x02\x03\x04')
source_0_queue.put(test_frame0) source_0_queue.put(test_frame0)
source_1_queue.put(test_frame1) source_1_queue.put(test_frame1)
source_2_queue.put(test_frame2) source_2_queue.put(test_frame2)
@ -388,10 +392,10 @@ def bench():
output_2_select.next = 1 output_2_select.next = 1
output_3_select.next = 0 output_3_select.next = 0
test_frame0 = axis_ep.AXIStreamFrame('\x02\x00\x03\xFF\x01\x02\x03\x04') test_frame0 = axis_ep.AXIStreamFrame(b'\x02\x00\x03\xFF\x01\x02\x03\x04')
test_frame1 = axis_ep.AXIStreamFrame('\x02\x01\x02\xFF\x01\x02\x03\x04') test_frame1 = axis_ep.AXIStreamFrame(b'\x02\x01\x02\xFF\x01\x02\x03\x04')
test_frame2 = axis_ep.AXIStreamFrame('\x02\x02\x01\xFF\x01\x02\x03\x04') test_frame2 = axis_ep.AXIStreamFrame(b'\x02\x02\x01\xFF\x01\x02\x03\x04')
test_frame3 = axis_ep.AXIStreamFrame('\x02\x03\x00\xFF\x01\x02\x03\x04') test_frame3 = axis_ep.AXIStreamFrame(b'\x02\x03\x00\xFF\x01\x02\x03\x04')
source_0_queue.put(test_frame0) source_0_queue.put(test_frame0)
source_1_queue.put(test_frame1) source_1_queue.put(test_frame1)
source_2_queue.put(test_frame2) source_2_queue.put(test_frame2)
@ -438,7 +442,7 @@ def bench():
output_2_select.next = 0 output_2_select.next = 0
output_3_select.next = 0 output_3_select.next = 0
test_frame0 = axis_ep.AXIStreamFrame('\x03\x00\xFF\xFF\x01\x02\x03\x04') test_frame0 = axis_ep.AXIStreamFrame(b'\x03\x00\xFF\xFF\x01\x02\x03\x04')
source_0_queue.put(test_frame0) source_0_queue.put(test_frame0)
yield clk.posedge yield clk.posedge

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -277,10 +281,10 @@ def bench():
select.next = 0 select.next = 0
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -303,10 +307,10 @@ def bench():
select.next = 1 select.next = 1
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -329,14 +333,14 @@ def bench():
select.next = 0 select.next = 0
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -366,14 +370,14 @@ def bench():
select.next = 1 select.next = 1
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -404,14 +408,14 @@ def bench():
select.next = 1 select.next = 1
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -447,14 +451,14 @@ def bench():
select.next = 1 select.next = 1
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -302,10 +306,10 @@ def bench():
select.next = 0 select.next = 0
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -328,10 +332,10 @@ def bench():
select.next = 1 select.next = 1
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -354,14 +358,14 @@ def bench():
select.next = 0 select.next = 0
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -391,14 +395,14 @@ def bench():
select.next = 1 select.next = 1
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -429,14 +433,14 @@ def bench():
select.next = 1 select.next = 1
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -472,14 +476,14 @@ def bench():
select.next = 1 select.next = 1
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -161,10 +165,10 @@ def bench():
print("test 1: test packet") print("test 1: test packet")
current_test.next = 1 current_test.next = 1
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -184,9 +188,9 @@ def bench():
print("test 2: longer packet") print("test 2: longer packet")
current_test.next = 2 current_test.next = 2
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -205,10 +209,10 @@ def bench():
print("test 3: test packet with pauses") print("test 3: test packet with pauses")
current_test.next = 3 current_test.next = 3
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -242,14 +246,14 @@ def bench():
print("test 4: back-to-back packets") print("test 4: back-to-back packets")
current_test.next = 4 current_test.next = 4
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -278,14 +282,14 @@ def bench():
print("test 5: alternate pause source") print("test 5: alternate pause source")
current_test.next = 5 current_test.next = 5
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -319,14 +323,14 @@ def bench():
print("test 6: alternate pause sink") print("test 6: alternate pause sink")
current_test.next = 6 current_test.next = 6
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -360,10 +364,10 @@ def bench():
print("test 7: tuser assert") print("test 7: tuser assert")
current_test.next = 7 current_test.next = 7
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame.user = 1 test_frame.user = 1
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -171,10 +175,10 @@ def bench():
print("test 1: test packet") print("test 1: test packet")
current_test.next = 1 current_test.next = 1
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -194,9 +198,9 @@ def bench():
print("test 2: longer packet") print("test 2: longer packet")
current_test.next = 2 current_test.next = 2
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -215,9 +219,9 @@ def bench():
print("test 3: test packet with pauses") print("test 3: test packet with pauses")
current_test.next = 3 current_test.next = 3
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -252,14 +256,14 @@ def bench():
print("test 4: back-to-back packets") print("test 4: back-to-back packets")
current_test.next = 4 current_test.next = 4
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -288,14 +292,14 @@ def bench():
print("test 5: alternate pause source") print("test 5: alternate pause source")
current_test.next = 5 current_test.next = 5
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -329,14 +333,14 @@ def bench():
print("test 6: alternate pause sink") print("test 6: alternate pause sink")
current_test.next = 6 current_test.next = 6
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -370,10 +374,10 @@ def bench():
print("test 7: tuser assert") print("test 7: tuser assert")
current_test.next = 7 current_test.next = 7
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame.user = 1 test_frame.user = 1
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -156,10 +160,10 @@ def bench():
print("test 1: test packet") print("test 1: test packet")
current_test.next = 1 current_test.next = 1
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -179,9 +183,9 @@ def bench():
print("test 2: longer packet") print("test 2: longer packet")
current_test.next = 2 current_test.next = 2
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -200,10 +204,10 @@ def bench():
print("test 3: test packet with pauses") print("test 3: test packet with pauses")
current_test.next = 3 current_test.next = 3
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -237,14 +241,14 @@ def bench():
print("test 4: back-to-back packets") print("test 4: back-to-back packets")
current_test.next = 4 current_test.next = 4
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -273,14 +277,14 @@ def bench():
print("test 5: alternate pause source") print("test 5: alternate pause source")
current_test.next = 5 current_test.next = 5
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -314,14 +318,14 @@ def bench():
print("test 6: alternate pause sink") print("test 6: alternate pause sink")
current_test.next = 6 current_test.next = 6
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -355,10 +359,10 @@ def bench():
print("test 7: tuser assert") print("test 7: tuser assert")
current_test.next = 7 current_test.next = 7
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame.user = 1 test_frame.user = 1
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -373,9 +377,9 @@ def bench():
print("test 8: single packet overflow") print("test 8: single packet overflow")
current_test.next = 8 current_test.next = 8
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))*2) bytearray(range(256))*2)
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -171,10 +175,10 @@ def bench():
print("test 1: test packet") print("test 1: test packet")
current_test.next = 1 current_test.next = 1
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -194,9 +198,9 @@ def bench():
print("test 2: longer packet") print("test 2: longer packet")
current_test.next = 2 current_test.next = 2
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -215,9 +219,9 @@ def bench():
print("test 3: test packet with pauses") print("test 3: test packet with pauses")
current_test.next = 3 current_test.next = 3
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -252,14 +256,14 @@ def bench():
print("test 4: back-to-back packets") print("test 4: back-to-back packets")
current_test.next = 4 current_test.next = 4
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -288,14 +292,14 @@ def bench():
print("test 5: alternate pause source") print("test 5: alternate pause source")
current_test.next = 5 current_test.next = 5
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -329,14 +333,14 @@ def bench():
print("test 6: alternate pause sink") print("test 6: alternate pause sink")
current_test.next = 6 current_test.next = 6
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -370,10 +374,10 @@ def bench():
print("test 7: tuser assert") print("test 7: tuser assert")
current_test.next = 7 current_test.next = 7
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame.user = 1 test_frame.user = 1
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -386,9 +390,9 @@ def bench():
print("test 8: single packet overflow") print("test 8: single packet overflow")
current_test.next = 8 current_test.next = 8
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))*2) bytearray(range(256))*2)
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,9 +25,13 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
import struct import struct
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
module = 'axis_frame_join_4' module = 'axis_frame_join_4'
@ -282,10 +286,10 @@ def bench():
print("test 1: test packet") print("test 1: test packet")
current_test.next = 1 current_test.next = 1
test_frame_0 = axis_ep.AXIStreamFrame('\x00\xAA\xBB\xCC\xDD\x00') test_frame_0 = axis_ep.AXIStreamFrame(b'\x00\xAA\xBB\xCC\xDD\x00')
test_frame_1 = axis_ep.AXIStreamFrame('\x01\xAA\xBB\xCC\xDD\x01') test_frame_1 = axis_ep.AXIStreamFrame(b'\x01\xAA\xBB\xCC\xDD\x01')
test_frame_2 = axis_ep.AXIStreamFrame('\x02\xAA\xBB\xCC\xDD\x02') test_frame_2 = axis_ep.AXIStreamFrame(b'\x02\xAA\xBB\xCC\xDD\x02')
test_frame_3 = axis_ep.AXIStreamFrame('\x03\xAA\xBB\xCC\xDD\x03') test_frame_3 = axis_ep.AXIStreamFrame(b'\x03\xAA\xBB\xCC\xDD\x03')
source_0_queue.put(test_frame_0) source_0_queue.put(test_frame_0)
source_1_queue.put(test_frame_1) source_1_queue.put(test_frame_1)
source_2_queue.put(test_frame_2) source_2_queue.put(test_frame_2)
@ -308,10 +312,10 @@ def bench():
print("test 2: longer packet") print("test 2: longer packet")
current_test.next = 2 current_test.next = 2
test_frame_0 = axis_ep.AXIStreamFrame('\x00' + bytearray(range(256)) + '\x00') test_frame_0 = axis_ep.AXIStreamFrame(b'\x00' + bytearray(range(256)) + b'\x00')
test_frame_1 = axis_ep.AXIStreamFrame('\x01\xAA\xBB\xCC\xDD\x01') test_frame_1 = axis_ep.AXIStreamFrame(b'\x01\xAA\xBB\xCC\xDD\x01')
test_frame_2 = axis_ep.AXIStreamFrame('\x02\xAA\xBB\xCC\xDD\x02') test_frame_2 = axis_ep.AXIStreamFrame(b'\x02\xAA\xBB\xCC\xDD\x02')
test_frame_3 = axis_ep.AXIStreamFrame('\x03\xAA\xBB\xCC\xDD\x03') test_frame_3 = axis_ep.AXIStreamFrame(b'\x03\xAA\xBB\xCC\xDD\x03')
source_0_queue.put(test_frame_0) source_0_queue.put(test_frame_0)
source_1_queue.put(test_frame_1) source_1_queue.put(test_frame_1)
source_2_queue.put(test_frame_2) source_2_queue.put(test_frame_2)
@ -334,10 +338,10 @@ def bench():
print("test 3: test packet with pauses") print("test 3: test packet with pauses")
current_test.next = 3 current_test.next = 3
test_frame_0 = axis_ep.AXIStreamFrame('\x00\xAA\xBB\xCC\xDD\x00') test_frame_0 = axis_ep.AXIStreamFrame(b'\x00\xAA\xBB\xCC\xDD\x00')
test_frame_1 = axis_ep.AXIStreamFrame('\x01\xAA\xBB\xCC\xDD\x01') test_frame_1 = axis_ep.AXIStreamFrame(b'\x01\xAA\xBB\xCC\xDD\x01')
test_frame_2 = axis_ep.AXIStreamFrame('\x02\xAA\xBB\xCC\xDD\x02') test_frame_2 = axis_ep.AXIStreamFrame(b'\x02\xAA\xBB\xCC\xDD\x02')
test_frame_3 = axis_ep.AXIStreamFrame('\x03\xAA\xBB\xCC\xDD\x03') test_frame_3 = axis_ep.AXIStreamFrame(b'\x03\xAA\xBB\xCC\xDD\x03')
source_0_queue.put(test_frame_0) source_0_queue.put(test_frame_0)
source_1_queue.put(test_frame_1) source_1_queue.put(test_frame_1)
source_2_queue.put(test_frame_2) source_2_queue.put(test_frame_2)
@ -374,14 +378,14 @@ def bench():
print("test 4: back-to-back packets") print("test 4: back-to-back packets")
current_test.next = 4 current_test.next = 4
test_frame_0a = axis_ep.AXIStreamFrame('\x00\xAA\xBB\xCC\xDD\x00') test_frame_0a = axis_ep.AXIStreamFrame(b'\x00\xAA\xBB\xCC\xDD\x00')
test_frame_0b = axis_ep.AXIStreamFrame('\x00\xAA\xBB\xCC\xDD\x00') test_frame_0b = axis_ep.AXIStreamFrame(b'\x00\xAA\xBB\xCC\xDD\x00')
test_frame_1a = axis_ep.AXIStreamFrame('\x01\xAA\xBB\xCC\xDD\x01') test_frame_1a = axis_ep.AXIStreamFrame(b'\x01\xAA\xBB\xCC\xDD\x01')
test_frame_1b = axis_ep.AXIStreamFrame('\x01\xAA\xBB\xCC\xDD\x01') test_frame_1b = axis_ep.AXIStreamFrame(b'\x01\xAA\xBB\xCC\xDD\x01')
test_frame_2a = axis_ep.AXIStreamFrame('\x02\xAA\xBB\xCC\xDD\x02') test_frame_2a = axis_ep.AXIStreamFrame(b'\x02\xAA\xBB\xCC\xDD\x02')
test_frame_2b = axis_ep.AXIStreamFrame('\x02\xAA\xBB\xCC\xDD\x02') test_frame_2b = axis_ep.AXIStreamFrame(b'\x02\xAA\xBB\xCC\xDD\x02')
test_frame_3a = axis_ep.AXIStreamFrame('\x03\xAA\xBB\xCC\xDD\x03') test_frame_3a = axis_ep.AXIStreamFrame(b'\x03\xAA\xBB\xCC\xDD\x03')
test_frame_3b = axis_ep.AXIStreamFrame('\x03\xAA\xBB\xCC\xDD\x03') test_frame_3b = axis_ep.AXIStreamFrame(b'\x03\xAA\xBB\xCC\xDD\x03')
source_0_queue.put(test_frame_0a) source_0_queue.put(test_frame_0a)
source_0_queue.put(test_frame_0b) source_0_queue.put(test_frame_0b)
source_1_queue.put(test_frame_1a) source_1_queue.put(test_frame_1a)
@ -416,14 +420,14 @@ def bench():
print("test 5: alternate pause source") print("test 5: alternate pause source")
current_test.next = 5 current_test.next = 5
test_frame_0a = axis_ep.AXIStreamFrame('\x00\xAA\xBB\xCC\xDD\x00') test_frame_0a = axis_ep.AXIStreamFrame(b'\x00\xAA\xBB\xCC\xDD\x00')
test_frame_0b = axis_ep.AXIStreamFrame('\x00\xAA\xBB\xCC\xDD\x00') test_frame_0b = axis_ep.AXIStreamFrame(b'\x00\xAA\xBB\xCC\xDD\x00')
test_frame_1a = axis_ep.AXIStreamFrame('\x01\xAA\xBB\xCC\xDD\x01') test_frame_1a = axis_ep.AXIStreamFrame(b'\x01\xAA\xBB\xCC\xDD\x01')
test_frame_1b = axis_ep.AXIStreamFrame('\x01\xAA\xBB\xCC\xDD\x01') test_frame_1b = axis_ep.AXIStreamFrame(b'\x01\xAA\xBB\xCC\xDD\x01')
test_frame_2a = axis_ep.AXIStreamFrame('\x02\xAA\xBB\xCC\xDD\x02') test_frame_2a = axis_ep.AXIStreamFrame(b'\x02\xAA\xBB\xCC\xDD\x02')
test_frame_2b = axis_ep.AXIStreamFrame('\x02\xAA\xBB\xCC\xDD\x02') test_frame_2b = axis_ep.AXIStreamFrame(b'\x02\xAA\xBB\xCC\xDD\x02')
test_frame_3a = axis_ep.AXIStreamFrame('\x03\xAA\xBB\xCC\xDD\x03') test_frame_3a = axis_ep.AXIStreamFrame(b'\x03\xAA\xBB\xCC\xDD\x03')
test_frame_3b = axis_ep.AXIStreamFrame('\x03\xAA\xBB\xCC\xDD\x03') test_frame_3b = axis_ep.AXIStreamFrame(b'\x03\xAA\xBB\xCC\xDD\x03')
source_0_queue.put(test_frame_0a) source_0_queue.put(test_frame_0a)
source_0_queue.put(test_frame_0b) source_0_queue.put(test_frame_0b)
source_1_queue.put(test_frame_1a) source_1_queue.put(test_frame_1a)
@ -469,14 +473,14 @@ def bench():
print("test 6: alternate pause sink") print("test 6: alternate pause sink")
current_test.next = 6 current_test.next = 6
test_frame_0a = axis_ep.AXIStreamFrame('\x00\xAA\xBB\xCC\xDD\x00') test_frame_0a = axis_ep.AXIStreamFrame(b'\x00\xAA\xBB\xCC\xDD\x00')
test_frame_0b = axis_ep.AXIStreamFrame('\x00\xAA\xBB\xCC\xDD\x00') test_frame_0b = axis_ep.AXIStreamFrame(b'\x00\xAA\xBB\xCC\xDD\x00')
test_frame_1a = axis_ep.AXIStreamFrame('\x01\xAA\xBB\xCC\xDD\x01') test_frame_1a = axis_ep.AXIStreamFrame(b'\x01\xAA\xBB\xCC\xDD\x01')
test_frame_1b = axis_ep.AXIStreamFrame('\x01\xAA\xBB\xCC\xDD\x01') test_frame_1b = axis_ep.AXIStreamFrame(b'\x01\xAA\xBB\xCC\xDD\x01')
test_frame_2a = axis_ep.AXIStreamFrame('\x02\xAA\xBB\xCC\xDD\x02') test_frame_2a = axis_ep.AXIStreamFrame(b'\x02\xAA\xBB\xCC\xDD\x02')
test_frame_2b = axis_ep.AXIStreamFrame('\x02\xAA\xBB\xCC\xDD\x02') test_frame_2b = axis_ep.AXIStreamFrame(b'\x02\xAA\xBB\xCC\xDD\x02')
test_frame_3a = axis_ep.AXIStreamFrame('\x03\xAA\xBB\xCC\xDD\x03') test_frame_3a = axis_ep.AXIStreamFrame(b'\x03\xAA\xBB\xCC\xDD\x03')
test_frame_3b = axis_ep.AXIStreamFrame('\x03\xAA\xBB\xCC\xDD\x03') test_frame_3b = axis_ep.AXIStreamFrame(b'\x03\xAA\xBB\xCC\xDD\x03')
source_0_queue.put(test_frame_0a) source_0_queue.put(test_frame_0a)
source_0_queue.put(test_frame_0b) source_0_queue.put(test_frame_0b)
source_1_queue.put(test_frame_1a) source_1_queue.put(test_frame_1a)
@ -516,10 +520,10 @@ def bench():
print("test 7: tuser assert") print("test 7: tuser assert")
current_test.next = 7 current_test.next = 7
test_frame_0 = axis_ep.AXIStreamFrame('\x00\xAA\xBB\xCC\xDD\x00') test_frame_0 = axis_ep.AXIStreamFrame(b'\x00\xAA\xBB\xCC\xDD\x00')
test_frame_1 = axis_ep.AXIStreamFrame('\x01\xAA\xBB\xCC\xDD\x01') test_frame_1 = axis_ep.AXIStreamFrame(b'\x01\xAA\xBB\xCC\xDD\x01')
test_frame_2 = axis_ep.AXIStreamFrame('\x02\xAA\xBB\xCC\xDD\x02') test_frame_2 = axis_ep.AXIStreamFrame(b'\x02\xAA\xBB\xCC\xDD\x02')
test_frame_3 = axis_ep.AXIStreamFrame('\x03\xAA\xBB\xCC\xDD\x03') test_frame_3 = axis_ep.AXIStreamFrame(b'\x03\xAA\xBB\xCC\xDD\x03')
test_frame_0.user = 1 test_frame_0.user = 1
source_0_queue.put(test_frame_0) source_0_queue.put(test_frame_0)
source_1_queue.put(test_frame_1) source_1_queue.put(test_frame_1)

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
import ll_ep import ll_ep
@ -157,10 +161,10 @@ def bench():
print("test 1: test packet") print("test 1: test packet")
current_test.next = 1 current_test.next = 1
source_queue.put(bytearray('\xDA\xD1\xD2\xD3\xD4\xD5' + source_queue.put(bytearray(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')) b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10'))
yield clk.posedge yield clk.posedge
yield ll_eof_out_n.negedge yield ll_eof_out_n.negedge
@ -171,10 +175,10 @@ def bench():
if not sink_queue.empty(): if not sink_queue.empty():
rx_frame = sink_queue.get() rx_frame = sink_queue.get()
assert bytearray(rx_frame) == ('\xDA\xD1\xD2\xD3\xD4\xD5' + assert bytearray(rx_frame) == (b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
yield delay(100) yield delay(100)
@ -182,10 +186,10 @@ def bench():
print("test 2: test packet with pauses") print("test 2: test packet with pauses")
current_test.next = 2 current_test.next = 2
source_queue.put(bytearray('\xDA\xD1\xD2\xD3\xD4\xD5' + source_queue.put(bytearray(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')) b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10'))
yield clk.posedge yield clk.posedge
yield delay(64) yield delay(64)
@ -210,10 +214,10 @@ def bench():
if not sink_queue.empty(): if not sink_queue.empty():
rx_frame = sink_queue.get() rx_frame = sink_queue.get()
assert bytearray(rx_frame) == ('\xDA\xD1\xD2\xD3\xD4\xD5' + assert bytearray(rx_frame) == (b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
yield delay(100) yield delay(100)

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -274,10 +278,10 @@ def bench():
select.next = 0 select.next = 0
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_0_queue.put(test_frame) source_0_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -300,10 +304,10 @@ def bench():
select.next = 1 select.next = 1
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_1_queue.put(test_frame) source_1_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -326,14 +330,14 @@ def bench():
select.next = 0 select.next = 0
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_0_queue.put(test_frame1) source_0_queue.put(test_frame1)
source_0_queue.put(test_frame2) source_0_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -363,14 +367,14 @@ def bench():
select.next = 1 select.next = 1
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_1_queue.put(test_frame1) source_1_queue.put(test_frame1)
source_2_queue.put(test_frame2) source_2_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -401,14 +405,14 @@ def bench():
select.next = 1 select.next = 1
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_1_queue.put(test_frame1) source_1_queue.put(test_frame1)
source_2_queue.put(test_frame2) source_2_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -450,14 +454,14 @@ def bench():
select.next = 1 select.next = 1
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_1_queue.put(test_frame1) source_1_queue.put(test_frame1)
source_2_queue.put(test_frame2) source_2_queue.put(test_frame2)
yield clk.posedge yield clk.posedge

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -299,10 +303,10 @@ def bench():
select.next = 0 select.next = 0
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_0_queue.put(test_frame) source_0_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -325,10 +329,10 @@ def bench():
select.next = 1 select.next = 1
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_1_queue.put(test_frame) source_1_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -351,14 +355,14 @@ def bench():
select.next = 0 select.next = 0
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_0_queue.put(test_frame1) source_0_queue.put(test_frame1)
source_0_queue.put(test_frame2) source_0_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -388,14 +392,14 @@ def bench():
select.next = 1 select.next = 1
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_1_queue.put(test_frame1) source_1_queue.put(test_frame1)
source_2_queue.put(test_frame2) source_2_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -426,14 +430,14 @@ def bench():
select.next = 1 select.next = 1
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_1_queue.put(test_frame1) source_1_queue.put(test_frame1)
source_2_queue.put(test_frame2) source_2_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -475,14 +479,14 @@ def bench():
select.next = 1 select.next = 1
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_1_queue.put(test_frame1) source_1_queue.put(test_frame1)
source_2_queue.put(test_frame2) source_2_queue.put(test_frame2)
yield clk.posedge yield clk.posedge

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -215,10 +219,10 @@ def bench():
print("test 1: test packet") print("test 1: test packet")
current_test.next = 1 current_test.next = 1
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -240,9 +244,9 @@ def bench():
print("test 2: longer packet") print("test 2: longer packet")
current_test.next = 2 current_test.next = 2
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -263,9 +267,9 @@ def bench():
print("test 3: test packet with pauses") print("test 3: test packet with pauses")
current_test.next = 3 current_test.next = 3
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -302,14 +306,14 @@ def bench():
print("test 4: back-to-back packets") print("test 4: back-to-back packets")
current_test.next = 4 current_test.next = 4
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -338,14 +342,14 @@ def bench():
print("test 5: alternate pause source") print("test 5: alternate pause source")
current_test.next = 5 current_test.next = 5
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -382,14 +386,14 @@ def bench():
print("test 6: alternate pause sink") print("test 6: alternate pause sink")
current_test.next = 6 current_test.next = 6
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -426,10 +430,10 @@ def bench():
print("test 7: tuser assert") print("test 7: tuser assert")
current_test.next = 7 current_test.next = 7
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame.user = 1 test_frame.user = 1
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -466,9 +470,9 @@ def bench():
test_frame = [] test_frame = []
for i in range(len(lens)): for i in range(len(lens)):
test_frame.append(axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame.append(axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(lens[i])))) bytearray(range(lens[i]))))
for f in test_frame: for f in test_frame:
@ -505,8 +509,8 @@ def bench():
assert byte_count == sum(len(f.data) for f in test_frame) assert byte_count == sum(len(f.data) for f in test_frame)
assert frame_count == len(test_frame) assert frame_count == len(test_frame)
test_rate = 1.0 * rate_num / rate_denom test_rate = float(rate_num) / float(rate_denom)
meas_rate = 1.0 * byte_count / tick_count meas_rate = float(byte_count) / float(tick_count)
error = (test_rate - meas_rate) / test_rate error = (test_rate - meas_rate) / test_rate
print("test rate %f" % test_rate) print("test rate %f" % test_rate)

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -225,10 +229,10 @@ def bench():
print("test 1: test packet") print("test 1: test packet")
current_test.next = 1 current_test.next = 1
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -250,9 +254,9 @@ def bench():
print("test 2: longer packet") print("test 2: longer packet")
current_test.next = 2 current_test.next = 2
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -273,9 +277,9 @@ def bench():
print("test 3: test packet with pauses") print("test 3: test packet with pauses")
current_test.next = 3 current_test.next = 3
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -312,14 +316,14 @@ def bench():
print("test 4: back-to-back packets") print("test 4: back-to-back packets")
current_test.next = 4 current_test.next = 4
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -348,14 +352,14 @@ def bench():
print("test 5: alternate pause source") print("test 5: alternate pause source")
current_test.next = 5 current_test.next = 5
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -392,14 +396,14 @@ def bench():
print("test 6: alternate pause sink") print("test 6: alternate pause sink")
current_test.next = 6 current_test.next = 6
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -436,10 +440,10 @@ def bench():
print("test 7: tuser assert") print("test 7: tuser assert")
current_test.next = 7 current_test.next = 7
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame.user = 1 test_frame.user = 1
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -476,9 +480,9 @@ def bench():
test_frame = [] test_frame = []
for i in range(len(lens)): for i in range(len(lens)):
test_frame.append(axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame.append(axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(lens[i])))) bytearray(range(lens[i]))))
for f in test_frame: for f in test_frame:
@ -515,8 +519,8 @@ def bench():
assert byte_count == sum(len(f.data) for f in test_frame) assert byte_count == sum(len(f.data) for f in test_frame)
assert frame_count == len(test_frame) assert frame_count == len(test_frame)
test_rate = 1.0 * rate_num / rate_denom test_rate = float(rate_num) / float(rate_denom)
meas_rate = 1.0 * byte_count / tick_count meas_rate = float(byte_count) / float(tick_count)
error = (test_rate - meas_rate) / test_rate error = (test_rate - meas_rate) / test_rate
print("test rate %f" % test_rate) print("test rate %f" % test_rate)

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -161,10 +165,10 @@ def bench():
print("test 1: test packet") print("test 1: test packet")
current_test.next = 1 current_test.next = 1
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -184,9 +188,9 @@ def bench():
print("test 2: longer packet") print("test 2: longer packet")
current_test.next = 2 current_test.next = 2
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -205,10 +209,10 @@ def bench():
print("test 3: test packet with pauses") print("test 3: test packet with pauses")
current_test.next = 3 current_test.next = 3
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -242,14 +246,14 @@ def bench():
print("test 4: back-to-back packets") print("test 4: back-to-back packets")
current_test.next = 4 current_test.next = 4
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -278,14 +282,14 @@ def bench():
print("test 5: alternate pause source") print("test 5: alternate pause source")
current_test.next = 5 current_test.next = 5
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -319,14 +323,14 @@ def bench():
print("test 6: alternate pause sink") print("test 6: alternate pause sink")
current_test.next = 6 current_test.next = 6
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -360,10 +364,10 @@ def bench():
print("test 7: tuser assert") print("test 7: tuser assert")
current_test.next = 7 current_test.next = 7
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame.user = 1 test_frame.user = 1
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -171,10 +175,10 @@ def bench():
print("test 1: test packet") print("test 1: test packet")
current_test.next = 1 current_test.next = 1
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -194,9 +198,9 @@ def bench():
print("test 2: longer packet") print("test 2: longer packet")
current_test.next = 2 current_test.next = 2
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -215,9 +219,9 @@ def bench():
print("test 3: test packet with pauses") print("test 3: test packet with pauses")
current_test.next = 3 current_test.next = 3
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -252,14 +256,14 @@ def bench():
print("test 4: back-to-back packets") print("test 4: back-to-back packets")
current_test.next = 4 current_test.next = 4
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -288,14 +292,14 @@ def bench():
print("test 5: alternate pause source") print("test 5: alternate pause source")
current_test.next = 5 current_test.next = 5
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -329,14 +333,14 @@ def bench():
print("test 6: alternate pause sink") print("test 6: alternate pause sink")
current_test.next = 6 current_test.next = 6
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -370,10 +374,10 @@ def bench():
print("test 7: tuser assert") print("test 7: tuser assert")
current_test.next = 7 current_test.next = 7
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame.user = 1 test_frame.user = 1
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -169,10 +173,10 @@ def bench():
print("test 1: test packet") print("test 1: test packet")
current_test.next = 1 current_test.next = 1
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -192,9 +196,9 @@ def bench():
print("test 2: longer packet") print("test 2: longer packet")
current_test.next = 2 current_test.next = 2
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -213,10 +217,10 @@ def bench():
print("test 3: test packet with pauses") print("test 3: test packet with pauses")
current_test.next = 3 current_test.next = 3
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -250,14 +254,14 @@ def bench():
print("test 4: back-to-back packets") print("test 4: back-to-back packets")
current_test.next = 4 current_test.next = 4
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -286,14 +290,14 @@ def bench():
print("test 5: alternate pause source") print("test 5: alternate pause source")
current_test.next = 5 current_test.next = 5
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -327,14 +331,14 @@ def bench():
print("test 6: alternate pause sink") print("test 6: alternate pause sink")
current_test.next = 6 current_test.next = 6
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -368,10 +372,10 @@ def bench():
print("test 7: tuser assert") print("test 7: tuser assert")
current_test.next = 7 current_test.next = 7
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame.user = 1 test_frame.user = 1
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -179,10 +183,10 @@ def bench():
print("test 1: test packet") print("test 1: test packet")
current_test.next = 1 current_test.next = 1
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -202,9 +206,9 @@ def bench():
print("test 2: longer packet") print("test 2: longer packet")
current_test.next = 2 current_test.next = 2
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -223,9 +227,9 @@ def bench():
print("test 3: test packet with pauses") print("test 3: test packet with pauses")
current_test.next = 3 current_test.next = 3
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -260,14 +264,14 @@ def bench():
print("test 4: back-to-back packets") print("test 4: back-to-back packets")
current_test.next = 4 current_test.next = 4
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -296,14 +300,14 @@ def bench():
print("test 5: alternate pause source") print("test 5: alternate pause source")
current_test.next = 5 current_test.next = 5
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -337,14 +341,14 @@ def bench():
print("test 6: alternate pause sink") print("test 6: alternate pause sink")
current_test.next = 6 current_test.next = 6
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -378,10 +382,10 @@ def bench():
print("test 7: tuser assert") print("test 7: tuser assert")
current_test.next = 7 current_test.next = 7
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame.user = 1 test_frame.user = 1
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -161,10 +165,10 @@ def bench():
print("test 1: test packet") print("test 1: test packet")
current_test.next = 1 current_test.next = 1
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -184,9 +188,9 @@ def bench():
print("test 2: longer packet") print("test 2: longer packet")
current_test.next = 2 current_test.next = 2
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -205,10 +209,10 @@ def bench():
print("test 3: test packet with pauses") print("test 3: test packet with pauses")
current_test.next = 3 current_test.next = 3
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -242,14 +246,14 @@ def bench():
print("test 4: back-to-back packets") print("test 4: back-to-back packets")
current_test.next = 4 current_test.next = 4
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -278,14 +282,14 @@ def bench():
print("test 5: alternate pause source") print("test 5: alternate pause source")
current_test.next = 5 current_test.next = 5
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -319,14 +323,14 @@ def bench():
print("test 6: alternate pause sink") print("test 6: alternate pause sink")
current_test.next = 6 current_test.next = 6
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -360,10 +364,10 @@ def bench():
print("test 7: tuser assert") print("test 7: tuser assert")
current_test.next = 7 current_test.next = 7
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame.user = 1 test_frame.user = 1
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
@ -171,10 +175,10 @@ def bench():
print("test 1: test packet") print("test 1: test packet")
current_test.next = 1 current_test.next = 1
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -194,9 +198,9 @@ def bench():
print("test 2: longer packet") print("test 2: longer packet")
current_test.next = 2 current_test.next = 2
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -215,9 +219,9 @@ def bench():
print("test 3: test packet with pauses") print("test 3: test packet with pauses")
current_test.next = 3 current_test.next = 3
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -252,14 +256,14 @@ def bench():
print("test 4: back-to-back packets") print("test 4: back-to-back packets")
current_test.next = 4 current_test.next = 4
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -288,14 +292,14 @@ def bench():
print("test 5: alternate pause source") print("test 5: alternate pause source")
current_test.next = 5 current_test.next = 5
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -329,14 +333,14 @@ def bench():
print("test 6: alternate pause sink") print("test 6: alternate pause sink")
current_test.next = 6 current_test.next = 6
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -370,10 +374,10 @@ def bench():
print("test 7: tuser assert") print("test 7: tuser assert")
current_test.next = 7 current_test.next = 7
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame.user = 1 test_frame.user = 1
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import struct import struct
import axis_ep import axis_ep
@ -293,10 +297,10 @@ def bench():
yield clk.posedge yield clk.posedge
trigger.next = 0 trigger.next = 0
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -347,9 +351,9 @@ def bench():
yield clk.posedge yield clk.posedge
trigger.next = 0 trigger.next = 0
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -401,9 +405,9 @@ def bench():
yield clk.posedge yield clk.posedge
trigger.next = 0 trigger.next = 0
test_frame = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(256))) bytearray(range(256)))
source_queue.put(test_frame) source_queue.put(test_frame)
yield clk.posedge yield clk.posedge
@ -469,14 +473,14 @@ def bench():
yield clk.posedge yield clk.posedge
trigger.next = 0 trigger.next = 0
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -528,14 +532,14 @@ def bench():
yield clk.posedge yield clk.posedge
trigger.next = 0 trigger.next = 0
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -587,14 +591,14 @@ def bench():
yield clk.posedge yield clk.posedge
trigger.next = 0 trigger.next = 0
test_frame1 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame1 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x01\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
test_frame2 = axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame2 = axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x02\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
source_queue.put(test_frame1) source_queue.put(test_frame1)
source_queue.put(test_frame2) source_queue.put(test_frame2)
yield clk.posedge yield clk.posedge
@ -650,9 +654,9 @@ def bench():
test_frame = [] test_frame = []
for i in range(len(lens)): for i in range(len(lens)):
test_frame.append(axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame.append(axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(lens[i])))) bytearray(range(lens[i]))))
for f in test_frame: for f in test_frame:
@ -710,9 +714,9 @@ def bench():
test_frame = [] test_frame = []
for i in range(len(lens)): for i in range(len(lens)):
test_frame.append(axis_ep.AXIStreamFrame('\xDA\xD1\xD2\xD3\xD4\xD5' + test_frame.append(axis_ep.AXIStreamFrame(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
bytearray(range(lens[i])))) bytearray(range(lens[i]))))
for f in test_frame: for f in test_frame:

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich
@ -25,7 +25,11 @@ THE SOFTWARE.
from myhdl import * from myhdl import *
import os import os
from Queue import Queue
try:
from queue import Queue
except ImportError:
from Queue import Queue
import axis_ep import axis_ep
import ll_ep import ll_ep
@ -156,10 +160,10 @@ def bench():
print("test 1: test packet") print("test 1: test packet")
current_test.next = 1 current_test.next = 1
source_queue.put(bytearray('\xDA\xD1\xD2\xD3\xD4\xD5' + source_queue.put(bytearray(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')) b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10'))
yield clk.posedge yield clk.posedge
yield axis_tlast.negedge yield axis_tlast.negedge
@ -170,10 +174,10 @@ def bench():
if not sink_queue.empty(): if not sink_queue.empty():
rx_frame = sink_queue.get() rx_frame = sink_queue.get()
assert bytearray(rx_frame) == ('\xDA\xD1\xD2\xD3\xD4\xD5' + assert bytearray(rx_frame) == (b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
yield delay(100) yield delay(100)
@ -181,10 +185,10 @@ def bench():
print("test 2: test packet with pauses") print("test 2: test packet with pauses")
current_test.next = 2 current_test.next = 2
source_queue.put(bytearray('\xDA\xD1\xD2\xD3\xD4\xD5' + source_queue.put(bytearray(b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')) b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10'))
yield clk.posedge yield clk.posedge
yield delay(64) yield delay(64)
@ -209,10 +213,10 @@ def bench():
if not sink_queue.empty(): if not sink_queue.empty():
rx_frame = sink_queue.get() rx_frame = sink_queue.get()
assert bytearray(rx_frame) == ('\xDA\xD1\xD2\xD3\xD4\xD5' + assert bytearray(rx_frame) == (b'\xDA\xD1\xD2\xD3\xD4\xD5' +
'\x5A\x51\x52\x53\x54\x55' + b'\x5A\x51\x52\x53\x54\x55' +
'\x80\x00' + b'\x80\x00' +
'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10') b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10')
yield delay(100) yield delay(100)

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
""" """
Copyright (c) 2014 Alex Forencich Copyright (c) 2014 Alex Forencich