When using x4 modules, their response makes up only half a byte.
We need to extract the nibble and then test it.
Signed-off-by: Michal Sieron <msieron@antmicro.com>
It allows to perform a memtest (similar to `sdram_test`), but using DMAs
and bypassing system bus. This way, one can test ranges such above 4 GiB,
which was the limit with `sdram_test` due to address_width being limited
to 32 bits.
Signed-off-by: Michal Sieron <msieron@antmicro.com>
`SDRAM_TEST_DATA_BYTES` definition was incorrect as it treated size
specified in CSR subregisters as if it was a byte count.
Correct way to calculate that is to use definitions from `sdram_phy.h`.
```
#define SDRAM_TEST_DATA_BYTES (SDRAM_PHY_DFI_DATABITS / 8 * SDRAM_PHY_PHASES)
```
Also:
- extracted code to `sdram_bist_[write|read]` functions
- made global variables static
- fixed formatting
Signed-off-by: Michal Sieron <msieron@antmicro.com>
Always print MAIN-RAM and optionally print SDRAM.
This is caused by the fact, that SDRAM size can be bigger than
RAM declared in the memory map.
Signed-off-by: Michal Sieron <msieron@antmicro.com>
Add `get_supported_memory` function that reads SPD to calculate
supported memory from the SDRAM.
When it's not possible to read from the SPD (no I2C) or there are errors
with the readout, it defaults to `SDRAM_PHY_SUPPORTED_MEMORY` defined in
`generated/sdram_phy.h` by `litedram/init.py`.
Signed-off-by: Michal Sieron <msieron@antmicro.com>
Right now there are only `print_size` and `print_progress` functions
from memtest.c, but changed to use uint64_t.
Signed-off-by: Michal Sieron <msieron@antmicro.com>
Add generic `sdram_read_spd` function which allows to read SPD data
with no need to think about paging.
Just provide SPD address, address from which you want to read the data,
buffer and length of the data.
Paging is taken care of inside the function.
Signed-off-by: Michal Sieron <msieron@antmicro.com>
The current check compares the integers split out from `meson --version`
one by one. This is an ad-hoc version comparison algorithm with a few
flaws, notably that it doesn't truly understand how version components
fit together, and that broke once Meson bumped the major version. There
are other potential issues that could show up but haven't yet, such as
versions with words in them (release candidates).
The packaging module is a high-quality library that provides a standard
version parsing algorithm, with which you can simply say "is this
version object greater than that one". Use it instead.
Fixes#1545
a286d77e introduced a bug, where `-include_dirs` parameter is
incorrectly defined.
Following TCL code is being generated:
```tcl
synth_design -directive default -top digilent_arty -part xc7a35ticsg324-1L -include_dirs \{.join(self.platform.verilog_include_paths)}\}
```
Below is an explanation why it didn't work:
Python's f-strings escape curly braces using double curly braces like so
`{{` instead of using backslash `\{`.
What's more, you need to alternate single and double quotations marks
when using strings in curly braces expression otherwise two string
objects are being generated and errors like this one can happen.
Signed-off-by: Michal Sieron <msieron@antmicro.com>
Copy all feature and performance related CSR configuration from
sun20i_d1_spl, which are values Allwinner suggests for D1 SoC.
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>