BrunoLevy / learn-fpga

Learning FPGA, yosys, nextpnr, and RISC-V
BSD 3-Clause "New" or "Revised" License
2.53k stars 242 forks source link

[optimize] can we have a general spi controller #14

Open wuxx opened 3 years ago

wuxx commented 3 years ago

Hi, Bruno, notice that the SSD1351.v SPIFlash.v SDCard.v are actually all spi bus, can we have a general spi controller with CPOL CPHA configable, so that we can drive misc device like difference size spi lcds, sdcard, spi-flash, and other misc devices. I usually use the iCEZ0mb1e to test my misc spi devices before https://github.com/abnoname/iceZ0mb1e/blob/master/rtl/simplespi.v

BrunoLevy commented 3 years ago

Hi @wuxx, great idea ! I'll take a look. Cool, simplespi.v is short (the SPI controllers I found before then where way too long/complicated). When I started last March, I did not know enough to do things properly, but now I think it is doable / integrable in FemtoSOC that is cleaner. I was thinking about replacing my bit-banging the SDCard with a cleaner solution. We just need to take care it still fits in the IceStick because I like to have a super-minimalistic SOC that does animated graphic on the OLED screen from the SPI Flash (but since it will factor hardware between the SPI Flash and OLED screen the total LUT count will probably be lower in the end).