enjoy-digital / litescope

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

Attributes (like trigger_enable) not defined in "LiteScopeAnalyzerDriver" class #32

Closed jimmymagemtek closed 3 years ago

jimmymagemtek commented 3 years ago

Hi Sir, As title, so this class can't work. Please advise. Thanks.

Jimmy

class LiteScopeAnalyzerDriver: def init(self, regs, name, config_csv=None, debug=False): self.regs = regs self.name = name self.config_csv = config_csv if self.config_csv is None: self.config_csv = name + ".csv" self.debug = debug self.get_config() self.get_layouts() self.build() self.group = 0 self.data = DumpData(self.data_width)

    self.offset = 0
    self.length = None

    # Disable trigger and storage
    self.trigger_enable.write(0)
    self.storage_enable.write(0)
    ...
jimmymagemtek commented 3 years ago

The log is attached as below: (Note: to let "litescope_cli.py" work with "RemoteClass", I need to move it to the folder:~/litex/litex/litex/tools. Please refer to the issue: https://github.com/enjoy-digital/litex/issues/894)

root@localhost tools]# ./litescope_cli.py Traceback (most recent call last): File "./litescope_cli.py", line 138, in main() File "./litescope_cli.py", line 120, in main analyzer = LiteScopeAnalyzerDriver(bus.regs, basename, debug=True) File "/root/litex/litescope/litescope/software/driver/analyzer.py", line 39, in init self.trigger_enable.write(0) AttributeError: 'LiteScopeAnalyzerDriver' object has no attribute 'trigger_enable'

enjoy-digital commented 3 years ago

Hi @jimmymagemtek,

Can you provide the command line you are using? Are you using litescope this way?: litescope_cli --csv=my_analyzer.csv? Note that by default, litescope_cli will look foranalyzer.csv, if you create a custom analyzer, be sure to not rename your my_analyzer.csv to analyzer.csv (as I think you are doing) since the registers will no longer match but use --csv=my_analyzer.csv instead.

jimmymagemtek commented 3 years ago

Hi @enjoy-digital , Thanks for the prompt reply. I adopt your suggestion while still got the same result. Please see the log as below:

Jimmy


[root@localhost tools]# ls -al total 156 drwxr-xr-x. 4 root root 4096 Apr 26 22:28 . drwxr-xr-x. 8 root root 106 Apr 26 05:32 .. -rw-r--r--. 1 root root 12318 Apr 21 06:56 csr.csv -rw-r--r--. 1 root root 1 Apr 21 06:13 init.py -rwxr-xr-x. 1 root root 4813 Apr 26 05:55 litescope_cli.py -rwxr-xr-x. 1 root root 8575 Apr 26 05:52 litex_client.py -rwxr-xr-x. 1 root root 5651 Apr 26 04:18 litex_client.py.bak -rwxr-xr-x. 1 root root 9541 Apr 26 05:51 litex_client.py.test -rwxr-xr-x. 1 root root 8043 Apr 21 06:13 litex_gen.py -rwxr-xr-x. 1 root root 20440 Apr 21 06:13 litex_json2dts.py -rwxr-xr-x. 1 root root 2097 Apr 21 06:13 litex_read_verilog.py -rwxr-xr-x. 1 root root 10902 Apr 21 06:13 litex_server.py -rwxr-xr-x. 1 root root 21040 Apr 21 06:13 litex_sim.py -rwxr-xr-x. 1 root root 20124 Apr 21 06:13 litex_term.py drwxr-xr-x. 2 root root 72 Apr 26 05:53 pycache drwxr-xr-x. 3 root root 164 Apr 21 06:40 remote -rw-r--r--. 1 root root 713 Apr 26 22:27 rfic_header_analyzer.csv [root@localhost tools]# ./litescope_cli.py --csv=rfic_header_analyzer.csv Traceback (most recent call last): File "./litescope_cli.py", line 138, in main() File "./litescope_cli.py", line 120, in main analyzer = LiteScopeAnalyzerDriver(bus.regs, basename, debug=True) File "/root/litex/litescope/litescope/software/driver/analyzer.py", line 39, in init self.trigger_enable.write(0) AttributeError: 'LiteScopeAnalyzerDriver' object has no attribute 'trigger_enable' [root@localhost tools]#

jimmymagemtek commented 3 years ago

Hi Sir, I forgot to put csr.csv in the folder. It is working. Thanks.

jimmymagemtek commented 3 years ago

Hi I need to reopen the issue, since for unknown reason, it doesn't work again, even csr.csv is there & --csv=filename.csv is specified. I attach the log as below. Please help. Thanks.

[root@localhost software]# ./litescope_cli.py --list --csv=crg.csv main_crg_clk_inn [root@localhost software]# ./litescope_cli.py --csv=crg.csv -r main_crg_clk_inn Traceback (most recent call last): File "./litescope_cli.py", line 138, in main() File "./litescope_cli.py", line 120, in main analyzer = LiteScopeAnalyzerDriver(bus.regs, basename, debug=True) File "/root/litex/litescope/litescope/software/driver/analyzer.py", line 39, in init self.trigger_enable.write(0) AttributeError: 'LiteScopeAnalyzerDriver' object has no attribute 'trigger_enable' [root@localhost software]#

enjoy-digital commented 3 years ago

Hi @jimmymagemtek,

is the csr.csv of the SoC also in the repository where you are running the command? If yes, please provide the .csv generated for the SoC and .csv of the analyzer.

jimmymagemtek commented 3 years ago

There you go. Many thanks~

uploads.zip

enjoy-digital commented 3 years ago

Thanks, the issue is that the name of the .csv for the analyzer should match the one in your design. The name for crg.csv should be crg_analyzer.csv.

jimmymagemtek commented 3 years ago

Resolved. Thanks.