Skip to content

Interrupt from HWPE #353

@christian-lanius

Description

@christian-lanius

I want to add an accelerator in the SoC, so I enable the HWPE with the respective flag in the testbench and I can successfully run the example accelerator as well as the datamover example (with some minor changes), however, the wait for the accelerator does not work as far as I can tell:
In the example HWMAC code (https://github.com/pulp-platform/hwpe-tb/blob/master/sw/tb_hwpe.c#L73) a wfi instruction is used to pause the program until the accelerator is done. However, in my case the code never continues beyond that point. I see the insn in the tracer appear before the event triggers, but then nothing happens.
image
This happens with the example code and the MAC engine, as well as with a minimal example with the datamover example.
My understanding from the RISC-V spec is that I don't have to enable any interrupts or anything for this to work: "The Wait for Interrupt instruction (WFI) provides a hint to the implementation that the current hart can be stalled until an interrupt might need servicing [...] The WFI instruction can also be executed when interrupts are disabled."
Even forcing the irq_i input of the core to a non zero value, the core does not continue execution and the interrupt is not acknowledged by the core.
Additionally, just looking at the code, it appears as if the HWPE interrupt reside in the s_events vector in soc_peripherals at 140+141 code. However the soc_event_generator is parameterized to expect them at location 7+8 code as far as I can tell, or is that a misunderstanding?

Is there an example piece of code or some kind of test I can perform to see how interrupts are working?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions