test: fix test_model

This commit is contained in:
Florent Kermarrec 2017-09-25 13:12:30 +02:00
parent 48fb4647bd
commit 937c240727
7 changed files with 17 additions and 17 deletions

0
example_designs/make.py Normal file → Executable file
View File

View File

@ -3,12 +3,12 @@ PYTHON = python3
CMD = $(PYTHON) CMD = $(PYTHON)
model_tb: model_tb:
PYTHONPATH=./ $(CMD) ./model/mac.py cd ../ && PYTHONPATH=./ $(CMD) test/model/mac.py
PYTHONPATH=./ $(CMD) ./model/arp.py cd ../ && PYTHONPATH=./ $(CMD) test/model/arp.py
PYTHONPATH=./ $(CMD) ./model/ip.py cd ../ && PYTHONPATH=./ $(CMD) test/model/ip.py
PYTHONPATH=./ $(CMD) ./model/udp.py cd ../ && PYTHONPATH=./ $(CMD) test/model/udp.py
PYTHONPATH=./ $(CMD) ./model/icmp.py cd ../ && PYTHONPATH=./ $(CMD) test/model/icmp.py
PYTHONPATH=./ $(CMD) ./model/etherbone.py cd ../ && PYTHONPATH=./ $(CMD) test/model/etherbone.py
example_designs: example_designs:
cd ../example_designs && $(PYTHON) make.py -t base -s BaseSoC -p kc705 -Ob run False build-bitstream cd ../example_designs && $(PYTHON) make.py -t base -s BaseSoC -p kc705 -Ob run False build-bitstream

View File

@ -124,8 +124,8 @@ class ARP(Module):
request.target_ip = ip_address request.target_ip = ip_address
if __name__ == "__main__": if __name__ == "__main__":
from model.dumps import * from test.model.dumps import *
from model.mac import * from test.model.mac import *
errors = 0 errors = 0
# ARP request # ARP request
packet = MACPacket(arp_request) packet = MACPacket(arp_request)

View File

@ -85,9 +85,9 @@ class ICMP(Module):
pass pass
if __name__ == "__main__": if __name__ == "__main__":
from model.dumps import * from test.model.dumps import *
from model.mac import * from test.model.mac import *
from model.ip import * from test.model.ip import *
errors = 0 errors = 0
# ICMP packet # ICMP packet
packet = MACPacket(ping_request) packet = MACPacket(ping_request)

View File

@ -132,8 +132,8 @@ class IP(Module):
self.icmp_callback(packet) self.icmp_callback(packet)
if __name__ == "__main__": if __name__ == "__main__":
from model.dumps import * from test.model.dumps import *
from model.mac import * from test.model.mac import *
errors = 0 errors = 0
# UDP packet # UDP packet
packet = MACPacket(udp) packet = MACPacket(udp)

View File

@ -135,7 +135,7 @@ class MAC(Module):
raise ValueError # XXX handle this properly raise ValueError # XXX handle this properly
if __name__ == "__main__": if __name__ == "__main__":
from model.dumps import * from test.model.dumps import *
errors = 0 errors = 0
packet = MACPacket(arp_request) packet = MACPacket(arp_request)
packet.decode_remove_header() packet.decode_remove_header()

View File

@ -96,9 +96,9 @@ class UDP(Module):
self.etherbone_callback(packet) self.etherbone_callback(packet)
if __name__ == "__main__": if __name__ == "__main__":
from model.dumps import * from test.model.dumps import *
from model.mac import * from test.model.mac import *
from model.ip import * from test.model.ip import *
errors = 0 errors = 0
# UDP packet # UDP packet
packet = MACPacket(udp) packet = MACPacket(udp)