This week I worked with the rest of the team to design the datapath for the CPU (which can be found in the team’s status update for the week). Our original CPU design was a two stage pipeline where stage 1 was fetch/decode/execute, and stage 2 was memory. When we learned that all memory accesses use the same memory, we had to rearrange our pipeline. Once done, we were able to add the needed components and connections to match the timing of the Game Boy.
Afterwards, Adolfo and I worked on determining a way to handle multi-cycle instructions. For Game Boy architecture, only 8-bits are sent at a time. Therefore, for multi-cycle instructions, we are continuously receiving new information that is needed for one instruction. To handle this, we decided to use an FSM that would save state for the datapath so it would know which instruction we were handling at all times. The idea is that the FSM will be located in the fetch/decode stage. In the cases of single cycle instruction, it would only enable the pipeline register. In all other cases, it would essentially take the place of the decoder and send the needed control signals. After designing the one large FSM, we realized that it would be cleaner and easier to debug if we had multiple smaller FSMs to handle each category of multi-cycle instructions. We currently have 7 FSMs.
On my audio work, I was researching the different ways we could get audio from the FPGA to a speaker. The first was to use the on-board CODEC that would allow us to directly insert a connection between the board and a speaker. The issue is that the CODEC is dependent on the I2C protocol, which would take significant research, implementation, and testing to assure it is correct on top of the Game Boy audio itself. The alternative is to use a DAC to convert signals for us. This is the more straightforward option because there is no protocol. I have found two DACs that we can potentially use: Monolithic 16-bit DACPORT AD669 and PCM2704CDB. I will continue to look at their data sheets and consult a TA before making a final decision.
Action items for next report:
- Finish FSMs for CPU
- Finalize which DAC we will be using
- Draft an audio datapath