-
Notifications
You must be signed in to change notification settings - Fork 57
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
Incorrect "out of range" values displayed with <enumeratedValue> #254
Comments
Correct error message:
|
I would propose you to try |
Maybe I misunderstood your message, but how is "Value 4 is outside 0..4" in your post correct? The range of values is 0..3, not 0..4. |
See line |
Oh. I see. It just we use open range (a..b) and close range (a..=b) in Rust. |
Error message is here: svd/svd-rs/src/enumeratedvalue.rs Line 43 in 50ee4f7
|
Ah, thanks for clarifying the open/close range thing. I wasn't aware of that. I was aware of my bitwidth bug as stated in my first post. I was just pointing out that the open range is a bit misleading, not that the parser didn't find a bug on my side. I fixed the range issue before filing this issue. As for the other bugs (_ as name), I haven't fixed those yet due to a lack of names to use. The real crime is that ARM Development Studio (= the company that owns the svd format), is happy with the bad bit width, so if I hadn't used the other html tool I wouldn't have been any wiser. |
You could use |
Fixed by #255 |
Thanks! |
I'm using a project that uses this SVD crate and I found that the error message displayed with an out-of-range value is misleading.
I'm currently using this tool from this repository: https://github.com/bjoernQ/svd2html
I ran this tool against an SVD I'm generating from a bunch of .def files. This tool found some issues with my SVD, but displays a slightly incorrect message:
As you can see, "Value 4" is inside "range 0..4", so this shouldn't be an error. The error that should have been printed is "range 0..3".
If you inspect the SVD File around the line it complains about, you will find a "2" which translates to the correct range 0..3.
You can find my SVD at this repository: https://github.com/DualTachyon/rk3588-svd
Please checkout a specific commit that contains the unfixed SVD:
After building the svd2html tool, you can reproduce the issue in the following way:
I don't know rust much, so I was unable to figure out how to fix this myself and send a PR.
Let me know if you need further clarifications.
The text was updated successfully, but these errors were encountered: