lowRISC / lowRISC/opentitan

[regtool] remove unused empty line from `-d` output

Open Beginner friendly
#24,671 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
SystemVerilog
Stars
3.6k
Forks
1.1k
Avg merge
2d 22h
Merged PRs (30d)
141

Description

Description
Problem

If regtool is used to generate the register-documentation, for example ./util/regtool.py -d hw/ip/ascon/data/ascon.hjson > hw/ip/ascon/doc/registers.md The markdown file ends with two empty lines. However, this is triggers the Lint in the CI:

Would have fixed 1 files.
Fixing file: "hw/ip/ascon/doc/registers.md"
##vso[task.logissue type=error]Whitespace check failed. Please run util/fix_trailing_whitespace.py on the above files.

Running this command then removes one of the empty lines.

Solution

Regtool shouldn't add this duplicate empty line in the first place

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in util/regtool.py and reproduce the issue with ./util/regtool.py -d hw/ip/ascon/data/ascon.hjson > hw/ip/ascon/doc/registers.md. Trace how the generated markdown is terminated, then verify that the output no longer contains the duplicate empty line and passes the whitespace check without util/fix_trailing_whitespace.py.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
60/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.