m-labs / misoc

The original high performance and small footprint system-on-chip based on Migen™
https://m-labs.hk
Other
306 stars 85 forks source link

added spi 1-bit mode, code from litex #88

Open danielkucera opened 6 years ago

danielkucera commented 6 years ago

as suggested in https://github.com/m-labs/misoc/issues/87

danielkucera commented 6 years ago

There might be but is it worth? This solution is cleaner IMHO.

sbourdeauducq commented 6 years ago

Thanks for submitting this PR. Like @jordens I am concerned about the code duplication. What is this solution cleaner than?

jordens commented 5 years ago

@danielkucera ping

danielkucera commented 5 years ago

@jordens what ping? I don't understand the bitbang code and with bitbang enabled, the code was failing. So I added an assert. Take it, leave it or explain the code.

jordens commented 5 years ago

@danielkucera The line you refer to does exactly what you are doing (take miso for 1-wide SPI) just in bitbang mode. The bigbang code is originally by @fallen but has gone through a few hands.

danielkucera commented 5 years ago

@jordens , I've read it about 50 times but still I don't understand. Moreover I cannot test the code in 2,4-bit mode because I don't have such hardware so I'd rather not do any additional changes to the code.