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

Bug in c header file #87

Open
chrisbohens opened this issue Oct 23, 2024 · 1 comment
Open

Bug in c header file #87

chrisbohens opened this issue Oct 23, 2024 · 1 comment
Labels
kind: bug Something isn't working scope: sw generators Related to software headers/sources generation status: needs discussion Need to collect feedback or discuss details

Comments

@chrisbohens
Copy link

Hi. There is a bug in the c header file generation with the reserved-padding. It occurs when only the last bit of a field is not used (reserved) and the one before is. This results in a c-struct with 31 bits instead of 32, which is not good.

I can't test it right now, but my first guess is that it is a off-by-one mistake in the c_header.j2 file. The

{%if tmp.lsb < config.data_width - 1%}

should probably be

{%if tmp.lsb < config.data_width%}

instead. Maybe someone can confirm?

In the generated md-file the padded reserved bit is generated correctly.

@esynr3z esynr3z added kind: bug Something isn't working scope: sw generators Related to software headers/sources generation status: needs discussion Need to collect feedback or discuss details labels Oct 23, 2024
@esynr3z
Copy link
Owner

esynr3z commented Oct 23, 2024

Hi, thank you for the report. Need to investigate.

Interesting that you refer the line that was changed within previous wave of fixes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working scope: sw generators Related to software headers/sources generation status: needs discussion Need to collect feedback or discuss details
Projects
None yet
Development

No branches or pull requests

2 participants