Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions m2isar/backends/etiss/templates/etiss_arch_cpp.mako
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,15 @@ void ${core_name}Arch::resetCPU(ETISS_CPU *cpu, etiss::uint64 *startpointer)

% for reg in actual_regs:
% if not isinstance(reg, (arch.Memory, arch.Alias)):
% if not reg.is_pc:
% if isinstance(reg.ty, type_info.ArrayType):
% if isinstance(reg, arch.RegisterBank):
<% assert 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 :-)

{
${core_name.lower()}cpu->${reg.name}[i] = 0;
}
% else:
<% assert isinstance(reg.ty, type_info.PrimitiveType) %>
% if not reg.is_pc:
${core_name.lower()}cpu->${reg.name} = 0;
% endif
% endif
Expand Down