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

SPI Engine: improve test_sleep_delay #110

Merged
merged 2 commits into from
Jul 19, 2024
Merged

SPI Engine: improve test_sleep_delay #110

merged 2 commits into from
Jul 19, 2024

Conversation

LBFFilho
Copy link
Contributor

@LBFFilho LBFFilho commented Jun 21, 2024

Check for sleep delay being affected by SPI word size (should not be affected). Complements analogdevicesinc/hdl#1361

Check for sleep delay being affected by SPI word size
(should not be affected)

Signed-off-by: Laez Barbosa <laez.barbosa@analog.com>
Signed-off-by: Laez Barbosa <laez.barbosa@analog.com>
@@ -281,7 +296,7 @@ task sleep_delay_test(
// Write commands
axi_write (`SPI_ENGINE_SPI_REGMAP_BA + GetAddrs(AXI_SPI_ENGINE_CMD_FIFO), `INST_CFG);
axi_write (`SPI_ENGINE_SPI_REGMAP_BA + GetAddrs(AXI_SPI_ENGINE_CMD_FIFO), `INST_PRESCALE);
axi_write (`SPI_ENGINE_SPI_REGMAP_BA + GetAddrs(AXI_SPI_ENGINE_CMD_FIFO), `INST_DLENGTH);
axi_write (`SPI_ENGINE_SPI_REGMAP_BA + GetAddrs(AXI_SPI_ENGINE_CMD_FIFO), ((`INST_DLENGTH) & 32'hFFFF_FF00) | 16);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The situation of this line:
Masking INST_DLENGHT set on common/sv/spi_engine_instr_pkg.sv because it has a default value: DATA_DLENGTH.
DATA_DLENGTH is set on the cfg filespi_engine/cfgs/cfg_inv_cs.tcl e.g, spi_engine/cfgs/cfg_inv_cs.tcl
Wouldn't it be better to be a macro call, e.g. `INST_DLENGTH(`DATA_DLENGTH), `INST_DLENGTH(16)
Only spi_engine currently uses spi_engine_instr_pkg.sv

Same for any instruction that take a value, CLOCK_DIVIDER->INST_PRESCALE etc

spi_engine/tests/test_sleep_delay.sv Show resolved Hide resolved
@@ -50,7 +50,7 @@ import test_harness_env_pkg::*;
//---------------------------------------------------------------------------
// SPI Engine configuration parameters
//---------------------------------------------------------------------------
localparam PCORE_VERSION = 32'h0001_0200;
localparam PCORE_VERSION = 32'h0001_0201;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not take this value from common/sv/adi_regmap_spi_engine_pkg.sv and avoid having to update test on version bump ?

Copy link
Contributor

@gastmaier gastmaier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe my comments can be resolved in a future pr

@LBFFilho LBFFilho merged commit 72e4ca8 into main Jul 19, 2024
@LBFFilho LBFFilho deleted the spi_sleep_fix branch July 19, 2024 17:09
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

Successfully merging this pull request may close these issues.

2 participants