Browse Source

xc3sprog and ethtest utils

tags/1.1
mntmn 1 month ago
parent
commit
fe30f49f8a
2 changed files with 18 additions and 0 deletions
  1. 16
    0
      util/ethtest/ethframe.py
  2. 2
    0
      util/program_fpga.sh

+ 16
- 0
util/ethtest/ethframe.py View File

@@ -0,0 +1,16 @@
from socket import *
def sendeth(src, dst, eth_type, payload, interface = "enp2s0"):
assert(len(src) == len(dst) == 6) # 48-bit ethernet addresses
assert(len(eth_type) == 2) # 16-bit ethernet type
s = socket(AF_PACKET, SOCK_RAW)
s.bind((interface, 0))
return s.send(src + dst + eth_type + payload)

if __name__ == "__main__":
print("Sent %d-byte Ethernet packet on enp2s0" %
sendeth("\xe0\xd5\x5e\xf7\xa0\xae",
"\xDE\xAD\xCA\xFF\xE2\x42",
#"\xff\xff\xff\xff\xff\xff",
"\x7A\x05",
"hello"))


+ 2
- 0
util/program_fpga.sh View File

@@ -0,0 +1,2 @@
xc3sprog -c xpc -p 1 ./ZZ9000_proto.sdk/zz9000_ps_wrapper_hw_platform_0/zz9000_ps_wrapper.bit


Loading…
Cancel
Save