模仿了SPI master从SPI slave读取数据的MiSO数据状态
每8个clk后读取的数据加1
用的一些额外寄存器需要自己声明和初始化
//------------------------------------------------------------------------- //send serial data which is increase by 1 on MiSO line //------------------------------------------------------------------------- task SPIMiSo ; /*port declaration*/beginrepeat(256) beginTmpData = TmpDataBak ;repeat(8)begin//@ (negedge Sclk) ;OutLine = TmpData[7] ;TmpData ={TmpData[6:0],1'b0} ; //左移,低位移入新数据@ (negedge Sclk) ;OutLine = 0 ;endTmpDataBak = TmpDataBak + 1 ;endend endtask