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.

cocotb 1.4 issue in scoreboard with hexdiffs and hexdumps

See original GitHub issue

Since release 1.4 where strings passed to cocotb.utils.hexdump() and cocotb.utils.hexdiffs() are deprecated, I found out that I experienced issues with the scoreboard results when tests fail. Although all my tests are updated to work with bytes instead of string data, it seems that inside the scoreboard code the got and exp data is still internally converted to strings before the cocotb.utils.hexdump() and cocotb.utils.hexdiffs() are called. It results in a hanging behaviour of the simulator. The same applies for the log.info() where expected and received data is logged inside this piece of code.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:24 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
eric-wiesercommented, Aug 17, 2020

If we want to support rich comparison behavior we would need to introduce a comparison API for all values going into scoreboard.

This feels like a problem we should delegate to pytest, which already has a fair number of comparison tools, source here:

1reaction
ktbarrettcommented, Aug 16, 2020

@hjwmedenblik @eric-wieser The use of str is causing serious problems. Passing bytes to str() returns the representation, it does not decode the string. The resulting string is not equivalent to the original bytes, for example b'\x00\x01\x02\x03' becomes the string "b'\x00\x01\x02\x03'" which has 19 characters. Your exp value as a string is 6083 characters long. This is not only incorrect, but explodes that O(n**2) algo and makes it seem to hang.

We need to fix the scoreboard. I actually have no idea what the intent of the code in the scoreboard is. I’m guessing it was only supposed to ever be used with BinaryValue, but even then hexdiffs isn’t appropriate since BinaryValue.__str__ never returned a hex string. My inclination is to just change the scoreboard to do simpler reporting like I suggested above. But I also think that @hjwmedenblik should just stop using the scoreboard. I remember we talked on the gitter about how I was trying to get rid of the testbenching components because they were “fake useful”, I think you understand now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Release Notes — cocotb 1.7.2 documentation
Its latest version resolves an issue for users on RedHat Enterprise Linux (RHEL) 8 and Python 3.8, where the correct Python library would...
Read more >
cocotb/Lobby - Gitter
Hi all, i am confused since the 1.4 release when test results differ. The release notes say that passing str to hexdump and...
Read more >
cocotb Documentation - Read the Docs
Using a Scoreboard to Track Testbench Errors . ... Assuming you have installed cocotb as described in Installing ... 1.4.1 Architecture.
Read more >
Library Reference — cocotb 1.5.0.dev0 documentation
Deprecated since version 1.4: Use a return statement instead; this works in all supported versions of Python. exception cocotb.result.
Read more >
sig/sigs.yaml · openEuler/community - Gitee.com
src-openeuler/jboss-jacc-1.4-api. - src-openeuler/jboss-jacc-1.5-api ... src-openeuler/internal-issue ... src-openeuler/perl-Parallel-Scoreboard.
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