Skip to content

Commit

Permalink
[ESI/PyCDE] Updating XRT BSP to use ChannelMMIO (#8025)
Browse files Browse the repository at this point in the history
Updating the XRT BSP to use the new ChannelMMIO service.
  • Loading branch information
teqdruid authored Jan 4, 2025
1 parent 5f8a863 commit f58c2d9
Show file tree
Hide file tree
Showing 8 changed files with 388 additions and 151 deletions.
48 changes: 48 additions & 0 deletions frontends/PyCDE/integration_test/test_software/xrt_cosim.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Script to help test xrt in cosim mode. No support for xrt in cosim mode in the
# runtime, so this is not an automated test. Just an ad-hoc one.

import esiaccel

conn = esiaccel.AcceleratorConnection("cosim", "env")
acc = conn.build_accelerator()
rdaddr = acc.ports[esiaccel.AppID("mmio_axi_rdaddr")].write_port("data")
rdaddr.connect()
rddata = acc.ports[esiaccel.AppID("mmio_axi_rddata")].read_port("data")
rddata.connect()

wraddr = acc.ports[esiaccel.AppID("mmio_axi_wraddr")].write_port("data")
wraddr.connect()
wrdata = acc.ports[esiaccel.AppID("mmio_axi_wrdata")].write_port("data")
wrdata.connect()
wrresp = acc.ports[esiaccel.AppID("mmio_axi_wrresp")].read_port("data")
wrresp.connect()

print("connected")


def read(addr):
rdaddr.write(addr)
d = rddata.read()
print(f"Read from 0x{addr:02x}: 0x{d:08x}")
return d


def write(addr, data):
wraddr.write(addr)
wrdata.write(data)
d = wrresp.read()
print(f"Write to 0x{addr:02x}: 0x{data:08x} -> {d}")


for addr in range(0, 0x100, 4):
d = read(addr)
if addr == 0x18:
mani_offset = d

for addr in range(mani_offset, mani_offset + 0x100, 4):
read(addr)

write(262144 + 8, 30)
write(262144 + 12, 40)
read(262144 + 32)
read(262144 + 36)
1 change: 0 additions & 1 deletion frontends/PyCDE/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ declare_mlir_python_sources(PyCDESources
pycde/bsp/xrt.py
pycde/bsp/Makefile.xrt.mk
pycde/bsp/xrt_package.tcl
pycde/bsp/xrt_api.py
pycde/bsp/xrt.ini
pycde/bsp/xsim.tcl
)
Expand Down
2 changes: 1 addition & 1 deletion frontends/PyCDE/src/pycde/bsp/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class ChannelMMIO(esi.ServiceImplementation):
clk = Clock()
rst = Input(Bits(1))

cmd = Input(esi.MMIOReadWriteCmdType)
cmd = Input(esi.MMIO.read_write.type)

# Amount of register space each client gets. This is a GIANT HACK and needs to
# be replaced by parameterizable services.
Expand Down
Loading

0 comments on commit f58c2d9

Please sign in to comment.