Skip to content

Commit f58c2d9

Browse files
authored
[ESI/PyCDE] Updating XRT BSP to use ChannelMMIO (#8025)
Updating the XRT BSP to use the new ChannelMMIO service.
1 parent 5f8a863 commit f58c2d9

File tree

8 files changed

+388
-151
lines changed

8 files changed

+388
-151
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Script to help test xrt in cosim mode. No support for xrt in cosim mode in the
2+
# runtime, so this is not an automated test. Just an ad-hoc one.
3+
4+
import esiaccel
5+
6+
conn = esiaccel.AcceleratorConnection("cosim", "env")
7+
acc = conn.build_accelerator()
8+
rdaddr = acc.ports[esiaccel.AppID("mmio_axi_rdaddr")].write_port("data")
9+
rdaddr.connect()
10+
rddata = acc.ports[esiaccel.AppID("mmio_axi_rddata")].read_port("data")
11+
rddata.connect()
12+
13+
wraddr = acc.ports[esiaccel.AppID("mmio_axi_wraddr")].write_port("data")
14+
wraddr.connect()
15+
wrdata = acc.ports[esiaccel.AppID("mmio_axi_wrdata")].write_port("data")
16+
wrdata.connect()
17+
wrresp = acc.ports[esiaccel.AppID("mmio_axi_wrresp")].read_port("data")
18+
wrresp.connect()
19+
20+
print("connected")
21+
22+
23+
def read(addr):
24+
rdaddr.write(addr)
25+
d = rddata.read()
26+
print(f"Read from 0x{addr:02x}: 0x{d:08x}")
27+
return d
28+
29+
30+
def write(addr, data):
31+
wraddr.write(addr)
32+
wrdata.write(data)
33+
d = wrresp.read()
34+
print(f"Write to 0x{addr:02x}: 0x{data:08x} -> {d}")
35+
36+
37+
for addr in range(0, 0x100, 4):
38+
d = read(addr)
39+
if addr == 0x18:
40+
mani_offset = d
41+
42+
for addr in range(mani_offset, mani_offset + 0x100, 4):
43+
read(addr)
44+
45+
write(262144 + 8, 30)
46+
write(262144 + 12, 40)
47+
read(262144 + 32)
48+
read(262144 + 36)

frontends/PyCDE/src/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ declare_mlir_python_sources(PyCDESources
4646
pycde/bsp/xrt.py
4747
pycde/bsp/Makefile.xrt.mk
4848
pycde/bsp/xrt_package.tcl
49-
pycde/bsp/xrt_api.py
5049
pycde/bsp/xrt.ini
5150
pycde/bsp/xsim.tcl
5251
)

frontends/PyCDE/src/pycde/bsp/common.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class ChannelMMIO(esi.ServiceImplementation):
121121
clk = Clock()
122122
rst = Input(Bits(1))
123123

124-
cmd = Input(esi.MMIOReadWriteCmdType)
124+
cmd = Input(esi.MMIO.read_write.type)
125125

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

0 commit comments

Comments
 (0)