如题:
代码中如果两个if同时都满足,是按先后顺序执行? 还是两句同时执行?
代码如下:
CMD_RES:
begin
if(retry_rep == 8'hff)
cmd_nstate <= CMD_IDLE; //响应超时,返回IDLE重新发起命令
if(spi_rx_rdy && (!spi_tx_enr & !spi_rx_enr))
begin
case(sdinit_cstate)
SD_RD_PT,SD_RD_BPB:
//接收到RD命令的起始字节8'hfe,立即读取后面的512B
if(spi_rx_dbr == 8'hfe)
cmd_nstate <= CMD_RD;
else
cmd_nstate <= CMD_RES;
SDINIT_CMD0,SDINIT_CMD55,SDINIT_ACMD41,SDINIT_CMD16:
if(spi_rx_dbr == 8'hff)
cmd_nstate <= CMD_RES;
else
//产生正确响应,结束当前命令
cmd_nstate <= CMD_CLKE;
default:
cmd_nstate <= CMD_CLKE;
endcase
end
else
cmd_nstate <= CMD_RES;
end |