Skip to content

Commit da54bf9

Browse files
committed
wip
1 parent 4cfdf0a commit da54bf9

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

software/glasgow/applet/interface/gpib_controller/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,6 @@ async def read(self, *, to_eoi=True):
374374
self._nrfd: "float",
375375
self._ndac: "float",
376376
self._srq: "float",
377-
378377
})
379378
await self.assembly.configure_ports()
380379

software/glasgow/applet/interface/gpib_controller/test.py

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import logging
2+
import asyncio
3+
import time
24

35
from amaranth import *
46

@@ -16,17 +18,38 @@ def test_build(self):
1618
self.assertBuilds()
1719

1820

21+
# def talk_and_listen(self, iface):
22+
# async def testbench(ctx):
23+
# print(ctx)
24+
# await iface.send_to(10, b'*IDN?')
25+
# await iface.read_from(10)
26+
# return testbench
27+
28+
def listen_and_reply(self, iface):
29+
async def testbench(ctx):
30+
time.sleep(0.5)
31+
print(await iface.read_from(10))
32+
await iface.send_to(10, b'GLASGOW DIGITAL INTERFACE EXPLORER')
33+
return testbench
34+
35+
36+
1937
def test_two_can_talk(self):
2038
assembly = SimulationAssembly()
2139
iface0 = GPIBControllerInterface(logger, assembly,
22-
dio="A0:7", eoi="B0", dav="B1", nrfd="B2", ndac="B3", srq="B4", ifc="B5", atn="B6", ren="B7")
40+
dio="A0:7", eoi="A8", dav="A9", nrfd="A10", ndac="A11", srq="A12", ifc="A13", atn="A14", ren="A15")
2341

2442
iface1 = GPIBControllerInterface(logger, assembly,
25-
dio="A0:7", eoi="B0", dav="B1", nrfd="B2", ndac="B3", srq="B4", ifc="B5", atn="B6", ren="B7")
43+
dio="B0:7", eoi="B8", dav="B9", nrfd="B10", ndac="B11", srq="B12", ifc="B13", atn="B14", ren="B15")
44+
45+
for pin in range(0,16):
46+
assembly.connect_pins("A%i" % pin, "B%i" % pin)
47+
48+
# assembly.add_testbench(self.talk_and_listen(iface0))
49+
assembly.add_testbench(self.listen_and_reply(iface1))
2650

27-
async def do_it(ctx):
28-
x = iface1.read_from(10)
51+
async def do_it(ctx):
2952
await iface0.send_to(10, b'*IDN?')
30-
print(await x)
53+
await iface0.read_from(10)
3154

3255
assembly.run(do_it, vcd_file="test.vcd")

0 commit comments

Comments
 (0)