Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doubts about DDR_TRAINING_INIT_ALL_MEMORY in MPFS HAL DDR state machine. #19

Open
fcuzzocrea opened this issue Jul 30, 2024 · 2 comments

Comments

@fcuzzocrea
Copy link

fcuzzocrea commented Jul 30, 2024

Hello, at this line of code of the MPFS HAL, the DDR state machine, if ECC is used, initializes the whole memory with a predefined pattern trough the load_ddr_pattern function. This behavior can also be triggered on non ECC system by defining ENABLE_MEM_INIT_NON_ECC (provided that the code under the ifdef is updated for the load_ddr_pattern API change...).

What is not clear to me is how the mem_size parameter is computed and how it is then used. According to the code, mem_size is computed as:

mem_size = LIBERO_SETTING_CFG_AXI_END_ADDRESS_AXI2_1 +\ (LIBERO_SETTING_CFG_AXI_END_ADDRESS_AXI2_0 + 1U);

In the case we consider the ICICLE Kit, which has 1 gb of memory, the LIBERO_SETTING_CFG_AXI_END_ADDRESS_AXI2_1 is set to 0x00000000UL, while LIBERO_SETTING_CFG_AXI_END_ADDRESS_AXI2_0 is set to 0x7FFFFFFFUL.

If for mem_size is intended the memory size in bytes, the the computation appears to be wrong, as it gives roughly 536 mb instead of 1 GB.

Moreover, on my custom board design which has 2 GB of ram, the LIBERO_SETTING_CFG_AXI_END_ADDRESS_AXI2_0 is also set to 0x7FFFFFFFUL, which makes the computation even more strange for me.

Can you help me ?

Thanks,

Dario

@fcuzzocrea
Copy link
Author

Do you have any update on this ?

@fcuzzocrea
Copy link
Author

Additionally, the code seems to not work properly. I created a buffer equal to this one, just with a different pattern.

But it seems that every 64 bytes there are 8 bytes which are put to 0 as you can see from the below screenshot I took while looking at the memory with TRACE32:

Schermata del 2024-07-27 14-51-51

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

No branches or pull requests

1 participant