Skip to content

Adding support to generate an svg from opcodes - #364

Merged
Andrew Waterman (aswaterman) merged 8 commits into
riscv:masterfrom
NXP:feature/svg
Aug 8, 2025
Merged

Adding support to generate an svg from opcodes#364
Andrew Waterman (aswaterman) merged 8 commits into
riscv:masterfrom
NXP:feature/svg

Conversation

@christian-herber-nxp

Copy link
Copy Markdown
Contributor

latest output for rv64*, rv_*:

inst

Code is far from performance optimized, but does not run long either.
Main limitation I run into is font size < 1 is not allowed with matplotlib, but I could not quickly figure out a better way than matplotlib.
Anyway, this limitation only affects tiny encodings. All the major stuff is nicely visible.

@codecov

codecov Bot commented Aug 7, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.13%. Comparing base (383cbca) to head (5c08ea7).
⚠️ Report is 25 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #364      +/-   ##
==========================================
+ Coverage   96.53%   97.13%   +0.60%     
==========================================
  Files          10       12       +2     
  Lines         750      909     +159     
==========================================
+ Hits          724      883     +159     
  Misses         26       26              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread rv_colors.py
Comment on lines +2 to +3
"Berkeley Blue": "#003262",
"California Gold": "#FDB515",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go bears

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I didn't perform a line-by-line code review, but I'm approving on the basis that existing functionality is unaffected.

@aswaterman

Copy link
Copy Markdown
Member

Can you handle the CI failures when you get a chance?

@christian-herber-nxp

Copy link
Copy Markdown
Contributor Author

Can you handle the CI failures when you get a chance?

Yes I will check it out

@christian-herber-nxp

Copy link
Copy Markdown
Contributor Author

Andrew Waterman (@aswaterman) I am pretty lost with those CI issues. It seems it cannot import matplotlib, but I do not see a designated place where the package requirements are declared for this project (e.g. a requirements.txt).
The code coverage is strange, as it claims a 24 commit difference (I am only adding 2 commits and am otherwise in sync with master).

@christian-herber-nxp

Copy link
Copy Markdown
Contributor Author

Andrew Waterman (@aswaterman) I am pretty lost with those CI issues. It seems it cannot import matplotlib, but I do not see a designated place where the package requirements are declared for this project (e.g. a requirements.txt). The code coverage is strange, as it claims a 24 commit difference (I am only adding 2 commits and am otherwise in sync with master).

I managed to get most of the issues out of the way, and am now working on the static type checking issues.
I do not think I will be able to get rid of the codecov problem, but I will keep you posted.

Matplotlib types cannot be resolved by the linter.
Matplotlib calles are ignored for type checking
@christian-herber-nxp

Copy link
Copy Markdown
Contributor Author

Andrew Waterman (@aswaterman) I am pretty lost with those CI issues. It seems it cannot import matplotlib, but I do not see a designated place where the package requirements are declared for this project (e.g. a requirements.txt). The code coverage is strange, as it claims a 24 commit difference (I am only adding 2 commits and am otherwise in sync with master).

I managed to get most of the issues out of the way, and am now working on the static type checking issues. I do not think I will be able to get rid of the codecov problem, but I will keep you posted.

everything except for codecoverage is good now. Any guidance is appreciated on this one.

@aswaterman

Copy link
Copy Markdown
Member

Christian Herber (@christian-herber-nxp) I am pretty confused myself. I clicked on the failing code-coverage test, then it started showing up as passed on the github dashboard.

@aswaterman
Andrew Waterman (aswaterman) merged commit 767b741 into riscv:master Aug 8, 2025
12 checks passed
@aswaterman

Copy link
Copy Markdown
Member

Anyway, it is merged now.

@christian-herber-nxp

Copy link
Copy Markdown
Contributor Author

Thanks. The whole linting and type checking was quite useful

Andrew Waterman (aswaterman) added a commit that referenced this pull request Sep 4, 2025
The SVG generation in #364 broke this in a surprising way (though #364
really is not to blame).  The addition of a file in the root directory
that began with `rv` caused the Make rule to glob that file, rather than
passing the string `rv*` through to `parse.py`.
Andrew Waterman (aswaterman) added a commit that referenced this pull request Sep 4, 2025
The SVG generation in #364 broke this in a surprising way (though #364
really is not to blame).  The addition of a file in the root directory
that began with `rv` caused the Make rule to glob that file, rather than
passing the string `rv*` through to `parse.py`.
@tomaird

Copy link
Copy Markdown

Christian Herber (@christian-herber-nxp) Andrew Waterman (@aswaterman)

This PR has added a non-standard Python library dependency (matplotlib), which now means parse.py cannot be run as a standalone script without installing additional dependencies. IMO this is a big degradation of functionality, particularly as there's currently no support for installing this dependencies as part of this repo. And this feature isn't exactly

Please consider re-adding this feature in a way that still allows this script to run without dependencies

@aswaterman

Copy link
Copy Markdown
Member

Tom Aird (@tomaird) agreed, it would be best to only depend on matplotlib if this feature is invoked.

@christian-herber-nxp

Copy link
Copy Markdown
Contributor Author

Tom Aird (@tomaird): I have just submitted this: #379
Let me know if this solves it for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants