Add APB examples and fix APB pin level adapters
I initially added an example for APB, but later found that the test didn’t work correctly due to several bugs. So I rewrote it to fix those issues.
Fix details:
-
Strobe signals were not handled properly — only consecutive 0xFF values were considered, but the APB spec does not guarantee they are contiguous.
-
A deadlock occurred due to a missing generic payload free.
-
Removed unused variables, redundant code, and replaced wait(1_ps) with wait(SC_ZERO_TIME).
The waveform below shows the correct behavior after applying this patch.
@JingJerYen THX for the PR. I need to review the code in more detail as these are significant changes. Did you run it with a verilated design? Or coupled with a Verilog simulator?
For this PR, I didn't run it with any RTL-level design. I just added the examples and found they didn't work, so I tried to fix the pin-level adapters. And the waveform was produced by examples/apb.
I can add some comments on the code to explain some parts of the commit
As written earlier there were issues in other cases. Therefore I made the PSTRB/byte enable handling configurable using a cci_param.