diff --git a/library/spi_engine/spi_engine_execution/spi_engine_execution.v b/library/spi_engine/spi_engine_execution/spi_engine_execution.v index 5de3b21a6..b99b2d33c 100644 --- a/library/spi_engine/spi_engine_execution/spi_engine_execution.v +++ b/library/spi_engine/spi_engine_execution/spi_engine_execution.v @@ -177,7 +177,7 @@ always @(posedge clk) begin end always @(posedge clk) begin - if (cmd_ready) + if (cmd_ready & cmd_valid) cmd_d1 <= cmd; end @@ -405,6 +405,8 @@ assign trigger_rx_s = trigger_rx_d[SDI_DELAY+1]; // Load the serial data into SDI shift register(s), then link it to the output // register of the module + +wire cs_active_s = (inst_d1 == CMD_CHIPSELECT) & ~(&cmd_d1[NUM_OF_CS-1:0]); genvar i; generate for (i=0; i