self.comb += [
Record.connect(sender.source, packetizer.sink),
Record.connect(packetizer.source, source),
- source.length.eq(sender.source.wcount*4 + 4), # XXX verify this
+ source.length.eq(sender.source.wcount*4 + 4 +etherbone_record_header_len), # XXX improve this
source.ip_address.eq(last_ip_address)
]
if endianness is "big":
-import socket
+import socket, time
from liteeth.test.model.etherbone import *
-SRAM_BASE = 0x02000000
+SRAM_BASE = 0x02000000//4
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
packet.pf = 1
packet.encode()
sock.sendto(bytes(packet), ("192.168.1.40", 20000))
+time.sleep(0.01)
# test writes
writes_datas = [j for j in range(16)]
packet.records = [record]
packet.encode()
sock.sendto(bytes(packet), ("192.168.1.40", 20000))
+time.sleep(0.01)
+
+# test reads
+reads_addrs = [SRAM_BASE+j for j in range(16)]
+reads = EtherboneReads(base_ret_addr=0x1000, addrs=reads_addrs)
+record = EtherboneRecord()
+record.writes = None
+record.reads = reads
+record.bca = 0
+record.rca = 0
+record.rff = 0
+record.cyc = 0
+record.wca = 0
+record.wff = 0
+record.byte_enable = 0xf
+record.wcount = 0
+record.rcount = len(reads_addrs)
+
+packet = EtherbonePacket()
+packet.records = [record]
+packet.encode()
+sock.sendto(bytes(packet), ("192.168.1.40", 20000))
+time.sleep(0.01)
"core_udp_tx_fsm_state" : 1
}
conditions = {
- "etherbonesocdevel_master_bus_stb" : 1
+ "etherbonesocdevel_master_bus_stb" : 1,
+ "etherbonesocdevel_master_bus_we" : 0
}
la.configure_term(port=0, cond=conditions)
la.configure_sum("term")