Skip to content

Apply fixes to coalesced explicit + SPM flush handling from main + Reduce Diff - #42

Open
midnightveil wants to merge 9 commits into
pulp-platform:gwaihir-common-cells-v2from
au-ts:gwaihir-fixes
Open

midnightveil wants to merge 9 commits into
pulp-platform:gwaihir-common-cells-v2from
au-ts:gwaihir-fixes

Conversation

@midnightveil

@midnightveil midnightveil commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

The goal of this changes is to minimise the difference between the partitionable-LLC on the Gwaihir branch and the mainline one.

This mostly focuses on axi_llc_config_pat.sv.

Reviewing these changes by themselves don't really make sense; what I was looking at when making these changes is

git diff --no-index --ignore-all-space src/axi_llc_config_no_pat.sv src/axi_llc_config_pat.sv
and
git diff master:src/axi_llc_config.sv src/axi_llc_config_no_pat.sv.

Where possible, (in the diff to master) I avoid modifying existing lines and instead add new lines. This should hopefully minimise conflicts in future when rebasing the gwaihir branch.

@midnightveil

midnightveil commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

I sent an email to @ezelioli the other day asking about this; as the testbench tb_axi_llc_partition generates test errors for me, so it's already broken.

I'd also be willing the spend the effort cleaning up the gwaihir changes so that it is part of mainline, instead of living in a branch. Specifically, merging the two variants of axi_llc_config would (I think) be an easy enough change to do.

This probably misses some, these were generated with the 'typos' tool.
@ezelioli

ezelioli commented Sep 3, 2026

Copy link
Copy Markdown

I sent an email to @ezelioli the other day asking about this; as the testbench tb_axi_llc_partition generates test errors for me, so it's already broken.

I'd also be willing the spend the effort cleaning up the gwaihir changes so that it is part of mainline, instead of living in a branch. Specifically, merging the two variants of axi_llc_config would (I think) be an easy enough change to do.

Hey @midnightveil , thanks for your efforts! This seems good to me but since I am not the original developer of the extension and did not directly push to the gwaihir branch (I did most of the rebase in the flamingo branch though, which the gwaihir branch cherry-picked afaik), I need to spend some time to review this properly. However, since I am on holidays and with limited connectivity, it will take me a while. Will try to come back to you asap after I am back next week
:)

@midnightveil

midnightveil commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

No worries! If there's someone more relevant to CC in here it would be much appreciated :) (Same with other PRs)

I'm working on trying to figure out what's going on with the test bench that is partitioned , so you might see some more ones.


addendum, my earlier comment:

Specifically, merging the two variants of axi_llc_config would (I think) be an easy enough change to do.

this is unfortunately not easy to do, unless we're okay with using the ifdef and verilog macros to implement it: that is, of course, unless one is willing to fully merge the config changes. (generate-if isn't good enough because of limitations in where you can locate it)

@ricted98

ricted98 commented Sep 3, 2026

Copy link
Copy Markdown

Hi @midnightveil , similar to @ezelioli I am just integrating this feature in a larger project and I am not super familiar with all the details. Nevertheless, the changes in this PR seem okay to me. I would just ask you to choose as target branch gwaihir-common-cells-v2. They should apply cleanly and I think I will eventually merge it in gwaihir branch.

@midnightveil
midnightveil changed the base branch from gwaihir to gwaihir-common-cells-v2 September 3, 2026 12:23
@midnightveil

Copy link
Copy Markdown
Contributor Author

Done.

@phsauter

phsauter commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

So @ezelioli and @ricted98 are you giving the okay to merge?
I do not work with this at all so its very difficult for me to judge.

* ci: Check version metadata consistency

* ci: Simplify version consistency check
@midnightveil

Copy link
Copy Markdown
Contributor Author

(Pushed to fix a compilation error when the branch is based off gwaihir-common-cells-v2 due to commit a457a9c)

* config: clearly delineate software-writable vs software-ro

This does not change the behaviour. Also, because the HW we does
not affect whether a RW register can be written to be SW (and in
fact SW takes higher priority over HW if both try), let's just
make all the _en bits default-disabled and only enable when needed.

* config: use 'saved' value of cfg_spm sw register in 'spm_lock_q'

Otherwise, software can manipulate the value of the cfg_spm register
and cause the hardware to indicate that a way is flushed via the
`conf_regs_o.flushed` register (then used by other parts of the
hardware) when the actual way was never flushed and contains
dirty data. This is under the assumption that software writes
to the configuration registers after CommitCfg.

* config: read the software-input CfgFlush register only once

Previously, software could write to the register and every time
we went through FsmInitFlush it would update the to_flush_d list.
I believe that it was *fine*, in the sense that the list of
thought to be 'flushed' ways would remain coherent with what was
actually flushed no matter what software did.

However, this is quite hard to reason about, and there's basically
no reason why you would ever want to do this: you also don't expect
that anything done after writing the CommitCfg register would take
effect.

* config: cleanup duplicated loop condition

Previously, the loop condition for the FsmInitFlush case was
duplicated in the FsmEndFlush case. This meant an extra set of
the same code needed to be maintained.

The tradeoff is that we take one extra cycle to finish clearing
the flush on the last iteration. However, we've spent some large
amount of cycles flushing all the cache lines to memory, so I
don't think this is a big difference.

@ricted98 ricted98 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As far as I am concerned, LGTM. We can wait also for @ezelioli's feedback.

Where the diff was a non-functional change. This makes it easier to
tell how things have changed.

Compared via the git command:

    git diff --no-index --ignore-all-space \
        src/axi_llc_config_no_pat.sv src/axi_llc_config_pat.sv

And:

    git diff master:src/axi_llc_config.sv \
        gwaihir:src/axi_llc_config_no_pat.sv
We're already passing around this `llc_cfg_t` struct containing
parameters such as `NumBlocks`/`NumLines`, so we can re-use it
for the `CachePartition`-enabled bit, `MaxPartition`, and
`RemapHash`, which removes a lot of changes to module ports/params
just to pass these values around.

We leave them added to the `axi_llc_config_pat` module as it uses
them several times.
VCS reports these warnings when simulating:

Warning-[SIOB] Select index out of bounds
./src/axi_llc_top.sv, 466
"to_isolate_req.aw.user[(AxiUserIdMsb - AxiUserIdLsb):0]"
  The select index is out of declared bounds : [0:0].
  In module instance : i_axi_llc_top_raw
  In module : axi_llc_top.

Warning-[SIOB] Select index out of bounds
./src/axi_llc_top.sv, 466
"slv_req_i.aw.user[AxiUserIdMsb:AxiUserIdLsb]"
  The select index is out of declared bounds : [0:0].
  In module instance : i_axi_llc_top_raw
  In module : axi_llc_top.

Warning-[SIOB] Select index out of bounds
./src/axi_llc_top.sv, 468
"to_isolate_req.ar.user[(AxiUserIdMsb - AxiUserIdLsb):0]"
  The select index is out of declared bounds : [0:0].
  In module instance : i_axi_llc_top_raw
  In module : axi_llc_top.

Warning-[SIOB] Select index out of bounds
./src/axi_llc_top.sv, 468
"slv_req_i.ar.user[AxiUserIdMsb:AxiUserIdLsb]"
  The select index is out of declared bounds : [0:0].
  In module instance : i_axi_llc_top_raw
  In module : axi_llc_top.
@midnightveil

Copy link
Copy Markdown
Contributor Author

I've force-pushed after remerging master and reducing the diff with #44's changes. I've not applied any hardening logic to the partition-flush registers in this PR, so the partition-flush logic should remain identical before/after this; the only change is the logic that's in the non-partitioned flush.

This branch has not been deployed

No deployments
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.

4 participants