elsif (rising_edge(SPI_CLK_GBUF)) then
vShiftCounter <= vShiftCounter + 1;
case vShiftCounter is
when 1 =>
sReadWrite <= SPI_MOSI;
when 2 =>
...
vShiftCounter is changed after rising_edge(SPI_CLK_GBUF) but, "case" is a read statement.
the value it read is still the value before rising_edge(SPI_CLK_GBUF)