Re: SPI to I2C Converter
Something to note, SPI and I2C have some subtle differences. SPI is more suited to longer data streams. I2C carries addressing information inherently. I2C is more suited to memory map, register and control accesses. This is not so important for this application but good to remember.
My advice would be to:
1. Instantiate Altera reference design.
2. Test SPI slave first. You can do this by making the SPI master initiate a transaction and firstly probing the hardware signals.
3. Next, probe internally into the FPGA/CPLD (using Signal tap/Chipscope), once again check the SPI lines (SPI_sclk, SPI_cs, etc)
4. Check the command_reg, data_in, data_out and status_reg.
5. Next proceed to the I2C master. Check that command_word takes on the value of command_reg.
6. Check I2C_sda and I2C_scl.
I mostly use VHDL, not Verilog but the design is well commented and easy to follow. Just stick to the steps I have outlined. Don't try and get the entire design working in a single shot but rather verify bit by bit in the hardware if possible.