Skip to content

[BUGFIX] Register Bank has no is_pc - #114

Merged
PhilippvK merged 3 commits into
coredsl2from
bugfix/fixing_pc_checks
Jul 29, 2026
Merged

[BUGFIX] Register Bank has no is_pc#114
PhilippvK merged 3 commits into
coredsl2from
bugfix/fixing_pc_checks

Conversation

@PhilippvK

Copy link
Copy Markdown
Member

No description provided.

@PhilippvK
PhilippvK requested a review from jokap11 July 28, 2026 13:14
@PhilippvK PhilippvK self-assigned this Jul 28, 2026
% if not isinstance(reg, (arch.Memory, arch.Alias, arch.RegisterBank)):
% if not reg.is_pc:
% if isinstance(reg.ty, type_info.ArrayType):
for (int i = 0; i < ${arch.get_const_or_val(reg.ty.length)}; ++i)

@jokap11 jokap11 Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good catch that my solution was a bit sloppy here.
Excluding RegisterBanks seems a bit contradictory, as we explicitly initialize a RegisterBank in the following three lines.
I would suggest moving the if not reg.is_pc check into the else branch instead.
As ArrayType=RegisterBank and PrimitiveType=Register
Does that fix your issue?
I assume this is also just there to avoid pointing your PC to the Interrupt Vector Table aka 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fine by me!
Works for me. The problem for me was simply, that if the register bank is not in there, it crashed on the if is_pc check, since the register bank does not support this attribute.

I have rebuilt everything with your solution, so it works for me!
Thanks for fixing it :-)

@jokap11

jokap11 commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

@MercurCodes Does this commit fix your problems?

@PhilippvK
PhilippvK merged commit 90aec60 into coredsl2 Jul 29, 2026
1 check passed
@PhilippvK
PhilippvK deleted the bugfix/fixing_pc_checks branch July 29, 2026 05:02
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.

3 participants