-
Notifications
You must be signed in to change notification settings - Fork 36
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
Fix CI; add dimensioned register fields #108
Open
simonjwright
wants to merge
6
commits into
AdaCore:master
Choose a base branch
from
simonjwright:fix/ci+dimensioned-regs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* .github/workflows/main.yml: (gnat_version): removed. (gprbuild_version): removed. (actions/checkout): v3. (project/setup-alire): v3. (toolchain): specify gnat_native before gprbuild, to avoid picking mismatched versions.
* svd2ada.gpr (Install): new.
This warning (treated as error) causes build failure in CI on at least Ubuntu. * src/ada_gen.adb (Get_Boolean): rename Dead, Dead2 to Dummy, Dummy2, so GNAT won't report unused warnings.
From the SVD, field components have an optional <dimElementGroup>: <dim> specifies the number of array elements, <dimIncrement> specifies the address (?bit) offset between consecutive array elements, (optional) <dimIndex> specifies "a comma seperated list of strings being used for identifying each element in the array", but we only see r'[0-9]+\-[0-9]+'. We will produce <dim> fields, where %s in the Name translates to the first component of <dimIndex> incremented by 1 for each field, and LSB, MSB are incremented by <dimIncrement>. * src/descriptors-field.ads (Field_T): added components Dimensions: contents of the <dim> field in the SVD, Increment: contents of the <dimIncrement> field in the SVD, Index: the first component of the <dimIndex> field in the SVD. (Null_Field): added values for the new components, using associations. * src/descriptors-field.adb: (context): with Ada.Strings.Fixed, so we can pick out which Trim is required. (Read_Field): initialize new fields in Result. In particular, Dimensions will be set to 1. If present, process tags dim, dimIncrement, dimIndex. (Dump): add new function Insert_Dimensioned_Fields. Call this function on the input Reg_Fields, and then run the rest of Dump on the result. (Insert_Dimensioned_Fields): new. For each Field in the original, insert as many copies as indicated by its Dimensions, updating the Name, LSB and MSB. Note that if the original field from the SVD had no <dim> component, Dimensions will have been set to 1 by Read_Field, so this process will be done just once (resulting in no change).
* alire.toml (version): updated to 0.1.1. (xmlada): updated to ">=22.0.0" (we're presently on 24.0.0).
Warnings reported in CI by GCC 14.2.1 on Ubuntu, but not locally on macOS. * src/descriptors-field.adb: descriptors-field.adb:302:19: warning: "Addition" is not modified descriptors-field.adb:303:19: warning: "Index" is not modified descriptors-field.adb:304:19: warning: "LSB" is not modified descriptors-field.adb:305:19: warning: "MSB" is not modified descriptors-field.adb:310:25: warning: "Percent_S" is not modified descriptors-field.adb:313:25: (style) "exit Substitute" required descriptors-field.adb:372:07: warning: "Full_Fields" is not modified
Open
Hi @pat-rogers could you or someone else take a look at this? :) |
@pat-rogers ping? :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I would have put this in as 3 separate PRs, but they would need to be implemented in the right order, because the way that CI had been set up meant that CI failed.
Next, arrange that
alr install
installs the schema and SVDs, so that they’re accessible on the user’s computer.Next (the main event), fix the problem raised in issues #100, #102, #106, where register fields with
%s
(and a<dim>
tag, hence "dimensioned") weren’t properly translated.