|
本帖最后由 orange-208 于 2013-5-23 09:30 编辑
如题:
代码中如果两个if同时都满足,是按先后顺序执行? 还是两句同时执行?
代码如下:
CMD_RES:
begin
if(retry_rep == 8'hff)
//响应超时,返回IDLE重新发起命令
cmd_nstate <= CMD_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 |
阿莫论坛20周年了!感谢大家的支持与爱护!!
曾经有一段真挚的爱情摆在我的面前,我没有珍惜,现在想起来,还好我没有珍惜……
|