Skip to content

Commit

Permalink
[ESI][cosim runner] Add 'cosim' to test exec arg list
Browse files Browse the repository at this point in the history
Necessary to enable script re-use for non-cosim connections.
  • Loading branch information
teqdruid committed Nov 8, 2023
1 parent 12f3e41 commit 3fea5df
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion integration_test/Dialect/ESI/cosim/cosim_only.sv.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import loopback as test

rpc = test.LoopbackTester(sys.argv[2], sys.argv[1])
rpc = test.LoopbackTester(sys.argv[3], sys.argv[2])
print(rpc.cosim.list().wait())
rpc.test_list()
rpc.test_3bytes(5)
Expand Down
2 changes: 1 addition & 1 deletion integration_test/Dialect/ESI/cosim/loopback.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ def test_3bytes(self, num_msgs=50):

if __name__ == "__main__":
import sys
rpc = LoopbackTester(sys.argv[2], sys.argv[1])
rpc = LoopbackTester(sys.argv[3], sys.argv[2])
print(rpc.list())
rpc.test_two_chan_loopback(25)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import capnp
import sys

c = esi_cosim.LowLevel(sys.argv[2], sys.argv[1])
c = esi_cosim.LowLevel(sys.argv[3], sys.argv[2])
r = c.low.readMMIO(40).wait()
print(f"data resp: 0x{r.data:x}")

Expand Down
3 changes: 1 addition & 2 deletions integration_test/Dialect/ESI/runtime/basic_mmio.sv.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
import os
import sys

conn = f"{sys.argv[1]}:{sys.argv[2]}"
acc = esi.Accelerator(sys.argv[1], sys.argv[2])

acc = esi.Accelerator("cosim", conn)
mmio = acc.get_service_mmio()

r = mmio.read(40)
Expand Down
4 changes: 1 addition & 3 deletions integration_test/Dialect/ESI/runtime/loopback.mlir.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import esi
import sys

conn = f"{sys.argv[1]}:{sys.argv[2]}"

acc = esi.Accelerator("cosim", conn)
acc = esi.Accelerator(sys.argv[1], sys.argv[2])

assert acc.sysinfo().esi_version() == 1
assert acc.manifest.api_version == 1
Expand Down
3 changes: 2 additions & 1 deletion tools/esi/esi-cosim-runner.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ class CosimTestRunner:
"PYTHONPATH"] + f":{os.path.dirname(__file__)}"
# Run the test script.
if self.exec:
args = [f"localhost:{port}", self.schema] + self.exec_args.split(" ")
args = ["cosim", f"localhost:{port}", self.schema
] + self.exec_args.split(" ")
if self.file.endswith(".py"):
cmd = [sys.executable, "-u", self.file] + args
else:
Expand Down

0 comments on commit 3fea5df

Please sign in to comment.