高云FPGA模块:允许SPI搬运前两byte,有隐患否?
This commit is contained in:
@@ -62,14 +62,14 @@ trait BackBoardSpiSlv{ this: BackBoardSlvLocal =>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
when( shiftCSn(2) & ~shiftCSn(1) ){
|
when( shiftCSn(2) & ~shiftCSn(1) ){ //CS下跳
|
||||||
bitSel := 0.U
|
bitSel := 0.U
|
||||||
byteSel := 0.U
|
byteSel := 0.U
|
||||||
cmd_100M := 0.U
|
cmd_100M := 0.U
|
||||||
exReg_100M := upReg(0)
|
exReg_100M := upReg(0)
|
||||||
} .elsewhen( isSckPosedge & ~shiftCSn(1) & byteSel === 0.U ){
|
} .elsewhen( isSckPosedge & ~shiftCSn(1) & byteSel === 0.U ){ //CS为低,且SCK上跳的第0byte
|
||||||
cmd_100M := Cat( cmd_100M(6,0), shiftMOSI(1) )
|
cmd_100M := Cat( cmd_100M(6,0), shiftMOSI(1) )
|
||||||
} .elsewhen( isSckPosedgeNext(1) & ~shiftCSn(1) & bitSel === 0.U ){
|
} .elsewhen( isSckPosedgeNext(1) & ~shiftCSn(1) & bitSel === 0.U ){ //CS为低,且SCK上跳补一拍 的第0bit
|
||||||
when( byteSel === 1.U ){
|
when( byteSel === 1.U ){
|
||||||
exReg_100M := upReg(1)
|
exReg_100M := upReg(1)
|
||||||
} .elsewhen( spiCmd === 2.U & byteSel === 2.U ){
|
} .elsewhen( spiCmd === 2.U & byteSel === 2.U ){
|
||||||
@@ -79,7 +79,7 @@ trait BackBoardSpiSlv{ this: BackBoardSlvLocal =>
|
|||||||
} .elsewhen( spiCmd === 0.U & (byteSel =/= 0.U | byteSel =/= 1.U) ){
|
} .elsewhen( spiCmd === 0.U & (byteSel =/= 0.U | byteSel =/= 1.U) ){
|
||||||
exReg_100M := spiRegDown.io.datar
|
exReg_100M := spiRegDown.io.datar
|
||||||
}
|
}
|
||||||
} .elsewhen( isSckPosedge & ~shiftCSn(1) & (byteSel =/= 0.U | byteSel =/= 1.U) ){
|
} .elsewhen( isSckPosedge & ~shiftCSn(1) ){
|
||||||
exReg_100M := Cat( exReg_100M(6 ,0), shiftMOSI(1) )
|
exReg_100M := Cat( exReg_100M(6 ,0), shiftMOSI(1) )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user