I’ve been working on hi-res graphics still this week. The system is quite complicated, so some simplifications are being made for final demo. I originally wanted to replicate the NTSC color blending, but this proves to be quite hard to do on the FPGA due to the math operations involved, especially with the time left. I instead am implementing just the standard 6-color hi-res graphics mode. Oregon Trail only uses these colors, which is what we would like to use for demo, so the simplification should be fine for our use case.
Rudy’s Status Report 4/18
This week I experimented with audio on the FPGA. My initial expectation was to instantiate IP for the DE2-115, but since the original Apple II’s audio output relied on manually toggling a register to create a PWM output, we realized that we could just connect a speaker to a GPIO pin directly. This produced some standalone results, but further testing has to be done with an actual Apple II program. I’ve been running into numerous synthesis issues with GPIO unfortunately and am working to resolve them.
Rudy’s Status Report 4/4
This week we had the interim demo, which went pretty smoothly. The 6502 worked perfectly with the original Apple II ROMs and required no internal modifications during integration and synthesis. I am still on schedule. Next steps include implementing BCD mode for the 6502, which is unnecessary for our purposes and not really a priority. Besides that, I intend to help out with the implementation of high-resolution graphics and audio for the Apple II, which we were originally going to omit. Audio seems reasonable when using the Verilog from the DE2-115 documentation for the audio codec. High-resolution graphics poses more of a problem since only 6 colors were actually supported by Apple II programs when examining the software, but 16 colors are actually possible and were used due to color blending on monitors at the time. I’m currently conduction research on this to see how to replicate the effect in a digital manner.
Rudy’s Status Reports 2/28
This week I completed testing of the 6502 by testing against the standard Klaus6502 test program. This program tests all instructions for correct behavior, including flag setting. A few modifications to my original system diagram occurred, primarily with adding a few additional control signals. The most significant one was the need to create an is_BRANCH signal for the ALU so that it sign-extends the offset being added to the PC. This was an oversight on my part since only the PC needs its second operand to be sign-extended, as it is the only 16-bit operation that our ALU performs.
After testing in simulation, I synthesized the core with BRAM initialized to the same program. The program executed as expected and for the correct amount of time. Integration is now occurring with Will’s peripheral modules and Aaron’s software.
We are on schedule, with integration going much smoother than expected.
Rudy’s Status Report 3/21
Revisions to the 6502 have continued to be made throughout its development this week. The original design used a “timing state generator” that described the current cycle of the instruction, alongside the instruction itself to form a state machine. This translates to rather ugly Verilog, so we’ve instead switched to a FSM for each possible state. This is 135 states, which is certainly still ugly, but allows for much easier debugging and understanding of the design when used alongside the design documents I’ve created.
In addition to this, I have changed our Absolute, X addressed microinstructions to work with Will’s FDD module. The original Disk Drive used the fact that the address was valid on the line for multiple cycles to drive its own state machine, but I removed this side-effect when writing the microinstructions. This and holding the data on the line for an additional cycle were added. In general, progress is continuing on and debugging is occurring.
Rudy’s Status Report for 3/14
This week has been working on the 6502 still. I’m currently in the process of getting the open-source test suite working with the Verilog 6502’s interface. I’ve also been doing more research on the graphics modes, which seem like the biggest hurdle after this. For MVP, I think that just implementing low-resolution graphics mode seems reasonable. It is fairly straightforward, while high-resolution graphics is pretty complex to implement exactly as it was done in the past. While it is well-documented, there are many quirks in its implementation that I can foresee being hard to debug.
Rudy’s Status Report 2/28
The only thing of note here is that progress is now occurring for the Verilog implementation of the 6502. The microinstructions and diagram were fully flushed out and are now being translated into Verilog. Currently this is eating into the MMU time, so I am behind, but the MMU implementation is expected to be easier than initially anticipated since it is basically just MMIO. Below is the diagram with control signals labelled:

Rudy’s Status Report 2/21
This is the last week on schedule for the 6502 redesign. So far, things seem to still be on schedule and I expect to finish the redesign by Sunday evening. While I thought I was done with the microinstructions last week, upon listing out all of the register transfers I realized that things were very unoptimized, leading me to go back and redo quite a few of them. I expect to have much more utilization of the ALU for each instruction as a whole now, while also reducing the sizes of the muxes for each register’s input. The expectation is that this will smoothly translate into Verilog, then pass the test suite we’ve found for 6502 implementations.
Rudy’s Status Report for 2/14
This week I continued on with research on the 6502. After last week’s discussion, I set out to make a document with microinstructions of each valid instruction + addressing mode combo. This is almost done, with just two instructions left to go now. After this, the processor diagram will be drawn up and there will be much more to start coding with. These are my future goals for this week.
BRK and RTI were really odd cases when drafting up microinstructions. It turns out that documentation does not describe all behavior of the instruction, so I went down a rabbit hole googling and using a cycle-accurate representation of the 6502 to figure out behavior of the BREAK flag in these instructions. I eventually found out that there is no real BREAK flag in the P register. It is almost always set to 1 since PLP and RTI both set the B flag no what processor status they pull off of the stack. So determination of an interrupt being software or hardware based can only be found through bit testing of the value off of the stack, not the value in the P register.
Schedule-wise we are doing fine since we still have a week for the 6502, but I personally wanted to be a bit more ahead with my portion by this time. I intend to work more this weekend to try and meet these personal goals.
Rudy’s Status Report for 2/7
On my end, this week consisted of research about the ISA and internal architecture of the 6502. Quite a few interesting things popped up during this research:
ISA-wise:
- Clock cycles are listed alongside each instruction, indicating that instruction timing is part of the ISA. This means that the implementation must be cycle accurate if we wish to run old, arbitrary programs.
- 13 addressing modes, one of which is “implicit” and is specific to each instruction of that addressing mode type.
- 56 instructions, plus some undefined instructions that were used by some programmers. We will not be supporting these.
Architecture-wise: (Referencing Donald Hanson’s 1979 DiagramĀ here)
- Used two clocks, phase-shifted such that operations were functionally occurring on the rising and falling edge of a single 1.023 MHz clock. Meaning that 2 micro-operations could occur in each clock cycle.
- Poses a problem because FPGA architecture is generally not receptive to operating on both the rising and falling edge of a clock in a single logic element.
- Could mitigate by simply doubling the frequency and then implement based off of the block diagram. Not a viable solution though due to the other complications.
- Latches were often used, some are referred to as “registers” in the diagram such as the A, B, and ADD “registers.”
- Again, poses a problem because FPGA architecture is not really receptive to latches. Their behavior is not as predictable as a register since they are just implemented as a feedback loop between 2 LUTs.
- Asynchronous memory was assumed. Waveforms indicate that in the same cycle an address was presented, data from memory would become available in the data latch.
- Again, poses a problem because FPGA BRAM does not function like this. Data becomes available on the cycle after an address was presented.
- Otherwise, somewhat straightforward for the time period. Just oddities like a BCD addition mode, and an extra cycle when crossing page boundaries due to using 8-bit adders for a 16-bit address.
Considering the 3-week timeline for the 6502, we are staying on track. I met with Aaron after conducting all of this research to make decisions regarding the inevitable redesign. This is discussed in the team status report for this week.
