if(~spi_read & ~spi_write){ if(select && rd == 1'b0){ spi_read(); }else if(select && wr == 1'b0){ spi_write(); } }