Closed jedrzejboczar closed 2 years ago
Excellent work @jedrzejboczar, you are reaching another level of abstraction here! (That would be a good example to show to FPGA designers asking the advantages of designing FPGA in Python :)) cc @mithro @kgugala @mgielda
As always, your code is very clean and the the changes introduced in S7DDRPHY are minimal and looks fine, so we can merge it to allow you to go further.
This is an update and refactor of https://github.com/enjoy-digital/litedram/pull/258. This change set includes changes from https://github.com/enjoy-digital/litedram/pull/268, please use the following diff to view only the additional changes: https://github.com/antmicro/litedram/compare/jboc/init-refactor...jboc/dfi-converter-new To work it requires the fix from https://github.com/enjoy-digital/litex/pull/986.
As described in the previous PR, DFI rate converter allows to increase frequency ratio between MC and PHY. DFIRateConverter now provides a method to automatically generate wrapper PHY classes: https://github.com/antmicro/litedram/commit/1d880c4db9bb27e9efcf88fe2cfc247bd18c6072. It will update phy settings, but requires that the wrapped PHY class is compatible, i.e. it takes a csr_cdc argument.
The old HalfRateA7DDRPHY example class has been removed. S7DDRPHY has been updated for compatibility with DFIRateConverter (CDC for CSRs, way to use different DDR clock). There is also a convenience function s7ddrphy_with_ratio (https://github.com/antmicro/litedram/commit/f4be065c09499af247969d8f376a3aa6f1dfae6a).
I have successfully tested this on Arty with the following changes: