You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears this code can only send a single byte without raising and re-asserting CSEL. It is pretty common in a SPI interface to send multiple bytes per transaction for as long as the controller holds CSEL low.
Currently, the while loop is exited while, but it then has a wait until CSEL = '0'
which requires an event on CSEL to re-enter and send more data. This line should probably be:
if CSEL = '1' then wait until CSEL = '0' end if;
but with this, you will need to somehow catch when CSEL rises to 1 if the transaction is actually ended at the end of the current byte.
You could probably do this with the following code:
if CSEL ='1'thenwaituntil CSEL ='0';
bitIdx := TxData'high;
endif;
if OptSpiMode =0or OptSpiMode =3thenwaituntilfalling_edge(SCLK) or CSEL ='1';
elsewaituntilrising_edge(SCLK) or CSEL ='1';
endif;
if CSEL ='1'thennext;
endif;
if bitindex = TxData'highthenifnot Empty(TransmitFifo) then
TxData := Pop(TransmitFifo);
else
TxData := (others=>'X'); -- X would be better here IMO to differentiate from actual data transmissionendif;
endif;
while CSEL ='0'and BitIdx >=0loop
POCI <= TxData(BitIdx) when OptSpiMode =0or OptSpiMode =2;
if OptSpiMode =0or OptSpiMode =3thenwaituntilfalling_edge(SCLK);
elsewaituntilrising_edge(SCLK);
endif;
POCI <= TxData(BitIdx) when OptSpiMode =1or OptSpiMode =3;
BitIdx := BitIdx -1;
endloop;
bitIdx := TxData'highwhen bitIdx <0;
The text was updated successfully, but these errors were encountered:
I just merged a pull request that purports to add bursting to the SPI VC. It looked like it may address this. I will have to look at it when I get a chance.
There are many things in the VC that do not take advantage of newer OSVVM capabilities.
In the future, can you file these against the submodule directly.
Looking at the code in
SpiPeripheral
: https://github.com/OSVVM/SPI_GuyEschemann/blob/77d1e30c494d0e6032918cde70c179a5b575976a/src/SpiPeripheral.vhd#L267It appears this code can only send a single byte without raising and re-asserting
CSEL
. It is pretty common in a SPI interface to send multiple bytes per transaction for as long as the controller holdsCSEL
low.Currently, the
while
loop is exited while, but it then has await until CSEL = '0'
which requires an event on CSEL to re-enter and send more data. This line should probably be:
if CSEL = '1' then wait until CSEL = '0' end if;
but with this, you will need to somehow catch when CSEL rises to 1 if the transaction is actually ended at the end of the current byte.
You could probably do this with the following code:
The text was updated successfully, but these errors were encountered: