Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
18 years ago

PS Configuration with Commodity Flash

Hi All,

Reading over the configuration documentation it is clear that the least significant bit of every byte must be transfered first during serial configuration. Commodity SPI flash devices, however, transmit data most significant bit first. Even the Altera Configuration Devices appear to work this way. The .RBF file, on the other hand, seems to store the data MSB first from what I have read. I am looking to use a microcontroller with commodity flash to save on costs and the configuration would be greatly slowed down if the microcontroller has to reverse the bit order on the fly. So... I'd like to take care of this in the configuration file itself before it is loaded into flash. Is there a way to reverse the bit order for configuration files in Quartus II or do I have to write my own code to do this? Is there something I'm missing or am I wrong about the .RBF format?

Any help greatly appreciated.

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hello,

    I don't think that there's in option to bitreverse rbf files. If so, they surely wouldn't be named rbf, not to add another level of possible confusion! But to my opinion, configuration can be easily bitreversed on the fly, in effectively "no time" - using a table. I do this since ages for similar problems.

    Regards,

    Frank
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks Frank,

    I am planning on using the SPI flash similar to how it is set up in the configuration documentation for PS configuration. The microcontroller will be driving the clk and address lines of the the serial flash chip and the data out line will feed directly into the FPGA, so the microcontroller will not be able to do anything to the bit stream. Upon reading about the .RBF again, it looks like this file is simply a bit stream and not broken up into bytes. I will just have to be sure it is initially loaded into flash correctly, which I'm going to have to write code for anyway as the Altera flash programmer only works with their chips or CFI flash from what I understand. It's too bad we can't just use commodity SPI flash in place of Altera's EPCS chips (very pricey). I'm going to look a bit more into the HEX and TTF file formats as well as these may be easier to program into the flash initially using the microcontroller. Perhaps this is where your table idea could come in handy.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    If you want to stream the SPI flash output to FPGA in PS mode, then you have to perform the bitreversal during flash programming. Also Nexfflash/Winbond spiflash devices have been working as EPCS compatible replacement in the past, but I don' if they could be used with all Altera FPGA.