[tlul] ensure we can't execute from registers
Support for InstrType instruction fetches has been added to memories via tlul_adapter_sram, but there are no checks to make sure that we can't execute from an IP's CSRs (for example the KMAC state window).
This will require a bit of RTL and DV overhead - tlul_adapter_reg will have to be updated to only allow DataType transactions, and a common DV test should be added to drive instruction fetch transactions to all CSRs in an IP's regfile.
How would we execute from KMAC CSRs? Only a very limited set of IPs are connected to the instruction fetch bus of Ibex (https://github.com/lowRISC/opentitan/blob/master/hw/top_earlgrey/data/xbar_main.hjson#L154).
Indeed, I think this case should not occur since there is no physical connection between ifetch port and peripheral CSR nodes.
o that's a good point. I kind of forgot about the fact that the fabric is physically disconnected.
I guess this applies more if in the future we have cases where executable memories are wrapped up inside modules. And if those paths have separate registers built-in. As an example flash may fall into this category when we do the merge.
i think one more thing to Udi's point.. is that the disconnected fabric is more or less a top level decision.
But from a block level perspective, that assumption may not always be true. So since it's cheap to add a "no instructions" check into tlul_adapter_reg, it is probably still worth doing.
ah thanks @imphil and @msfschaffner , I had not checked the xbar to check what was actually connected to the core.
I was thinking of this more from an IP-level perspective though, e.g. the KMAC testbench may not know that it is not connected to the CPU so it still could be worth checking that InstrType transactions don't go through just to cover this scenario. wdyt?
Sorry for the long silence on this one. I think this is a good idea, let's add a check for this to tlul_adapter_reg.
I believe this check has been added to tlul_err.sv, so closing this issue.