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

Add reset values and access modifiers from the SDK #6

Merged
merged 26 commits into from
Feb 6, 2021

Conversation

username223
Copy link
Contributor

This PR adds reset values and access modifiers directly from the SDK.

The struct fields (specific structs in each commit) parsed looked like

Unused		Name                       Width   LSB/MSB      Access       Reset value
V           V                          V         V           V           V
uint32_t field_name                 :  1; /* [   16],        r/w,        0x0 */

There are some fields with access values as w1c and w1p, although I do not know how to represent this in the SVD so they have not been included. In the future those modifiers should also be added.

Reset and access values were incorrectly applied to the wrong registers.

`se_trng_0_rosc_en` is called `se_trng_0_rosc_dis` in the SDK and has
been changed (same bit location in the same register).
@username223
Copy link
Contributor Author

I've rechecked every value and came up with some misapplied reset values and access modifiers, as well as some registers in GLB that I missed because I assumed that I had done them in PR #4.

The se_trng_0_rosc_en register is called se_trng_0_rosc_dis in the SDK, at the same bit position and in the same register. The name has been changed and a note has been added in the description.

@username223
Copy link
Contributor Author

Fixed merge conflict from PR #5.

@username223
Copy link
Contributor Author

Build fails due to warnings

*** WARNING M223: soc602_reg.svd (Line 2) 
  Input File Name 'soc602_reg' does not match the tag <name> in the <device> section: 'BL602'

*** WARNING M209: soc602_reg.svd
  CPU section not set. This is required for CMSIS Headerfile generation and debug support.


Found 0 Error(s) and 2 Warning(s).

Error: Process completed with exit code 1.

Until these are fixed the return code of SVDConv should be ignored.

@9names
Copy link
Collaborator

9names commented Feb 4, 2021

Ignoring the return code from program using GHA is painful.
I'm going to remove the execution of SVDConv from the workflow for now, and put it in a script or something later so that's easier to test locally

@username223
Copy link
Contributor Author

Couldn't you do something like

#! /usr/bin/env bash
./SVDConv soc602_reg.svd
if [ $? == 1 ]; then
    exit 0
fi

Since return code 0 is nothing, 1 is warning and 2 is error, only capturing 1 will still fail on errors.

@9names
Copy link
Collaborator

9names commented Feb 4, 2021

Yep, that's exactly what we need to do

@username223
Copy link
Contributor Author

Ah, I see what you meant in your original comment now, Github Actions is indeed a little annoying to use at times.

@username223
Copy link
Contributor Author

Corrected duplicated resetValues to resetMasks as was originally intended.

@9names 9names merged commit f309636 into sipeed:main Feb 6, 2021
@username223 username223 deleted the parse-data-from-sdk branch February 6, 2021 02:19
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.

2 participants