enjoy-digital / litescope

Small footprint and configurable embedded FPGA logic analyzer
Other
160 stars 38 forks source link

Fix hex value trigger #38

Closed troibe closed 2 years ago

troibe commented 2 years ago

When using a-f in litescope_cli the conversion to integer fails due to the base being 10 instead of 16. This should fix it.

$ litescope_cli -v main_basesoc_blackparrotrv64_pc 0xxxxxxxxa7c -v main_basesoc_blackparrotrv64_instr 0xf4737
Exact: main_basesoc_blackparrotrv64_pc
Exact: main_basesoc_blackparrotrv64_pc
Condition: main_basesoc_blackparrotrv64_pc == 0xxxxxxxxa7c
Exact: main_basesoc_blackparrotrv64_instr
Exact: main_basesoc_blackparrotrv64_instr
Condition: main_basesoc_blackparrotrv64_instr == 0xf4737
Traceback (most recent call last):
  File "/home/martin/.local/bin/litescope_cli", line 11, in <module>
    load_entry_point('litescope', 'console_scripts', 'litescope_cli')()
  File "/home/martin/coding/litex/litescope/litescope/software/litescope_cli.py", line 123, in main
    if not add_triggers(args, analyzer, signals):
  File "/home/martin/coding/litex/litescope/litescope/software/litescope_cli.py", line 73, in add_triggers
    analyzer.add_trigger(cond=cond)
  File "/home/martin/coding/litex/litescope/litescope/software/driver/analyzer.py", line 97, in add_trigger
    v |= int(c)
ValueError: invalid literal for int() with base 10: 'a'
troibe commented 2 years ago

@enjoy-digital I am just writing the section in my thesis about LiteScope. Which made me remember that this PR is still open.

enjoy-digital commented 2 years ago

Thanks @developandplay, this has also been fixed by @sthornington and merged with https://github.com/enjoy-digital/litescope/pull/31.