Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
super6502
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Byron Lathi
super6502
Commits
0c2f36a2
Verified
Commit
0c2f36a2
authored
7 months ago
by
Byron Lathi
Browse files
Options
Downloads
Patches
Plain Diff
Send ARP response, not request
parent
87baa932
No related branches found
Branches containing commit
No related tags found
1 merge request
!74
Resolve "Network Processor"
Pipeline
#697
failed
7 months ago
Stage: build
Stage: sim
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hw/super6502_fpga/src/sub/network_processor/sim/cocotb/tests/tcp_test.py
+8
-6
8 additions, 6 deletions
...ga/src/sub/network_processor/sim/cocotb/tests/tcp_test.py
with
8 additions
and
6 deletions
hw/super6502_fpga/src/sub/network_processor/sim/cocotb/tests/tcp_test.py
+
8
−
6
View file @
0c2f36a2
...
...
@@ -6,8 +6,8 @@ from cocotbext.axi import AxiLiteBus, AxiLiteMaster, AxiLiteRam
from
cocotbext.eth
import
MiiPhy
,
GmiiFrame
import
struct
from
scapy.layers.inet
import
*
from
scapy.layers.l2
import
*
from
scapy.layers.inet
import
Ether
from
scapy.layers.l2
import
ARP
import
logging
from
decimal
import
Decimal
...
...
@@ -64,7 +64,7 @@ async def test_simple(dut):
local_mac
=
"
02:00:00:11:22:33
"
await
tb
.
axil_master
.
write_dword
(
0x0
,
0x
3
)
await
tb
.
axil_master
.
write_dword
(
0x0
,
0x
1807
)
await
tb
.
axil_master
.
write_dword
(
0x200
,
0x1234
)
await
tb
.
axil_master
.
write_dword
(
0x204
,
ip_to_hex
(
src_ip
))
...
...
@@ -80,7 +80,7 @@ async def test_simple(dut):
assert
packet
.
type
==
0x806
,
"
Packet type is not ARP!
"
arp_request
=
packet
.
payload
assert
isinstance
(
arp_request
,
ARP
)
...
...
@@ -97,9 +97,11 @@ async def test_simple(dut):
assert
arp_request
.
pdst
==
dst_ip
,
"
ARP pdst does not match expected
"
arp_response
=
Ether
(
dst
=
arp_request
.
hwsrc
,
src
=
local_mac
)
arp_response
/=
ARP
(
hwsrc
=
local_mac
,
hwdst
=
arp_request
.
hwsrc
,
psrc
=
dst_ip
,
pdst
=
arp_request
.
psrc
)
arp_response
/=
ARP
(
op
=
"
is-at
"
,
hwsrc
=
local_mac
,
hwdst
=
arp_request
.
hwsrc
,
psrc
=
dst_ip
,
pdst
=
arp_request
.
psrc
)
arp_response
=
arp_response
.
build
()
await
tb
.
mii_phy
.
rx
.
send
(
GmiiFrame
.
from_payload
(
arp_response
))
await
Timer
(
Decimal
(
CLK_PERIOD_NS
*
1000
),
units
=
'
ns
'
)
\ No newline at end of file
resp
=
await
tb
.
mii_phy
.
tx
.
recv
()
# type: GmiiFrame
packet
=
Ether
(
resp
.
get_payload
())
tb
.
log
.
info
(
f
"
Packet Type:
{
packet
.
type
:
x
}
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment