enjoy-digital / litedram

Small footprint and configurable DRAM core
Other
365 stars 115 forks source link

Fix DFITimingsChecker for DDR4 simulation #314

Closed michalsieron closed 1 year ago

michalsieron commented 1 year ago

In case of DDR4 tRFC and tREFI timings are actually dictionaries with timings specific for the chosen refresh mode.

Right now, it is impossible to simulate DDR4, because an exception happens in DFITimingsChecker.prepare_timings method when indexing val variable.

This is due to the fact, that in DFITimingsChecker.__init__ we request timing values from the module by name, ignoring the fact that some of them (tRFC and tREFI) need to be first accessed using the chosen refresh mode.

This commit fixes this error, by properly using key parameter when calling SDRAMModule.get method to get only required timing.

If one were to fix it in DFITimingsChecker.prepare_timings method, it would require duplicating logic from SDRAMModule.get so this is a simpler and cleaner solution.

Signed-off-by: Michal Sieron msieron@antmicro.com

enjoy-digital commented 1 year ago

Thanks @michalsieron, that's merged.