Block CSR write random data to AST registers
The AST registers can not be written with random data. AST registers serve for setting the Analog blocks and have to be written with specific values during boot time. All other functions are using dedicated signalling, like alerts, clock mux, etc.
The open source AST registers are dummy registers that was added to let the XBAR know the requirements of the AST space. Any information that is required for the boot process is placed in the ast_pkg.sv file.
The close source registers has different names and fields and are hidden for security reasons. Those registers are protected from tampring and access may be limited after boot.
For that reason, we need to add a mode/runtime option to disable CSR writing random data to the AST registers for both open and close source as a default. The close source has the knowledge to change the AST registers correctly and it will do so on the close source repo.
On the other hand, the open source has no knowledge of the AST registers therefore the random write has to enabled by useing a special flag, so when not set, tests can be used on close source without causing errors and alert as a result of wrong programing of the AST registers. Tests for the PR's CIs check process must not use CSR random writes to AST register. Other open source DV tests can use it by setting the flag and by disabling the flag, the tests can be redirected to the close source.
We also need to simplify the load of the AST boot registers image/values.
@tjaychen @arnonsha @sha-ron @sriyerg @rswarbrick
This should be easy enough: we can just add exclusions to ast.hjson.
@sriyerg: Is there anything that the CSR tests would be testing for this block? (Just want to check before I push a PR)
Not for the OS... Just the reset value check.
The CSR tests in the open source do perform random reads and writes to the dummy AST registers. Your closed source testbench replaces the chip RAL with a different chip RAL that has the real AST registers. I would presume that you extend the chip_base_cfg and override it with your extension to facilitate this. If so, then I would recommend adding exclusions in your extended cfg class. Alternately, you could also add the exclusions in the closed source ast,hjson, which should be picked up in your closed source chip RAL. I don't see a clear reason why the open source needs to be touched at all.
We already discussed these options offline, so it would be great for us to understand why does this not work for you (if it indeed does not work for you). I suggest discussing this in our meeting this week.
Since the OS AST registers do not function and are only there for defining XBAR AST space, I will change them to read only registers. This way, the random write issue will go away.
Just to make sure we're on the same page: Sri's explanation above shows how you can fix this by changing the closed-source code. I don't think you should need to alter the open source repo.
I do not want to use Sri's option and I told him that. The AST registers are not ment to be written with random data. Is there a way to limit the CSR when it comes to the AST registers?
I am not looking for a solution for the close source... As I mentioned it is already working on the close source.
Consider a fail on OS that not relate to AST registers. If the CSR randomize the AST registers, the test can not run on the NTIL AST.
A few things.
@Jacob-Levy you can't really change all open source registers to read only. If you do that, it will most likely break against the ROM-AST copy/initialize (ie, you are trying to write a register that cannot be write, I believe our regfile flags this as an error).
If you are just looking for a solution on the open source, why not just use the exclude tag like we've mentioned? That keeps the attributes consistent, and also stops the open source from writing random data to it.
@tjaychen I am looking for the open source to stop writing random data to the AST registers. It seems that you understand that if I make the OS registers read only it might cause an issue. That exactly my point for random writes to the AST registers on the open source.
@Jacob-Levy can you please enlighten to me as to why you cannot use the exclude tag that every other block uses..?
@tjaychen I am not looking to solve an issue on the close source. We have a much more complex solution than exlused in place.
In order to be able to run/debug an open source tests with real AST, the tests the open source generates must comply with the real AST limitation regardless of the open source AST model capabilities.
yes i understand you are not looking to solve close source. But why can the open source ast.hjson not do the same thing? Ie, add exclude tags?
Can I block only random writes in the ast.hjson? If so, I will update the ast.hjson to do it. Can you add an example?
Please follow the example already provided in our email exchanges. Thanks!
Which one?
Would you please clarify the motivation for using the open source chip level DV environment (which models the dummy AST registers) but with the real AST design? Obviously, the tests are failing because it thinks it is verifying the dummy register space, but in fact, there are real registers in the RTL. Any workarounds you make in the open source to get your experimental environment to work, will have unintended consequences elsewhere.
I will suggest sticking to the extended closed source DV environment (with the accurate chip RAL model reflecting the NTIL registers) to match the real AST design (which IIUC is already working for you).
@sriyerg I do not understand why you insist to check a block of registers that are not connected to anything in the AST model? Doing so will block the option to run/debug a test from the open source on the real AST code.
I am trying to bring-up a setup (not the close source) that will enable me to debug issues that the open source run into with the AST model that might reflect on the real AST or will able me to update the AST model to behave more like the real AST.
Apparently you are not concern with this but I do as the owner of the AST.
We are all expending time and effort to help you. But to do so, we need to better understand first what it is that you are trying to achieve and why. Excluding random writes to the AST dummy registers in the open source is absolutely fine with me, but it needs to solve your original problem. I was questioning whether it would, because for quite a while, none of us could figure out that you were trying to make a temporary hacked up chip level DV environment work.
Now that we know what it is, these are my thoughts on this:
- Checking whether the behavioral AST works the same way as NTIL AST is an NTIL AST IP level equivalence check. The NTIL AST IP level testbench needs to have a mode where it can switch between AST RTL and behavioral model to prove that the tests at your AST IP level work.
- If you want to do this at the chip level, don't run any of the CSR tests in this environment, given the mismatch in the register modeling - focus on other tests, given that this is a temporary environment - you already have a closed source chip DV environment which already works, which will be used for signoff.
- Make a PR that updates the open source
ast.hjsonwith the necessary CSR write exclusions. How to add exclusions in theast.hjsonis well documented in the reggen tool, (or you could lookup any other design hjson file).
Hope this helps, thanks!
Blockwd by adding to each register in the ast.hjson
tags: [ // don't write random data to any of the AST registers
"excl:CsrAllTests:CsrExclWrite" ],