Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/improved latex table #160

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tovine
Copy link
Contributor

@tovine tovine commented Feb 10, 2023

I've made some changes to the LaTeX table generation (even though future documentation is supposed to be going towards AsciiDoc it's still useful to be able to generate full instruction set listings in the classical format.

This pull request includes automatic extraction of which instruction format headers to print (based on the actual instructions in the list), so there's no longer any need to provide them manually.
It also handles breaking up tables when they expand past a page boundary so longer extensions can be printed without manually splitting them (no idea why LaTeX can't do that automatically though).

Here's an example 16-bit table generated by this (see commented Zc* extensions in the diff):
image

And here's an example of multi-page table splitting:
image

Now automatically generates the list of instruction types based
on the encodings used in the list of instructions to be printed,
instead of requiring the headers to be passed alongside the data.
Also inserts new pages whenever the table grows to such a length
that entries would spill over to the next one.
@tovine
Copy link
Contributor Author

tovine commented Feb 10, 2023

Note that I've not yet removed the type_list parameter from the function or the calls.
I first wanted to minimize the number of only-peripherally-related changes to avoid unnecessary reviewer fatigue and focus on the actual changes, but I can clean it up before merging. :)

@neelgala
Copy link
Collaborator

@tovine This definitely looks cleaner and better. I will need sometime to verify this at my end.

However, does this still produce the same tables as currently seen in the riscv-isa-manual ? If not @aswaterman should indicate if this change is acceptable.

@codecov-commenter
Copy link

Codecov Report

Merging #160 (a085f02) into master (bec2564) will decrease coverage by 0.09%.
The diff coverage is 91.78%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master     #160      +/-   ##
==========================================
- Coverage   94.18%   94.10%   -0.09%     
==========================================
  Files           3        3              
  Lines         688      729      +41     
==========================================
+ Hits          648      686      +38     
- Misses         40       43       +3     
Impacted Files Coverage Δ
parse.py 91.61% <91.78%> (+0.09%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@tovine
Copy link
Contributor Author

tovine commented Feb 10, 2023

@tovine This definitely looks cleaner and better. I will need sometime to verify this at my end.

However, does this still produce the same tables as currently seen in the riscv-isa-manual ? If not @aswaterman should indicate if this change is acceptable.

It should be exactly the same if only the same dataset is used, yes.
Here's how the compressed generation looks after the latest commit (added bit positions to the top) - using this example dataset for the Zc* extensions:

    # Zc* extensions
    caption = '\\caption{Zc* extensions for code size reduction on RISC-V}'
    dataset_list = [(['_zcb'], 'RV32Zcb (basic compressed ops) extension', [], True)]
    dataset_list.append((['64_zcb'], 'RV64Zcb extension (in addition to RV32Zcb)', [], True))
    dataset_list.append((['_zcmp'], 'Zcmp (push/pop) extension', [], True))
    dataset_list.append((['_zcmt'], 'Zcmt (table jump) extension', [], True))
    make_ext_latex_table(type_list, dataset_list, latex_file, 16, caption)

image

Copy link
Member

@aswaterman aswaterman left a comment

Choose a reason for hiding this comment

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

In the originals, we only have one instruction format header per page, which subsumes all formats used on that page. This version has a second set of headers on one of the pages; see the screenshot.

Screen Shot 2023-02-13 at 3 57 35 PM

@tovine
Copy link
Contributor Author

tovine commented Feb 20, 2023

Thanks for the feedback, a bit busy this week but will make sure to take a look at fixing it when that changes!

@aswaterman
Copy link
Member

If it turns out to be more difficult than expected to generate the original tables exactly, then it might not be worth pursuing, since (as you said) we'll be moving to asciidoc in the next few months anyway. Your call, of course.

@tovine
Copy link
Contributor Author

tovine commented Aug 18, 2023

Sorry, I've been too swamped lately and haven't really had time to work on this at all. And the generated tables work well enough for my use so I can't justify working more on it.
You can decide if you'd like to accept it as is or just leave it hanging as an alternative branch

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.

None yet

4 participants