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

Update testbenches for async send/recv

This commit is contained in:
Alex Forencich 2020-12-18 17:40:36 -08:00
parent e3fb7d19b2
commit 0c0fdc479b
33 changed files with 467 additions and 859 deletions

View File

@ -136,10 +136,9 @@ async def run_test(dut):
tb.log.info("Head pointer: %d", head_ptr)
# enqueue request
tb.enqueue_req_source.send(EnqueueReqTransaction(queue=0, tag=1))
await tb.enqueue_req_source.send(EnqueueReqTransaction(queue=0, tag=1))
await tb.enqueue_resp_sink.wait()
resp = tb.enqueue_resp_sink.recv()
resp = await tb.enqueue_resp_sink.recv()
tb.log.info("Enqueue response: %s", resp)
@ -152,13 +151,12 @@ async def run_test(dut):
assert not resp.error
# enqueue commit
tb.enqueue_commit_source.send(EnqueueCommitTransaction(op_tag=resp.op_tag))
await tb.enqueue_commit_source.send(EnqueueCommitTransaction(op_tag=resp.op_tag))
await Timer(100, 'ns')
# check for event
await tb.event_sink.wait()
event = tb.event_sink.recv()
event = await tb.event_sink.recv()
tb.log.info("Event: %s", event)
assert event.event == 1
@ -207,10 +205,9 @@ async def run_test(dut):
tb.log.info("Try enqueue into queue %d", q)
# enqueue request
tb.enqueue_req_source.send(EnqueueReqTransaction(queue=q, tag=current_tag))
await tb.enqueue_req_source.send(EnqueueReqTransaction(queue=q, tag=current_tag))
await tb.enqueue_resp_sink.wait()
resp = tb.enqueue_resp_sink.recv()
resp = await tb.enqueue_resp_sink.recv()
tb.log.info("Enqueue response: %s", resp)
@ -242,13 +239,12 @@ async def run_test(dut):
tb.log.info("Commit enqueue into queue %d", q)
# enqueue commit
tb.enqueue_commit_source.send(EnqueueCommitTransaction(op_tag=t))
await tb.enqueue_commit_source.send(EnqueueCommitTransaction(op_tag=t))
queue_depth[q] += 1
# check event
await tb.event_sink.wait()
event = tb.event_sink.recv()
event = await tb.event_sink.recv()
tb.log.info("Event: %s", event)
assert event.event == q

View File

@ -1018,7 +1018,13 @@ class Interface(object):
for p in self.ports:
await p.set_mtu(mtu)
def recv(self):
async def recv(self):
if not self.pkt_rx_queue:
self.pkt_rx_sync.clear()
await self.pkt_rx_sync.wait()
return self.recv_nowait()
def recv_nowait(self):
if self.pkt_rx_queue:
return self.pkt_rx_queue.popleft()
return None

View File

@ -138,8 +138,7 @@ async def run_test(dut):
await tb.axil_master.write_dword(0*32+16, head_ptr) # head pointer
# check for doorbell
await tb.doorbell_sink.wait()
db = tb.doorbell_sink.recv()
db = await tb.doorbell_sink.recv()
tb.log.info("Doorbell: %s", db)
assert db.queue == 0
@ -149,10 +148,9 @@ async def run_test(dut):
tb.log.info("Tail pointer: %d", tail_ptr)
# dequeue request
tb.dequeue_req_source.send(DequeueReqTransaction(queue=0, tag=1))
await tb.dequeue_req_source.send(DequeueReqTransaction(queue=0, tag=1))
await tb.dequeue_resp_sink.wait()
resp = tb.dequeue_resp_sink.recv()
resp = await tb.dequeue_resp_sink.recv()
tb.log.info("Dequeue response: %s", resp)
@ -166,7 +164,7 @@ async def run_test(dut):
assert not resp.error
# dequeue commit
tb.dequeue_commit_source.send(DequeueCommitTransaction(op_tag=resp.op_tag))
await tb.dequeue_commit_source.send(DequeueCommitTransaction(op_tag=resp.op_tag))
await Timer(100, 'ns')
@ -221,8 +219,7 @@ async def run_test(dut):
await tb.axil_master.write_dword(q*32+16, head_ptr) # head pointer
# check doorbell event
await tb.doorbell_sink.wait()
db = tb.doorbell_sink.recv()
db = await tb.doorbell_sink.recv()
tb.log.info("Doorbell: %s", db)
assert db.queue == q
@ -235,10 +232,9 @@ async def run_test(dut):
tb.log.info("Try dequeue from queue %d", q)
# dequeue request
tb.dequeue_req_source.send(DequeueReqTransaction(queue=q, tag=current_tag))
await tb.dequeue_req_source.send(DequeueReqTransaction(queue=q, tag=current_tag))
await tb.dequeue_resp_sink.wait()
resp = tb.dequeue_resp_sink.recv()
resp = await tb.dequeue_resp_sink.recv()
tb.log.info("Dequeue response: %s", resp)
@ -271,7 +267,7 @@ async def run_test(dut):
tb.log.info("Commit dequeue from queue %d", q)
# dequeue commit
tb.dequeue_commit_source.send(DequeueCommitTransaction(op_tag=t))
await tb.dequeue_commit_source.send(DequeueCommitTransaction(op_tag=t))
queue_depth[q] -= 1

View File

@ -117,13 +117,12 @@ async def run_test(dut, payload_lengths=None, payload_data=None, idle_inserter=N
test_frame = AxiStreamFrame(test_pkt.build())
test_frames.append(test_frame)
tb.source.send(test_frame)
await tb.source.send(test_frame)
ip_id = (ip_id + 1) & 0xffff
for test_pkt, test_frame in zip(test_pkts, test_frames):
await tb.sink.wait()
rx_csum = tb.sink.recv()
rx_csum = await tb.sink.recv()
csum = ~scapy.utils.checksum(bytes(test_pkt.payload)) & 0xffff

View File

@ -179,15 +179,14 @@ async def run_test(dut, payload_lengths=None, payload_data=None, idle_inserter=N
test_frame = AxiStreamFrame(test_pkt.build())
test_frames.append(test_frame)
tb.source.send(test_frame)
await tb.source.send(test_frame)
ip_id = (ip_id + 1) & 0xffff
for test_pkt, info, test_frame in zip(test_pkts, hash_info, test_frames):
hash_type, hash_val = info
await tb.sink.wait()
rx_hash = tb.sink.recv()
rx_hash = await tb.sink.recv()
tb.log.info("RX hash: 0x%08x (expected: 0x%08x) type: %s (expected: %s)",
rx_hash.hash, hash_val, HashType(rx_hash.hash_type.integer), hash_type)

View File

@ -120,8 +120,8 @@ async def run_test(dut, payload_lengths=None, payload_data=None, idle_inserter=N
test_frame = AxiStreamFrame(test_pkt.build())
test_frames.append(test_frame)
tb.source.send(test_frame)
tb.cmd_source.send(CsumCmdTransaction(csum_enable=0, csum_start=34, csum_offset=40, csum_init=0))
await tb.source.send(test_frame)
await tb.cmd_source.send(CsumCmdTransaction(csum_enable=0, csum_start=34, csum_offset=40, csum_init=0))
# inline partial checksum
test_pkts.append(test_pkt.copy())
@ -133,8 +133,8 @@ async def run_test(dut, payload_lengths=None, payload_data=None, idle_inserter=N
test_frame = AxiStreamFrame(pkt.build())
test_frames.append(test_frame)
tb.source.send(test_frame)
tb.cmd_source.send(CsumCmdTransaction(csum_enable=1, csum_start=34, csum_offset=40, csum_init=0))
await tb.source.send(test_frame)
await tb.cmd_source.send(CsumCmdTransaction(csum_enable=1, csum_start=34, csum_offset=40, csum_init=0))
# partial checksum in command
test_pkts.append(test_pkt.copy())
@ -146,12 +146,11 @@ async def run_test(dut, payload_lengths=None, payload_data=None, idle_inserter=N
test_frame = AxiStreamFrame(pkt.build())
test_frames.append(test_frame)
tb.source.send(test_frame)
tb.cmd_source.send(CsumCmdTransaction(csum_enable=1, csum_start=34, csum_offset=40, csum_init=partial_csum))
await tb.source.send(test_frame)
await tb.cmd_source.send(CsumCmdTransaction(csum_enable=1, csum_start=34, csum_offset=40, csum_init=partial_csum))
for test_pkt, test_frame in zip(test_pkts, test_frames):
await tb.sink.wait()
rx_frame = tb.sink.recv()
rx_frame = await tb.sink.recv()
rx_pkt = Ether(bytes(rx_frame))
@ -196,8 +195,8 @@ async def run_test_offsets(dut, payload_lengths=None, payload_data=None, idle_in
test_frame = AxiStreamFrame(test_pkt.build())
test_frames.append(test_frame)
tb.source.send(test_frame)
tb.cmd_source.send(CsumCmdTransaction(csum_enable=1, csum_start=start, csum_offset=offset, csum_init=0))
await tb.source.send(test_frame)
await tb.cmd_source.send(CsumCmdTransaction(csum_enable=1, csum_start=start, csum_offset=offset, csum_init=0))
csum = scapy.utils.checksum(bytes(test_pkt)[start:])
@ -212,8 +211,8 @@ async def run_test_offsets(dut, payload_lengths=None, payload_data=None, idle_in
test_frame = AxiStreamFrame(test_pkt.build())
test_frames.append(test_frame)
tb.source.send(test_frame)
tb.cmd_source.send(CsumCmdTransaction(csum_enable=1, csum_start=start, csum_offset=offset, csum_init=0))
await tb.source.send(test_frame)
await tb.cmd_source.send(CsumCmdTransaction(csum_enable=1, csum_start=start, csum_offset=offset, csum_init=0))
csum = scapy.utils.checksum(bytes(test_pkt)[start:])
@ -223,8 +222,7 @@ async def run_test_offsets(dut, payload_lengths=None, payload_data=None, idle_in
check_frames.append(check_frame)
for test_pkt, test_frame, check_frame in zip(test_pkts, test_frames, check_frames):
await tb.sink.wait()
rx_frame = tb.sink.recv()
rx_frame = await tb.sink.recv()
rx_pkt = Ether(bytes(rx_frame))

View File

@ -335,9 +335,9 @@ class TB(object):
if self.loopback_enable:
if not self.qsfp_0_sink.empty():
self.qsfp_0_source.send(self.qsfp_0_sink.recv())
await self.qsfp_0_source.send(await self.qsfp_0_sink.recv())
if not self.qsfp_1_sink.empty():
self.qsfp_1_source.send(self.qsfp_1_sink.recv())
await self.qsfp_1_source.send(await self.qsfp_1_sink.recv())
@cocotb.test()
@ -368,32 +368,24 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.qsfp_0_sink.wait()
pkt = tb.qsfp_0_sink.recv()
pkt = await tb.qsfp_0_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp_0_source.send(pkt)
await tb.qsfp_0_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
# await tb.driver.interfaces[1].start_xmit(data, 0)
# await tb.qsfp_1_0_sink.wait()
# pkt = tb.qsfp_1_0_sink.recv()
# pkt = await tb.qsfp_1_0_sink.recv()
# tb.log.info("Packet: %s", pkt)
# tb.qsfp_1_0_source.send(pkt)
# await tb.qsfp_1_0_source.send(pkt)
# await tb.driver.interfaces[1].wait()
# pkt = tb.driver.interfaces[1].recv()
# pkt = await tb.driver.interfaces[1].recv()
# tb.log.info("Packet: %s", pkt)
# assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -411,16 +403,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.qsfp_0_sink.wait()
pkt = tb.qsfp_0_sink.recv()
pkt = await tb.qsfp_0_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp_0_source.send(pkt)
await tb.qsfp_0_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -438,8 +426,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -459,8 +446,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -480,8 +466,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]

View File

@ -411,21 +411,21 @@ class TB(object):
if self.loopback_enable:
if not self.qsfp_0_0_sink.empty():
self.qsfp_0_0_source.send(self.qsfp_0_0_sink.recv())
await self.qsfp_0_0_source.send(await self.qsfp_0_0_sink.recv())
if not self.qsfp_0_1_sink.empty():
self.qsfp_0_1_source.send(self.qsfp_0_1_sink.recv())
await self.qsfp_0_1_source.send(await self.qsfp_0_1_sink.recv())
if not self.qsfp_0_2_sink.empty():
self.qsfp_0_2_source.send(self.qsfp_0_2_sink.recv())
await self.qsfp_0_2_source.send(await self.qsfp_0_2_sink.recv())
if not self.qsfp_0_3_sink.empty():
self.qsfp_0_3_source.send(self.qsfp_0_3_sink.recv())
await self.qsfp_0_3_source.send(await self.qsfp_0_3_sink.recv())
if not self.qsfp_1_0_sink.empty():
self.qsfp_1_0_source.send(self.qsfp_1_0_sink.recv())
await self.qsfp_1_0_source.send(await self.qsfp_1_0_sink.recv())
if not self.qsfp_1_1_sink.empty():
self.qsfp_1_1_source.send(self.qsfp_1_1_sink.recv())
await self.qsfp_1_1_source.send(await self.qsfp_1_1_sink.recv())
if not self.qsfp_1_2_sink.empty():
self.qsfp_1_2_source.send(self.qsfp_1_2_sink.recv())
await self.qsfp_1_2_source.send(await self.qsfp_1_2_sink.recv())
if not self.qsfp_1_3_sink.empty():
self.qsfp_1_3_source.send(self.qsfp_1_3_sink.recv())
await self.qsfp_1_3_source.send(await self.qsfp_1_3_sink.recv())
@cocotb.test()
@ -456,32 +456,24 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.qsfp_0_0_sink.wait()
pkt = tb.qsfp_0_0_sink.recv()
pkt = await tb.qsfp_0_0_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp_0_0_source.send(pkt)
await tb.qsfp_0_0_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
# await tb.driver.interfaces[1].start_xmit(data, 0)
# await tb.qsfp_1_0_sink.wait()
# pkt = tb.qsfp_1_0_sink.recv()
# pkt = await tb.qsfp_1_0_sink.recv()
# tb.log.info("Packet: %s", pkt)
# tb.qsfp_1_0_source.send(pkt)
# await tb.qsfp_1_0_source.send(pkt)
# await tb.driver.interfaces[1].wait()
# pkt = tb.driver.interfaces[1].recv()
# pkt = await tb.driver.interfaces[1].recv()
# tb.log.info("Packet: %s", pkt)
# assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -499,16 +491,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.qsfp_0_0_sink.wait()
pkt = tb.qsfp_0_0_sink.recv()
pkt = await tb.qsfp_0_0_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp_0_0_source.send(pkt)
await tb.qsfp_0_0_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -526,8 +514,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -547,8 +534,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]

View File

@ -411,21 +411,21 @@ class TB(object):
if self.loopback_enable:
if not self.qsfp_0_0_sink.empty():
self.qsfp_0_0_source.send(self.qsfp_0_0_sink.recv())
await self.qsfp_0_0_source.send(await self.qsfp_0_0_sink.recv())
if not self.qsfp_0_1_sink.empty():
self.qsfp_0_1_source.send(self.qsfp_0_1_sink.recv())
await self.qsfp_0_1_source.send(await self.qsfp_0_1_sink.recv())
if not self.qsfp_0_2_sink.empty():
self.qsfp_0_2_source.send(self.qsfp_0_2_sink.recv())
await self.qsfp_0_2_source.send(await self.qsfp_0_2_sink.recv())
if not self.qsfp_0_3_sink.empty():
self.qsfp_0_3_source.send(self.qsfp_0_3_sink.recv())
await self.qsfp_0_3_source.send(await self.qsfp_0_3_sink.recv())
if not self.qsfp_1_0_sink.empty():
self.qsfp_1_0_source.send(self.qsfp_1_0_sink.recv())
await self.qsfp_1_0_source.send(await self.qsfp_1_0_sink.recv())
if not self.qsfp_1_1_sink.empty():
self.qsfp_1_1_source.send(self.qsfp_1_1_sink.recv())
await self.qsfp_1_1_source.send(await self.qsfp_1_1_sink.recv())
if not self.qsfp_1_2_sink.empty():
self.qsfp_1_2_source.send(self.qsfp_1_2_sink.recv())
await self.qsfp_1_2_source.send(await self.qsfp_1_2_sink.recv())
if not self.qsfp_1_3_sink.empty():
self.qsfp_1_3_source.send(self.qsfp_1_3_sink.recv())
await self.qsfp_1_3_source.send(await self.qsfp_1_3_sink.recv())
@cocotb.test()
@ -456,32 +456,24 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.qsfp_0_0_sink.wait()
pkt = tb.qsfp_0_0_sink.recv()
pkt = await tb.qsfp_0_0_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp_0_0_source.send(pkt)
await tb.qsfp_0_0_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
# await tb.driver.interfaces[1].start_xmit(data, 0)
# await tb.qsfp_1_0_sink.wait()
# pkt = tb.qsfp_1_0_sink.recv()
# pkt = await tb.qsfp_1_0_sink.recv()
# tb.log.info("Packet: %s", pkt)
# tb.qsfp_1_0_source.send(pkt)
# await tb.qsfp_1_0_source.send(pkt)
# await tb.driver.interfaces[1].wait()
# pkt = tb.driver.interfaces[1].recv()
# pkt = await tb.driver.interfaces[1].recv()
# tb.log.info("Packet: %s", pkt)
# assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -499,16 +491,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.qsfp_0_0_sink.wait()
pkt = tb.qsfp_0_0_sink.recv()
pkt = await tb.qsfp_0_0_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp_0_0_source.send(pkt)
await tb.qsfp_0_0_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -526,8 +514,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -547,8 +534,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]

View File

@ -333,9 +333,9 @@ class TB(object):
if self.loopback_enable:
if not self.qsfp0_sink.empty():
self.qsfp0_source.send(self.qsfp0_sink.recv())
await self.qsfp0_source.send(await self.qsfp0_sink.recv())
if not self.qsfp1_sink.empty():
self.qsfp1_source.send(self.qsfp1_sink.recv())
await self.qsfp1_source.send(await self.qsfp1_sink.recv())
@cocotb.test()
@ -366,32 +366,24 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.qsfp0_sink.wait()
pkt = tb.qsfp0_sink.recv()
pkt = await tb.qsfp0_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp0_source.send(pkt)
await tb.qsfp0_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
# await tb.driver.interfaces[1].start_xmit(data, 0)
# await tb.qsfp1_0_sink.wait()
# pkt = tb.qsfp1_0_sink.recv()
# pkt = await tb.qsfp1_0_sink.recv()
# tb.log.info("Packet: %s", pkt)
# tb.qsfp1_0_source.send(pkt)
# await tb.qsfp1_0_source.send(pkt)
# await tb.driver.interfaces[1].wait()
# pkt = tb.driver.interfaces[1].recv()
# pkt = await tb.driver.interfaces[1].recv()
# tb.log.info("Packet: %s", pkt)
# assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -409,16 +401,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.qsfp0_sink.wait()
pkt = tb.qsfp0_sink.recv()
pkt = await tb.qsfp0_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp0_source.send(pkt)
await tb.qsfp0_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -436,8 +424,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -457,8 +444,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -478,8 +464,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]

View File

@ -409,21 +409,21 @@ class TB(object):
if self.loopback_enable:
if not self.qsfp0_1_sink.empty():
self.qsfp0_1_source.send(self.qsfp0_1_sink.recv())
await self.qsfp0_1_source.send(await self.qsfp0_1_sink.recv())
if not self.qsfp0_2_sink.empty():
self.qsfp0_2_source.send(self.qsfp0_2_sink.recv())
await self.qsfp0_2_source.send(await self.qsfp0_2_sink.recv())
if not self.qsfp0_3_sink.empty():
self.qsfp0_3_source.send(self.qsfp0_3_sink.recv())
await self.qsfp0_3_source.send(await self.qsfp0_3_sink.recv())
if not self.qsfp0_4_sink.empty():
self.qsfp0_4_source.send(self.qsfp0_4_sink.recv())
await self.qsfp0_4_source.send(await self.qsfp0_4_sink.recv())
if not self.qsfp1_1_sink.empty():
self.qsfp1_1_source.send(self.qsfp1_1_sink.recv())
await self.qsfp1_1_source.send(await self.qsfp1_1_sink.recv())
if not self.qsfp1_2_sink.empty():
self.qsfp1_2_source.send(self.qsfp1_2_sink.recv())
await self.qsfp1_2_source.send(await self.qsfp1_2_sink.recv())
if not self.qsfp1_3_sink.empty():
self.qsfp1_3_source.send(self.qsfp1_3_sink.recv())
await self.qsfp1_3_source.send(await self.qsfp1_3_sink.recv())
if not self.qsfp1_4_sink.empty():
self.qsfp1_4_source.send(self.qsfp1_4_sink.recv())
await self.qsfp1_4_source.send(await self.qsfp1_4_sink.recv())
@cocotb.test()
@ -454,32 +454,24 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.qsfp0_1_sink.wait()
pkt = tb.qsfp0_1_sink.recv()
pkt = await tb.qsfp0_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp0_1_source.send(pkt)
await tb.qsfp0_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
# await tb.driver.interfaces[1].start_xmit(data, 0)
# await tb.qsfp1_1_sink.wait()
# pkt = tb.qsfp1_1_sink.recv()
# pkt = await tb.qsfp1_1_sink.recv()
# tb.log.info("Packet: %s", pkt)
# tb.qsfp1_1_source.send(pkt)
# await tb.qsfp1_1_source.send(pkt)
# await tb.driver.interfaces[1].wait()
# pkt = tb.driver.interfaces[1].recv()
# pkt = await tb.driver.interfaces[1].recv()
# tb.log.info("Packet: %s", pkt)
# assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -497,16 +489,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.qsfp0_1_sink.wait()
pkt = tb.qsfp0_1_sink.recv()
pkt = await tb.qsfp0_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp0_1_source.send(pkt)
await tb.qsfp0_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -524,8 +512,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -545,8 +532,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]

View File

@ -333,9 +333,9 @@ class TB(object):
if self.loopback_enable:
if not self.qsfp0_sink.empty():
self.qsfp0_source.send(self.qsfp0_sink.recv())
await self.qsfp0_source.send(await self.qsfp0_sink.recv())
if not self.qsfp1_sink.empty():
self.qsfp1_source.send(self.qsfp1_sink.recv())
await self.qsfp1_source.send(await self.qsfp1_sink.recv())
@cocotb.test()
@ -366,32 +366,24 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.qsfp0_sink.wait()
pkt = tb.qsfp0_sink.recv()
pkt = await tb.qsfp0_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp0_source.send(pkt)
await tb.qsfp0_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
# await tb.driver.interfaces[1].start_xmit(data, 0)
# await tb.qsfp1_0_sink.wait()
# pkt = tb.qsfp1_0_sink.recv()
# pkt = await tb.qsfp1_0_sink.recv()
# tb.log.info("Packet: %s", pkt)
# tb.qsfp1_0_source.send(pkt)
# await tb.qsfp1_0_source.send(pkt)
# await tb.driver.interfaces[1].wait()
# pkt = tb.driver.interfaces[1].recv()
# pkt = await tb.driver.interfaces[1].recv()
# tb.log.info("Packet: %s", pkt)
# assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -409,16 +401,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.qsfp0_sink.wait()
pkt = tb.qsfp0_sink.recv()
pkt = await tb.qsfp0_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp0_source.send(pkt)
await tb.qsfp0_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -436,8 +424,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -457,8 +444,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -478,8 +464,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]

View File

@ -409,21 +409,21 @@ class TB(object):
if self.loopback_enable:
if not self.qsfp0_1_sink.empty():
self.qsfp0_1_source.send(self.qsfp0_1_sink.recv())
await self.qsfp0_1_source.send(await self.qsfp0_1_sink.recv())
if not self.qsfp0_2_sink.empty():
self.qsfp0_2_source.send(self.qsfp0_2_sink.recv())
await self.qsfp0_2_source.send(await self.qsfp0_2_sink.recv())
if not self.qsfp0_3_sink.empty():
self.qsfp0_3_source.send(self.qsfp0_3_sink.recv())
await self.qsfp0_3_source.send(await self.qsfp0_3_sink.recv())
if not self.qsfp0_4_sink.empty():
self.qsfp0_4_source.send(self.qsfp0_4_sink.recv())
await self.qsfp0_4_source.send(await self.qsfp0_4_sink.recv())
if not self.qsfp1_1_sink.empty():
self.qsfp1_1_source.send(self.qsfp1_1_sink.recv())
await self.qsfp1_1_source.send(await self.qsfp1_1_sink.recv())
if not self.qsfp1_2_sink.empty():
self.qsfp1_2_source.send(self.qsfp1_2_sink.recv())
await self.qsfp1_2_source.send(await self.qsfp1_2_sink.recv())
if not self.qsfp1_3_sink.empty():
self.qsfp1_3_source.send(self.qsfp1_3_sink.recv())
await self.qsfp1_3_source.send(await self.qsfp1_3_sink.recv())
if not self.qsfp1_4_sink.empty():
self.qsfp1_4_source.send(self.qsfp1_4_sink.recv())
await self.qsfp1_4_source.send(await self.qsfp1_4_sink.recv())
@cocotb.test()
@ -454,32 +454,24 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.qsfp0_1_sink.wait()
pkt = tb.qsfp0_1_sink.recv()
pkt = await tb.qsfp0_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp0_1_source.send(pkt)
await tb.qsfp0_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
# await tb.driver.interfaces[1].start_xmit(data, 0)
# await tb.qsfp1_1_sink.wait()
# pkt = tb.qsfp1_1_sink.recv()
# pkt = await tb.qsfp1_1_sink.recv()
# tb.log.info("Packet: %s", pkt)
# tb.qsfp1_1_source.send(pkt)
# await tb.qsfp1_1_source.send(pkt)
# await tb.driver.interfaces[1].wait()
# pkt = tb.driver.interfaces[1].recv()
# pkt = await tb.driver.interfaces[1].recv()
# tb.log.info("Packet: %s", pkt)
# assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -497,16 +489,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.qsfp0_1_sink.wait()
pkt = tb.qsfp0_1_sink.recv()
pkt = await tb.qsfp0_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp0_1_source.send(pkt)
await tb.qsfp0_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -524,8 +512,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -545,8 +532,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]

View File

@ -322,9 +322,9 @@ class TB(object):
if self.loopback_enable:
if not self.qsfp0_sink.empty():
self.qsfp0_source.send(self.qsfp0_sink.recv())
await self.qsfp0_source.send(await self.qsfp0_sink.recv())
if not self.qsfp1_sink.empty():
self.qsfp1_source.send(self.qsfp1_sink.recv())
await self.qsfp1_source.send(await self.qsfp1_sink.recv())
@cocotb.test()
@ -355,32 +355,24 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.qsfp0_sink.wait()
pkt = tb.qsfp0_sink.recv()
pkt = await tb.qsfp0_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp0_source.send(pkt)
await tb.qsfp0_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
# await tb.driver.interfaces[1].start_xmit(data, 0)
# await tb.qsfp1_0_sink.wait()
# pkt = tb.qsfp1_0_sink.recv()
# pkt = await tb.qsfp1_0_sink.recv()
# tb.log.info("Packet: %s", pkt)
# tb.qsfp1_0_source.send(pkt)
# await tb.qsfp1_0_source.send(pkt)
# await tb.driver.interfaces[1].wait()
# pkt = tb.driver.interfaces[1].recv()
# pkt = await tb.driver.interfaces[1].recv()
# tb.log.info("Packet: %s", pkt)
# assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -398,16 +390,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.qsfp0_sink.wait()
pkt = tb.qsfp0_sink.recv()
pkt = await tb.qsfp0_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp0_source.send(pkt)
await tb.qsfp0_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -425,8 +413,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -446,8 +433,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -467,8 +453,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]

View File

@ -398,21 +398,21 @@ class TB(object):
if self.loopback_enable:
if not self.qsfp0_1_sink.empty():
self.qsfp0_1_source.send(self.qsfp0_1_sink.recv())
await self.qsfp0_1_source.send(await self.qsfp0_1_sink.recv())
if not self.qsfp0_2_sink.empty():
self.qsfp0_2_source.send(self.qsfp0_2_sink.recv())
await self.qsfp0_2_source.send(await self.qsfp0_2_sink.recv())
if not self.qsfp0_3_sink.empty():
self.qsfp0_3_source.send(self.qsfp0_3_sink.recv())
await self.qsfp0_3_source.send(await self.qsfp0_3_sink.recv())
if not self.qsfp0_4_sink.empty():
self.qsfp0_4_source.send(self.qsfp0_4_sink.recv())
await self.qsfp0_4_source.send(await self.qsfp0_4_sink.recv())
if not self.qsfp1_1_sink.empty():
self.qsfp1_1_source.send(self.qsfp1_1_sink.recv())
await self.qsfp1_1_source.send(await self.qsfp1_1_sink.recv())
if not self.qsfp1_2_sink.empty():
self.qsfp1_2_source.send(self.qsfp1_2_sink.recv())
await self.qsfp1_2_source.send(await self.qsfp1_2_sink.recv())
if not self.qsfp1_3_sink.empty():
self.qsfp1_3_source.send(self.qsfp1_3_sink.recv())
await self.qsfp1_3_source.send(await self.qsfp1_3_sink.recv())
if not self.qsfp1_4_sink.empty():
self.qsfp1_4_source.send(self.qsfp1_4_sink.recv())
await self.qsfp1_4_source.send(await self.qsfp1_4_sink.recv())
@cocotb.test()
@ -443,32 +443,24 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.qsfp0_1_sink.wait()
pkt = tb.qsfp0_1_sink.recv()
pkt = await tb.qsfp0_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp0_1_source.send(pkt)
await tb.qsfp0_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
# await tb.driver.interfaces[1].start_xmit(data, 0)
# await tb.qsfp1_1_sink.wait()
# pkt = tb.qsfp1_1_sink.recv()
# pkt = await tb.qsfp1_1_sink.recv()
# tb.log.info("Packet: %s", pkt)
# tb.qsfp1_1_source.send(pkt)
# await tb.qsfp1_1_source.send(pkt)
# await tb.driver.interfaces[1].wait()
# pkt = tb.driver.interfaces[1].recv()
# pkt = await tb.driver.interfaces[1].recv()
# tb.log.info("Packet: %s", pkt)
# assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -486,16 +478,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.qsfp0_1_sink.wait()
pkt = tb.qsfp0_1_sink.recv()
pkt = await tb.qsfp0_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp0_1_source.send(pkt)
await tb.qsfp0_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -513,8 +501,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -534,8 +521,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]

View File

@ -311,7 +311,7 @@ class TB(object):
if self.loopback_enable:
if not self.qsfp_sink.empty():
self.qsfp_source.send(self.qsfp_sink.recv())
await self.qsfp_source.send(await self.qsfp_sink.recv())
@cocotb.test()
@ -341,16 +341,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.qsfp_sink.wait()
pkt = tb.qsfp_sink.recv()
pkt = await tb.qsfp_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp_source.send(pkt)
await tb.qsfp_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -368,16 +364,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.qsfp_sink.wait()
pkt = tb.qsfp_sink.recv()
pkt = await tb.qsfp_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp_source.send(pkt)
await tb.qsfp_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -395,8 +387,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -416,8 +407,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -437,8 +427,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]

View File

@ -349,13 +349,13 @@ class TB(object):
if self.loopback_enable:
if not self.qsfp_1_sink.empty():
self.qsfp_1_source.send(self.qsfp_1_sink.recv())
await self.qsfp_1_source.send(await self.qsfp_1_sink.recv())
if not self.qsfp_2_sink.empty():
self.qsfp_2_source.send(self.qsfp_2_sink.recv())
await self.qsfp_2_source.send(await self.qsfp_2_sink.recv())
if not self.qsfp_3_sink.empty():
self.qsfp_3_source.send(self.qsfp_3_sink.recv())
await self.qsfp_3_source.send(await self.qsfp_3_sink.recv())
if not self.qsfp_4_sink.empty():
self.qsfp_4_source.send(self.qsfp_4_sink.recv())
await self.qsfp_4_source.send(await self.qsfp_4_sink.recv())
@cocotb.test()
@ -385,16 +385,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.qsfp_1_sink.wait()
pkt = tb.qsfp_1_sink.recv()
pkt = await tb.qsfp_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp_1_source.send(pkt)
await tb.qsfp_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -412,16 +408,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.qsfp_1_sink.wait()
pkt = tb.qsfp_1_sink.recv()
pkt = await tb.qsfp_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp_1_source.send(pkt)
await tb.qsfp_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -439,8 +431,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -460,8 +451,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]

View File

@ -332,9 +332,9 @@ class TB(object):
if self.loopback_enable:
if not self.sfp_1_sink.empty():
self.sfp_1_source.send(self.sfp_1_sink.recv())
await self.sfp_1_source.send(await self.sfp_1_sink.recv())
if not self.sfp_2_sink.empty():
self.sfp_2_source.send(self.sfp_2_sink.recv())
await self.sfp_2_source.send(await self.sfp_2_sink.recv())
@cocotb.test()
@ -365,32 +365,24 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.sfp_1_sink.wait()
pkt = tb.sfp_1_sink.recv()
pkt = await tb.sfp_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.sfp_1_source.send(pkt)
await tb.sfp_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
# await tb.driver.interfaces[1].start_xmit(data, 0)
# await tb.sfp_2_sink.wait()
# pkt = tb.sfp_2_sink.recv()
# pkt = await tb.sfp_2_sink.recv()
# tb.log.info("Packet: %s", pkt)
# tb.sfp_2_source.send(pkt)
# await tb.sfp_2_source.send(pkt)
# await tb.driver.interfaces[1].wait()
# pkt = tb.driver.interfaces[1].recv()
# pkt = await tb.driver.interfaces[1].recv()
# tb.log.info("Packet: %s", pkt)
# assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -408,16 +400,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.sfp_1_sink.wait()
pkt = tb.sfp_1_sink.recv()
pkt = await tb.sfp_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.sfp_1_source.send(pkt)
await tb.sfp_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -435,8 +423,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -456,8 +443,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]

View File

@ -336,9 +336,9 @@ class TB(object):
if self.loopback_enable:
if not self.sfp_1_sink.empty():
self.sfp_1_source.send(self.sfp_1_sink.recv())
await self.sfp_1_source.send(await self.sfp_1_sink.recv())
if not self.sfp_2_sink.empty():
self.sfp_2_source.send(self.sfp_2_sink.recv())
await self.sfp_2_source.send(await self.sfp_2_sink.recv())
@cocotb.test()
@ -369,32 +369,24 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.sfp_1_sink.wait()
pkt = tb.sfp_1_sink.recv()
pkt = await tb.sfp_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.sfp_1_source.send(pkt)
await tb.sfp_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
# await tb.driver.interfaces[1].start_xmit(data, 0)
# await tb.sfp_2_sink.wait()
# pkt = tb.sfp_2_sink.recv()
# pkt = await tb.sfp_2_sink.recv()
# tb.log.info("Packet: %s", pkt)
# tb.sfp_2_source.send(pkt)
# await tb.sfp_2_source.send(pkt)
# await tb.driver.interfaces[1].wait()
# pkt = tb.driver.interfaces[1].recv()
# pkt = await tb.driver.interfaces[1].recv()
# tb.log.info("Packet: %s", pkt)
# assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -412,16 +404,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.sfp_1_sink.wait()
pkt = tb.sfp_1_sink.recv()
pkt = await tb.sfp_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.sfp_1_source.send(pkt)
await tb.sfp_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -439,8 +427,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -460,8 +447,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]

View File

@ -343,13 +343,13 @@ class TB(object):
if self.loopback_enable:
if not self.sfp_1_sink.empty():
self.sfp_1_source.send(self.sfp_1_sink.recv())
await self.sfp_1_source.send(await self.sfp_1_sink.recv())
if not self.sfp_2_sink.empty():
self.sfp_2_source.send(self.sfp_2_sink.recv())
await self.sfp_2_source.send(await self.sfp_2_sink.recv())
if not self.sfp_3_sink.empty():
self.sfp_3_source.send(self.sfp_3_sink.recv())
await self.sfp_3_source.send(await self.sfp_3_sink.recv())
if not self.sfp_4_sink.empty():
self.sfp_4_source.send(self.sfp_4_sink.recv())
await self.sfp_4_source.send(await self.sfp_4_sink.recv())
@cocotb.test()
@ -380,32 +380,24 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.sfp_1_sink.wait()
pkt = tb.sfp_1_sink.recv()
pkt = await tb.sfp_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.sfp_1_source.send(pkt)
await tb.sfp_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
# await tb.driver.interfaces[1].start_xmit(data, 0)
# await tb.sfp_2_sink.wait()
# pkt = tb.sfp_2_sink.recv()
# pkt = await tb.sfp_2_sink.recv()
# tb.log.info("Packet: %s", pkt)
# tb.sfp_2_source.send(pkt)
# await tb.sfp_2_source.send(pkt)
# await tb.driver.interfaces[1].wait()
# pkt = tb.driver.interfaces[1].recv()
# pkt = await tb.driver.interfaces[1].recv()
# tb.log.info("Packet: %s", pkt)
# assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -423,16 +415,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.sfp_1_sink.wait()
pkt = tb.sfp_1_sink.recv()
pkt = await tb.sfp_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.sfp_1_source.send(pkt)
await tb.sfp_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -450,8 +438,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -471,8 +458,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]

View File

@ -360,13 +360,13 @@ class TB(object):
if self.loopback_enable:
if not self.qsfp_1_sink.empty():
self.qsfp_1_source.send(self.qsfp_1_sink.recv())
await self.qsfp_1_source.send(await self.qsfp_1_sink.recv())
if not self.qsfp_2_sink.empty():
self.qsfp_2_source.send(self.qsfp_2_sink.recv())
await self.qsfp_2_source.send(await self.qsfp_2_sink.recv())
if not self.qsfp_3_sink.empty():
self.qsfp_3_source.send(self.qsfp_3_sink.recv())
await self.qsfp_3_source.send(await self.qsfp_3_sink.recv())
if not self.qsfp_4_sink.empty():
self.qsfp_4_source.send(self.qsfp_4_sink.recv())
await self.qsfp_4_source.send(await self.qsfp_4_sink.recv())
@cocotb.test()
@ -396,16 +396,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.qsfp_1_sink.wait()
pkt = tb.qsfp_1_sink.recv()
pkt = await tb.qsfp_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp_1_source.send(pkt)
await tb.qsfp_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -423,16 +419,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.qsfp_1_sink.wait()
pkt = tb.qsfp_1_sink.recv()
pkt = await tb.qsfp_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp_1_source.send(pkt)
await tb.qsfp_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -450,8 +442,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -471,8 +462,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]

View File

@ -339,9 +339,9 @@ class TB(object):
if self.loopback_enable:
if not self.qsfp1_sink.empty():
self.qsfp1_source.send(self.qsfp1_sink.recv())
await self.qsfp1_source.send(await self.qsfp1_sink.recv())
if not self.qsfp2_sink.empty():
self.qsfp2_source.send(self.qsfp2_sink.recv())
await self.qsfp2_source.send(await self.qsfp2_sink.recv())
@cocotb.test()
@ -372,32 +372,24 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.qsfp1_sink.wait()
pkt = tb.qsfp1_sink.recv()
pkt = await tb.qsfp1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp1_source.send(pkt)
await tb.qsfp1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
# await tb.driver.interfaces[1].start_xmit(data, 0)
# await tb.qsfp2_0_sink.wait()
# pkt = tb.qsfp2_0_sink.recv()
# pkt await = tb.qsfp2_0_sink.recv()
# tb.log.info("Packet: %s", pkt)
# tb.qsfp2_0_source.send(pkt)
# await tb.qsfp2_0_source.send(pkt)
# await tb.driver.interfaces[1].wait()
# pkt = tb.driver.interfaces[1].recv()
# pkt await = tb.driver.interfaces[1].recv()
# tb.log.info("Packet: %s", pkt)
# assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -415,16 +407,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.qsfp1_sink.wait()
pkt = tb.qsfp1_sink.recv()
pkt = await tb.qsfp1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp1_source.send(pkt)
await tb.qsfp1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -442,8 +430,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -463,8 +450,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -484,8 +470,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]

View File

@ -415,21 +415,21 @@ class TB(object):
if self.loopback_enable:
if not self.qsfp1_1_sink.empty():
self.qsfp1_1_source.send(self.qsfp1_1_sink.recv())
await self.qsfp1_1_source.send(await self.qsfp1_1_sink.recv())
if not self.qsfp1_2_sink.empty():
self.qsfp1_2_source.send(self.qsfp1_2_sink.recv())
await self.qsfp1_2_source.send(await self.qsfp1_2_sink.recv())
if not self.qsfp1_3_sink.empty():
self.qsfp1_3_source.send(self.qsfp1_3_sink.recv())
await self.qsfp1_3_source.send(await self.qsfp1_3_sink.recv())
if not self.qsfp1_4_sink.empty():
self.qsfp1_4_source.send(self.qsfp1_4_sink.recv())
await self.qsfp1_4_source.send(await self.qsfp1_4_sink.recv())
if not self.qsfp2_1_sink.empty():
self.qsfp2_1_source.send(self.qsfp2_1_sink.recv())
await self.qsfp2_1_source.send(await self.qsfp2_1_sink.recv())
if not self.qsfp2_2_sink.empty():
self.qsfp2_2_source.send(self.qsfp2_2_sink.recv())
await self.qsfp2_2_source.send(await self.qsfp2_2_sink.recv())
if not self.qsfp2_3_sink.empty():
self.qsfp2_3_source.send(self.qsfp2_3_sink.recv())
await self.qsfp2_3_source.send(await self.qsfp2_3_sink.recv())
if not self.qsfp2_4_sink.empty():
self.qsfp2_4_source.send(self.qsfp2_4_sink.recv())
await self.qsfp2_4_source.send(await self.qsfp2_4_sink.recv())
@cocotb.test()
@ -460,32 +460,24 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.qsfp1_1_sink.wait()
pkt = tb.qsfp1_1_sink.recv()
pkt = await tb.qsfp1_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp1_1_source.send(pkt)
await tb.qsfp1_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
# await tb.driver.interfaces[1].start_xmit(data, 0)
# await tb.qsfp2_1_sink.wait()
# pkt = tb.qsfp2_1_sink.recv()
# pkt = await tb.qsfp2_1_sink.recv()
# tb.log.info("Packet: %s", pkt)
# tb.qsfp2_1_source.send(pkt)
# await tb.qsfp2_1_source.send(pkt)
# await tb.driver.interfaces[1].wait()
# pkt = tb.driver.interfaces[1].recv()
# pkt = await tb.driver.interfaces[1].recv()
# tb.log.info("Packet: %s", pkt)
# assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -503,16 +495,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.qsfp1_1_sink.wait()
pkt = tb.qsfp1_1_sink.recv()
pkt = await tb.qsfp1_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp1_1_source.send(pkt)
await tb.qsfp1_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -530,8 +518,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -551,8 +538,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]

View File

@ -333,9 +333,9 @@ class TB(object):
if self.loopback_enable:
if not self.qsfp0_sink.empty():
self.qsfp0_source.send(self.qsfp0_sink.recv())
await self.qsfp0_source.send(await self.qsfp0_sink.recv())
if not self.qsfp1_sink.empty():
self.qsfp1_source.send(self.qsfp1_sink.recv())
await self.qsfp1_source.send(await self.qsfp1_sink.recv())
@cocotb.test()
@ -366,32 +366,24 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.qsfp0_sink.wait()
pkt = tb.qsfp0_sink.recv()
pkt = await tb.qsfp0_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp0_source.send(pkt)
await tb.qsfp0_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
# await tb.driver.interfaces[1].start_xmit(data, 0)
# await tb.qsfp1_0_sink.wait()
# pkt = tb.qsfp1_0_sink.recv()
# pkt = await tb.qsfp1_0_sink.recv()
# tb.log.info("Packet: %s", pkt)
# tb.qsfp1_0_source.send(pkt)
# await tb.qsfp1_0_source.send(pkt)
# await tb.driver.interfaces[1].wait()
# pkt = tb.driver.interfaces[1].recv()
# pkt = await tb.driver.interfaces[1].recv()
# tb.log.info("Packet: %s", pkt)
# assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -409,16 +401,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.qsfp0_sink.wait()
pkt = tb.qsfp0_sink.recv()
pkt = await tb.qsfp0_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp0_source.send(pkt)
await tb.qsfp0_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -436,8 +424,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -457,8 +444,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -478,8 +464,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]

View File

@ -409,21 +409,21 @@ class TB(object):
if self.loopback_enable:
if not self.qsfp0_1_sink.empty():
self.qsfp0_1_source.send(self.qsfp0_1_sink.recv())
await self.qsfp0_1_source.send(await self.qsfp0_1_sink.recv())
if not self.qsfp0_2_sink.empty():
self.qsfp0_2_source.send(self.qsfp0_2_sink.recv())
await self.qsfp0_2_source.send(await self.qsfp0_2_sink.recv())
if not self.qsfp0_3_sink.empty():
self.qsfp0_3_source.send(self.qsfp0_3_sink.recv())
await self.qsfp0_3_source.send(await self.qsfp0_3_sink.recv())
if not self.qsfp0_4_sink.empty():
self.qsfp0_4_source.send(self.qsfp0_4_sink.recv())
await self.qsfp0_4_source.send(await self.qsfp0_4_sink.recv())
if not self.qsfp1_1_sink.empty():
self.qsfp1_1_source.send(self.qsfp1_1_sink.recv())
await self.qsfp1_1_source.send(await self.qsfp1_1_sink.recv())
if not self.qsfp1_2_sink.empty():
self.qsfp1_2_source.send(self.qsfp1_2_sink.recv())
await self.qsfp1_2_source.send(await self.qsfp1_2_sink.recv())
if not self.qsfp1_3_sink.empty():
self.qsfp1_3_source.send(self.qsfp1_3_sink.recv())
await self.qsfp1_3_source.send(await self.qsfp1_3_sink.recv())
if not self.qsfp1_4_sink.empty():
self.qsfp1_4_source.send(self.qsfp1_4_sink.recv())
await self.qsfp1_4_source.send(await self.qsfp1_4_sink.recv())
@cocotb.test()
@ -454,32 +454,24 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.qsfp0_1_sink.wait()
pkt = tb.qsfp0_1_sink.recv()
pkt = await tb.qsfp0_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp0_1_source.send(pkt)
await tb.qsfp0_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
# await tb.driver.interfaces[1].start_xmit(data, 0)
# await tb.qsfp1_1_sink.wait()
# pkt = tb.qsfp1_1_sink.recv()
# pkt = await tb.qsfp1_1_sink.recv()
# tb.log.info("Packet: %s", pkt)
# tb.qsfp1_1_source.send(pkt)
# await tb.qsfp1_1_source.send(pkt)
# await tb.driver.interfaces[1].wait()
# pkt = tb.driver.interfaces[1].recv()
# pkt = await tb.driver.interfaces[1].recv()
# tb.log.info("Packet: %s", pkt)
# assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -497,16 +489,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.qsfp0_1_sink.wait()
pkt = tb.qsfp0_1_sink.recv()
pkt = await tb.qsfp0_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp0_1_source.send(pkt)
await tb.qsfp0_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -524,8 +512,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -545,8 +532,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]

View File

@ -330,9 +330,9 @@ class TB(object):
if self.loopback_enable:
if not self.sfp0_sink.empty():
self.sfp0_source.send(self.sfp0_sink.recv())
await self.sfp0_source.send(await self.sfp0_sink.recv())
if not self.sfp1_sink.empty():
self.sfp1_source.send(self.sfp1_sink.recv())
await self.sfp1_source.send(await self.sfp1_sink.recv())
@cocotb.test()
@ -363,32 +363,24 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.sfp0_sink.wait()
pkt = tb.sfp0_sink.recv()
pkt = await tb.sfp0_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.sfp0_source.send(pkt)
await tb.sfp0_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
# await tb.driver.interfaces[1].start_xmit(data, 0)
# await tb.sfp1_sink.wait()
# pkt = tb.sfp1_sink.recv()
# pkt = await tb.sfp1_sink.recv()
# tb.log.info("Packet: %s", pkt)
# tb.sfp1_source.send(pkt)
# await tb.sfp1_source.send(pkt)
# await tb.driver.interfaces[1].wait()
# pkt = tb.driver.interfaces[1].recv()
# pkt = await tb.driver.interfaces[1].recv()
# tb.log.info("Packet: %s", pkt)
# assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -406,16 +398,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.sfp0_sink.wait()
pkt = tb.sfp0_sink.recv()
pkt = await tb.sfp0_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.sfp0_source.send(pkt)
await tb.sfp0_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -433,8 +421,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -454,8 +441,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]

View File

@ -334,9 +334,9 @@ class TB(object):
if self.loopback_enable:
if not self.qsfp_0_sink.empty():
self.qsfp_0_source.send(self.qsfp_0_sink.recv())
await self.qsfp_0_source.send(await self.qsfp_0_sink.recv())
if not self.qsfp_1_sink.empty():
self.qsfp_1_source.send(self.qsfp_1_sink.recv())
await self.qsfp_1_source.send(await self.qsfp_1_sink.recv())
@cocotb.test()
@ -367,32 +367,24 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.qsfp_0_sink.wait()
pkt = tb.qsfp_0_sink.recv()
pkt = await tb.qsfp_0_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp_0_source.send(pkt)
await tb.qsfp_0_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
# await tb.driver.interfaces[1].start_xmit(data, 0)
# await tb.qsfp_1_0_sink.wait()
# pkt = tb.qsfp_1_0_sink.recv()
# pkt = await tb.qsfp_1_0_sink.recv()
# tb.log.info("Packet: %s", pkt)
# tb.qsfp_1_0_source.send(pkt)
# await tb.qsfp_1_0_source.send(pkt)
# await tb.driver.interfaces[1].wait()
# pkt = tb.driver.interfaces[1].recv()
# pkt = await tb.driver.interfaces[1].recv()
# tb.log.info("Packet: %s", pkt)
# assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -410,16 +402,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.qsfp_0_sink.wait()
pkt = tb.qsfp_0_sink.recv()
pkt = await tb.qsfp_0_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp_0_source.send(pkt)
await tb.qsfp_0_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -437,8 +425,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -458,8 +445,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -479,8 +465,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]

View File

@ -410,21 +410,21 @@ class TB(object):
if self.loopback_enable:
if not self.qsfp_0_0_sink.empty():
self.qsfp_0_0_source.send(self.qsfp_0_0_sink.recv())
await self.qsfp_0_0_source.send(await self.qsfp_0_0_sink.recv())
if not self.qsfp_0_1_sink.empty():
self.qsfp_0_1_source.send(self.qsfp_0_1_sink.recv())
await self.qsfp_0_1_source.send(await self.qsfp_0_1_sink.recv())
if not self.qsfp_0_2_sink.empty():
self.qsfp_0_2_source.send(self.qsfp_0_2_sink.recv())
await self.qsfp_0_2_source.send(await self.qsfp_0_2_sink.recv())
if not self.qsfp_0_3_sink.empty():
self.qsfp_0_3_source.send(self.qsfp_0_3_sink.recv())
await self.qsfp_0_3_source.send(await self.qsfp_0_3_sink.recv())
if not self.qsfp_1_0_sink.empty():
self.qsfp_1_0_source.send(self.qsfp_1_0_sink.recv())
await self.qsfp_1_0_source.send(await self.qsfp_1_0_sink.recv())
if not self.qsfp_1_1_sink.empty():
self.qsfp_1_1_source.send(self.qsfp_1_1_sink.recv())
await self.qsfp_1_1_source.send(await self.qsfp_1_1_sink.recv())
if not self.qsfp_1_2_sink.empty():
self.qsfp_1_2_source.send(self.qsfp_1_2_sink.recv())
await self.qsfp_1_2_source.send(await self.qsfp_1_2_sink.recv())
if not self.qsfp_1_3_sink.empty():
self.qsfp_1_3_source.send(self.qsfp_1_3_sink.recv())
await self.qsfp_1_3_source.send(await self.qsfp_1_3_sink.recv())
@cocotb.test()
@ -455,32 +455,24 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.qsfp_0_0_sink.wait()
pkt = tb.qsfp_0_0_sink.recv()
pkt = await tb.qsfp_0_0_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp_0_0_source.send(pkt)
await tb.qsfp_0_0_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
# await tb.driver.interfaces[1].start_xmit(data, 0)
# await tb.qsfp_1_0_sink.wait()
# pkt = tb.qsfp_1_0_sink.recv()
# pkt = await tb.qsfp_1_0_sink.recv()
# tb.log.info("Packet: %s", pkt)
# tb.qsfp_1_0_source.send(pkt)
# await tb.qsfp_1_0_source.send(pkt)
# await tb.driver.interfaces[1].wait()
# pkt = tb.driver.interfaces[1].recv()
# pkt = await tb.driver.interfaces[1].recv()
# tb.log.info("Packet: %s", pkt)
# assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -498,16 +490,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.qsfp_0_0_sink.wait()
pkt = tb.qsfp_0_0_sink.recv()
pkt = await tb.qsfp_0_0_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp_0_0_source.send(pkt)
await tb.qsfp_0_0_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -525,8 +513,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -546,8 +533,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]

View File

@ -410,21 +410,21 @@ class TB(object):
if self.loopback_enable:
if not self.qsfp_0_0_sink.empty():
self.qsfp_0_0_source.send(self.qsfp_0_0_sink.recv())
await self.qsfp_0_0_source.send(await self.qsfp_0_0_sink.recv())
if not self.qsfp_0_1_sink.empty():
self.qsfp_0_1_source.send(self.qsfp_0_1_sink.recv())
await self.qsfp_0_1_source.send(await self.qsfp_0_1_sink.recv())
if not self.qsfp_0_2_sink.empty():
self.qsfp_0_2_source.send(self.qsfp_0_2_sink.recv())
await self.qsfp_0_2_source.send(await self.qsfp_0_2_sink.recv())
if not self.qsfp_0_3_sink.empty():
self.qsfp_0_3_source.send(self.qsfp_0_3_sink.recv())
await self.qsfp_0_3_source.send(await self.qsfp_0_3_sink.recv())
if not self.qsfp_1_0_sink.empty():
self.qsfp_1_0_source.send(self.qsfp_1_0_sink.recv())
await self.qsfp_1_0_source.send(await self.qsfp_1_0_sink.recv())
if not self.qsfp_1_1_sink.empty():
self.qsfp_1_1_source.send(self.qsfp_1_1_sink.recv())
await self.qsfp_1_1_source.send(await self.qsfp_1_1_sink.recv())
if not self.qsfp_1_2_sink.empty():
self.qsfp_1_2_source.send(self.qsfp_1_2_sink.recv())
await self.qsfp_1_2_source.send(await self.qsfp_1_2_sink.recv())
if not self.qsfp_1_3_sink.empty():
self.qsfp_1_3_source.send(self.qsfp_1_3_sink.recv())
await self.qsfp_1_3_source.send(await self.qsfp_1_3_sink.recv())
@cocotb.test()
@ -455,32 +455,24 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.qsfp_0_0_sink.wait()
pkt = tb.qsfp_0_0_sink.recv()
pkt = await tb.qsfp_0_0_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp_0_0_source.send(pkt)
await tb.qsfp_0_0_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
# await tb.driver.interfaces[1].start_xmit(data, 0)
# await tb.qsfp_1_0_sink.wait()
# pkt = tb.qsfp_1_0_sink.recv()
# pkt = await tb.qsfp_1_0_sink.recv()
# tb.log.info("Packet: %s", pkt)
# tb.qsfp_1_0_source.send(pkt)
# await tb.qsfp_1_0_source.send(pkt)
# await tb.driver.interfaces[1].wait()
# pkt = tb.driver.interfaces[1].recv()
# pkt = await tb.driver.interfaces[1].recv()
# tb.log.info("Packet: %s", pkt)
# assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -498,16 +490,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.qsfp_0_0_sink.wait()
pkt = tb.qsfp_0_0_sink.recv()
pkt = await tb.qsfp_0_0_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp_0_0_source.send(pkt)
await tb.qsfp_0_0_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -525,8 +513,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -546,8 +533,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]

View File

@ -411,21 +411,21 @@ class TB(object):
if self.loopback_enable:
if not self.qsfp_0_0_sink.empty():
self.qsfp_0_0_source.send(self.qsfp_0_0_sink.recv())
await self.qsfp_0_0_source.send(await self.qsfp_0_0_sink.recv())
if not self.qsfp_0_1_sink.empty():
self.qsfp_0_1_source.send(self.qsfp_0_1_sink.recv())
await self.qsfp_0_1_source.send(await self.qsfp_0_1_sink.recv())
if not self.qsfp_0_2_sink.empty():
self.qsfp_0_2_source.send(self.qsfp_0_2_sink.recv())
await self.qsfp_0_2_source.send(await self.qsfp_0_2_sink.recv())
if not self.qsfp_0_3_sink.empty():
self.qsfp_0_3_source.send(self.qsfp_0_3_sink.recv())
await self.qsfp_0_3_source.send(await self.qsfp_0_3_sink.recv())
if not self.qsfp_1_0_sink.empty():
self.qsfp_1_0_source.send(self.qsfp_1_0_sink.recv())
await self.qsfp_1_0_source.send(await self.qsfp_1_0_sink.recv())
if not self.qsfp_1_1_sink.empty():
self.qsfp_1_1_source.send(self.qsfp_1_1_sink.recv())
await self.qsfp_1_1_source.send(await self.qsfp_1_1_sink.recv())
if not self.qsfp_1_2_sink.empty():
self.qsfp_1_2_source.send(self.qsfp_1_2_sink.recv())
await self.qsfp_1_2_source.send(await self.qsfp_1_2_sink.recv())
if not self.qsfp_1_3_sink.empty():
self.qsfp_1_3_source.send(self.qsfp_1_3_sink.recv())
await self.qsfp_1_3_source.send(await self.qsfp_1_3_sink.recv())
@cocotb.test()
@ -456,32 +456,24 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.qsfp_0_0_sink.wait()
pkt = tb.qsfp_0_0_sink.recv()
pkt = await tb.qsfp_0_0_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp_0_0_source.send(pkt)
await tb.qsfp_0_0_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
# await tb.driver.interfaces[1].start_xmit(data, 0)
# await tb.qsfp_1_0_sink.wait()
# pkt = tb.qsfp_1_0_sink.recv()
# pkt = await tb.qsfp_1_0_sink.recv()
# tb.log.info("Packet: %s", pkt)
# tb.qsfp_1_0_source.send(pkt)
# await tb.qsfp_1_0_source.send(pkt)
# await tb.driver.interfaces[1].wait()
# pkt = tb.driver.interfaces[1].recv()
# pkt = await tb.driver.interfaces[1].recv()
# tb.log.info("Packet: %s", pkt)
# assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -499,16 +491,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.qsfp_0_0_sink.wait()
pkt = tb.qsfp_0_0_sink.recv()
pkt = await tb.qsfp_0_0_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp_0_0_source.send(pkt)
await tb.qsfp_0_0_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -526,8 +514,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -547,8 +534,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -599,13 +585,9 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(pkts[k], k % 4)
for k in range(count):
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
if not pkt:
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
print(pkt)
tb.log.info("Packet: %s", pkt)
# assert pkt.data == pkts[k]
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff

View File

@ -332,9 +332,9 @@ class TB(object):
if self.loopback_enable:
if not self.sfp_1_sink.empty():
self.sfp_1_source.send(self.sfp_1_sink.recv())
await self.sfp_1_source.send(await self.sfp_1_sink.recv())
if not self.sfp_2_sink.empty():
self.sfp_2_source.send(self.sfp_2_sink.recv())
await self.sfp_2_source.send(await self.sfp_2_sink.recv())
@cocotb.test()
@ -365,32 +365,24 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.sfp_1_sink.wait()
pkt = tb.sfp_1_sink.recv()
pkt = await tb.sfp_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.sfp_1_source.send(pkt)
await tb.sfp_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
# await tb.driver.interfaces[1].start_xmit(data, 0)
# await tb.sfp_2_sink.wait()
# pkt = tb.sfp_2_sink.recv()
# pkt = await tb.sfp_2_sink.recv()
# tb.log.info("Packet: %s", pkt)
# tb.sfp_2_source.send(pkt)
# await tb.sfp_2_source.send(pkt)
# await tb.driver.interfaces[1].wait()
# pkt = tb.driver.interfaces[1].recv()
# pkt = await tb.driver.interfaces[1].recv()
# tb.log.info("Packet: %s", pkt)
# assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -408,16 +400,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.sfp_1_sink.wait()
pkt = tb.sfp_1_sink.recv()
pkt = await tb.sfp_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.sfp_1_source.send(pkt)
await tb.sfp_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -435,8 +423,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -456,8 +443,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -508,13 +494,9 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(pkts[k], k % 4)
for k in range(count):
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
if not pkt:
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
print(pkt)
tb.log.info("Packet: %s", pkt)
# assert pkt.data == pkts[k]
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff

View File

@ -360,13 +360,13 @@ class TB(object):
if self.loopback_enable:
if not self.qsfp_1_sink.empty():
self.qsfp_1_source.send(self.qsfp_1_sink.recv())
await self.qsfp_1_source.send(await self.qsfp_1_sink.recv())
if not self.qsfp_2_sink.empty():
self.qsfp_2_source.send(self.qsfp_2_sink.recv())
await self.qsfp_2_source.send(await self.qsfp_2_sink.recv())
if not self.qsfp_3_sink.empty():
self.qsfp_3_source.send(self.qsfp_3_sink.recv())
await self.qsfp_3_source.send(await self.qsfp_3_sink.recv())
if not self.qsfp_4_sink.empty():
self.qsfp_4_source.send(self.qsfp_4_sink.recv())
await self.qsfp_4_source.send(await self.qsfp_4_sink.recv())
@cocotb.test()
@ -396,16 +396,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.qsfp_1_sink.wait()
pkt = tb.qsfp_1_sink.recv()
pkt = await tb.qsfp_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp_1_source.send(pkt)
await tb.qsfp_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -423,16 +419,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.qsfp_1_sink.wait()
pkt = tb.qsfp_1_sink.recv()
pkt = await tb.qsfp_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp_1_source.send(pkt)
await tb.qsfp_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -450,8 +442,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -471,8 +462,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -523,13 +513,9 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(pkts[k], k % 4)
for k in range(count):
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
if not pkt:
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
print(pkt)
tb.log.info("Packet: %s", pkt)
# assert pkt.data == pkts[k]
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff

View File

@ -415,21 +415,21 @@ class TB(object):
if self.loopback_enable:
if not self.qsfp1_1_sink.empty():
self.qsfp1_1_source.send(self.qsfp1_1_sink.recv())
await self.qsfp1_1_source.send(await self.qsfp1_1_sink.recv())
if not self.qsfp1_2_sink.empty():
self.qsfp1_2_source.send(self.qsfp1_2_sink.recv())
await self.qsfp1_2_source.send(await self.qsfp1_2_sink.recv())
if not self.qsfp1_3_sink.empty():
self.qsfp1_3_source.send(self.qsfp1_3_sink.recv())
await self.qsfp1_3_source.send(await self.qsfp1_3_sink.recv())
if not self.qsfp1_4_sink.empty():
self.qsfp1_4_source.send(self.qsfp1_4_sink.recv())
await self.qsfp1_4_source.send(await self.qsfp1_4_sink.recv())
if not self.qsfp2_1_sink.empty():
self.qsfp2_1_source.send(self.qsfp2_1_sink.recv())
await self.qsfp2_1_source.send(await self.qsfp2_1_sink.recv())
if not self.qsfp2_2_sink.empty():
self.qsfp2_2_source.send(self.qsfp2_2_sink.recv())
await self.qsfp2_2_source.send(await self.qsfp2_2_sink.recv())
if not self.qsfp2_3_sink.empty():
self.qsfp2_3_source.send(self.qsfp2_3_sink.recv())
await self.qsfp2_3_source.send(await self.qsfp2_3_sink.recv())
if not self.qsfp2_4_sink.empty():
self.qsfp2_4_source.send(self.qsfp2_4_sink.recv())
await self.qsfp2_4_source.send(await self.qsfp2_4_sink.recv())
@cocotb.test()
@ -460,32 +460,24 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(data, 0)
await tb.qsfp1_1_sink.wait()
pkt = tb.qsfp1_1_sink.recv()
pkt = await tb.qsfp1_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp1_1_source.send(pkt)
await tb.qsfp1_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
# await tb.driver.interfaces[1].start_xmit(data, 0)
# await tb.qsfp2_1_sink.wait()
# pkt = tb.qsfp2_1_sink.recv()
# pkt = await tb.qsfp2_1_sink.recv()
# tb.log.info("Packet: %s", pkt)
# tb.qsfp2_1_source.send(pkt)
# await tb.qsfp2_1_source.send(pkt)
# await tb.driver.interfaces[1].wait()
# pkt = tb.driver.interfaces[1].recv()
# pkt = await tb.driver.interfaces[1].recv()
# tb.log.info("Packet: %s", pkt)
# assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -503,16 +495,12 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(test_pkt2.build(), 0, 34, 6)
await tb.qsfp1_1_sink.wait()
pkt = tb.qsfp1_1_sink.recv()
pkt = await tb.qsfp1_1_sink.recv()
tb.log.info("Packet: %s", pkt)
tb.qsfp1_1_source.send(pkt)
await tb.qsfp1_1_source.send(pkt)
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff
@ -530,8 +518,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -551,8 +538,7 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(p, 0)
for k in range(count):
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
tb.log.info("Packet: %s", pkt)
assert pkt.data == pkts[k]
@ -603,13 +589,9 @@ async def run_test_nic(dut):
await tb.driver.interfaces[0].start_xmit(pkts[k], k % 4)
for k in range(count):
pkt = tb.driver.interfaces[0].recv()
pkt = await tb.driver.interfaces[0].recv()
if not pkt:
await tb.driver.interfaces[0].wait()
pkt = tb.driver.interfaces[0].recv()
print(pkt)
tb.log.info("Packet: %s", pkt)
# assert pkt.data == pkts[k]
assert pkt.rx_checksum == ~scapy.utils.checksum(bytes(pkt.data[14:])) & 0xffff