--- Quote Start ---
I'm actually trying to use the ALTASMI_PARALLEL megafunction to write to my EPCS4 serial mem chip. The signals that the function wants (bulk_erase, write, wren, read, rden) all need to be asserted for just one rising edge of the clock that I'm sending to the function. In the documents they show some waveforms that are changing on the falling edge of the clock.
Of course, I could divide the clock and get more clever about when to change it. Is that perhaps a more correct solution?
--- Quote End ---
I haven't used this IP block, so I can't say for sure, however, using an FPGA clock that is at-least 2x the serial clock is generally a good solution. If you look at the waveforms for the EPCS devices, they are pretty much the same as SPI Flash devices. If you were going to create an SPI controller, you'd code it so that it was internally clocked by the FPGA clock (of say 100MHz), and then use baud-rate logic (control registers plus clock dividers) to program the clock used for the SPI interface.
Read a data sheet for an SPI device, and you'll likely see comments about data being clocked out relative to the falling edge of the
spi clock. This is
not the same as using the falling-edge of the
fpga clk. If the FPGA clock is 2x the SPI clock, then the data is clocked out every second FPGA clock, while the SPI clock is toggled every FPGA clock. There is only ever one FPGA logic clock and the rising-edge of that clock is always used.
I would have thought the ALTASMI_PARALLEL megafunction would have taken care of that for you. However, as I commented, I have not used this IP block. If the IP does not have an Avalon-MM slave interface to it, then its probably old. Someone reading this thread might be able to recommend another IP core for interfacing to the EPCS as an external Flash device.
Cheers,
Dave