In [1]:
from pynq.overlays.logictools import LogicToolsOverlay
logictools_olay = LogicToolsOverlay('logictools.bit')
The pattern to be generated is specified in the waveJSON format
The pattern is applied to the Arduino interface, pins D0, D1 and D2 are set to generate a 3-bit count. To check the generated pattern we loop them back to pins D19, D18 and D17 respectively and use the the trace analyzer to view the loopback signals
The Waveform class is used to display the specified waveform.
In [2]:
from pynq.lib.logictools import Waveform
up_counter = {'signal': [
['stimulus',
{'name': 'bit0', 'pin': 'D0', 'wave': 'lh' * 8},
{'name': 'bit1', 'pin': 'D1', 'wave': 'l.h.' * 4},
{'name': 'bit2', 'pin': 'D2', 'wave': 'l...h...' * 2}],
['analysis',
{'name': 'bit2_loopback', 'pin': 'D17'},
{'name': 'bit1_loopback', 'pin': 'D18'},
{'name': 'bit0_loopback', 'pin': 'D19'}]],
'foot': {'tock': 1},
'head': {'text': 'up_counter'}}
waveform = Waveform(up_counter)
waveform.display()
Note: Since there are no captured samples at this moment, the analysis group will be empty.
In [3]:
pattern_generator = logictools_olay.pattern_generator
pattern_generator.trace(num_analyzer_samples=16)
In [4]:
pattern_generator.setup(up_counter,
stimulus_group_name='stimulus',
analysis_group_name='analysis')
Set the loopback connections using jumper wires on the Arduino Interface
Note: Make sure all other pins are disconnected.
In [5]:
pattern_generator.run()
pattern_generator.show_waveform()
In [6]:
pattern_generator.stop()