2015-09-27 12:47:30 -04:00
|
|
|
from litescope.software.driver.logic_analyzer import LiteScopeLogicAnalyzerDriver
|
2015-09-07 05:49:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
def main(wb):
|
|
|
|
wb.open()
|
|
|
|
# # #
|
2015-09-27 13:26:22 -04:00
|
|
|
logic_analyzer = LiteScopeLogicAnalyzerDriver(wb.regs, "logic_analyzer", debug=True)
|
2015-09-07 05:49:54 -04:00
|
|
|
|
2015-09-27 12:47:30 -04:00
|
|
|
cond = {} # immediate trigger
|
2015-09-27 13:26:22 -04:00
|
|
|
logic_analyzer.configure_term(port=0, cond=cond)
|
|
|
|
logic_analyzer.configure_sum("term")
|
|
|
|
logic_analyzer.configure_subsampler(1)
|
|
|
|
# logic_analyzer.configure_qualifier(1)
|
|
|
|
logic_analyzer.configure_rle(1)
|
|
|
|
logic_analyzer.run(offset=128, length=256)
|
2015-09-07 05:49:54 -04:00
|
|
|
|
2015-09-27 13:26:22 -04:00
|
|
|
while not logic_analyzer.done():
|
2015-09-07 05:49:54 -04:00
|
|
|
pass
|
2015-09-27 13:26:22 -04:00
|
|
|
logic_analyzer.upload()
|
2015-09-07 05:49:54 -04:00
|
|
|
|
2015-09-27 13:26:22 -04:00
|
|
|
logic_analyzer.save("dump.vcd")
|
|
|
|
logic_analyzer.save("dump.csv")
|
|
|
|
logic_analyzer.save("dump.py")
|
|
|
|
logic_analyzer.save("dump.sr")
|
2015-09-07 05:49:54 -04:00
|
|
|
# # #
|
|
|
|
wb.close()
|