question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can we access multidimensional reg array using cocotb?

See original GitHub issue

Is there any way to access multidimensional reg array in cocotb? Such as

  reg[63:0] gpr[31:0];

Whenever I access the reg like this,

  handle = dut.gpr

It reports ‘RuntimeError: maximum recursion depth exceeded in cmp’

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:30 (19 by maintainers)

github_iconTop GitHub Comments

2reactions
JaewonHurcommented, Jan 23, 2020

I tried. Still RecursionError, messages are below.

Traceback (most recent call last):
  File "/home/jwhur/.local/lib/python3.6/site-packages/cocotb/log.py", line 201, in _log_from_c
    function_name
  File "/usr/lib/python3.6/logging/__init__.py", line 1413, in makeRecord
    sinfo)
  File "/usr/lib/python3.6/logging/__init__.py", line 286, in __init__
    self.module = os.path.splitext(self.filename)[0]
  File "/usr/lib/python3.6/posixpath.py", line 129, in splitext
    return genericpath._splitext(p, sep, None, extsep)
  File "/usr/lib/python3.6/genericpath.py", line 130, in _splitext
    if dotIndex > sepIndex:
RecursionError: maximum recursion depth exceeded in comparison
Fatal Python error: Cannot recover from stack overflow.

Current thread 0x00007f08a43b9600 (most recent call first):
  File "/usr/lib/python3.6/genericpath.py", line 130 in _splitext
  File "/usr/lib/python3.6/posixpath.py", line 129 in splitext
  File "/usr/lib/python3.6/logging/__init__.py", line 286 in __init__
  File "/usr/lib/python3.6/logging/__init__.py", line 1413 in makeRecord
  File "/home/jwhur/.local/lib/python3.6/site-packages/cocotb/log.py", line 201 in _log_from_c
  File "/home/jwhur/.local/lib/python3.6/site-packages/cocotb/utils.py", line 68 in get_sim_time
  File "/home/jwhur/.local/lib/python3.6/site-packages/cocotb/log.py", line 112 in _format
  File "/home/jwhur/.local/lib/python3.6/site-packages/cocotb/log.py", line 179 in format
  File "/usr/lib/python3.6/logging/__init__.py", line 840 in format
  File "/usr/lib/python3.6/logging/__init__.py", line 994 in emit
  File "/usr/lib/python3.6/logging/__init__.py", line 865 in handle
  File "/usr/lib/python3.6/logging/__init__.py", line 1516 in callHandlers
  File "/usr/lib/python3.6/logging/__init__.py", line 1454 in handle
  File "/home/jwhur/.local/lib/python3.6/site-packages/cocotb/log.py", line 203 in _log_from_c
  File "/home/jwhur/.local/lib/python3.6/site-packages/cocotb/utils.py", line 68 in get_sim_time
  File "/home/jwhur/.local/lib/python3.6/site-packages/cocotb/log.py", line 112 in _format
  File "/home/jwhur/.local/lib/python3.6/site-packages/cocotb/log.py", line 179 in format
1reaction
elgorwicommented, Jun 3, 2020

@JaewonHur , This issue can now be closed. Verilator has just been updated with a PR that addresses array access in cocotb: https://github.com/verilator/verilator/pull/2395 To test this you will need to pull the latest Verilator version from git and compile/install manually or alternatively wait until the next (> v4.034) Verilator package release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

v1.3.0 PDF - cocotb's documentation!
The following instructions will allow building of the cocotb libraries for use with a 64-bit native simulator.
Read more >
cocotb/Lobby - Gitter
I intend to use cocotb as a wrapper to an existing SystemVerilog test bench. No need of stimuli then, just to start, monitoring...
Read more >
Can I assign variables to multidimensional array elements in ...
in verilog -- no, in system verilog -- yes (just a bit different syntax). In any case such initialization of variables is not...
Read more >
Top 5 cocotb Code Examples - Snyk
To help you get started, we've selected a few cocotb examples, based on popular ways it is used in public projects. Secure your...
Read more >
Array Example - EDA Playground
In your design, an array can be used to describe RAMs, ROMs, FIFOs, or any regular multi-dimensional structure. Pre VHDL-2008, only one dimension...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found