Josh’s Status Report (11/21)

This week, I made limited progress on code because I was studying for the 18-740 and 18-755 midterms. However, I placed an order for a retro PC display to give our recreation an appearance closer to the original IBM PC/XT. Next week, I plan to support system integration and end-to-end testing, addressing any CPU issues that appear as the team combines the hardware and software.

Throughout the project, I needed to learn more about 8088 instruction and interrupt behavior, SystemVerilog verification, Quartus compilation and timing analysis, and USB-Blaster/JTAG programming. I learned through Intel and IBM reference manuals, tool documentation, board setup guides, and small experiments. Breaking failures into focused test programs and comparing results against recorded 8088 behavior helped me distinguish CPU bugs from integration problems. This approach let me apply new knowledge immediately and verify my understanding through observable results.

Josh’s Status Report (11/14)

This week I extended the custom 8088 CPU with the known missing instructions needed for DOS executable bring-up. Prince of Persia’s original unpacker now produces the exact independently checked memory image. I also published a staged bring-up plan using an interactive CGA executable as an intermediary. The CPU changes are committed locally; gameplay remains unverified.

Verification and validation

Verification passed 292,392 programs, including 260,000 hardware-reference cases, plus 606 reset cuts and 108 IRQ programs. Existing CPU/software/system regressions also passed. Results are checked against expected registers, defined flags, memory and bus transfers. The offline FPGA diagnostic fits at 22% of ALMs and passes timing; this revision has not been tested physically.

System validation will check executable loading, graphics, keyboard/timer operation, exit and relaunch. We will compare behavior and timing against a reference machine using the team’s proposed input-latency, game-speed and sustained-operation requirements.

Next week I plan to trace the game beyond its unpacker, fix any confirmed CPU gaps and support Govind and Ben’s software/peripheral integration. Most currently identified implementation work is now in their subsystems.

Josh’s Status Report (11/7)

This week, I completed the CPU features needed for our BIOS and DOS demo and pushed the CPU bring-up and verification code. I implemented byte and word arithmetic, logical operations, memory read-modify-write, conditional branches, LOOP, FLAGS controls, shifts, rotates, multiplication and division. I also added LEA, word PUSH/POP memory forms, and LES/LDS for instructions encountered in the compiled software.

I implemented immediate and DX-addressed port I/O, including byte and word IN/OUT operations. Word operations use two byte transfers, and the CPU preserves the port, operand data and flags throughout bus waits. I added MOVS, STOS, LODS, CMPS and SCAS with REP handling, direction control and segment overrides. Repeated string operations retain completed progress so they can resume correctly after an interrupt.

I added software interrupt entry and IRET, including interrupt-vector reads, stack-frame construction and parent-process restoration. Maskable interrupts now support interrupt acknowledgment, STI and segment-load inhibition, HLT wakeup and interruption between REP elements. In simulation, I verified the keyboard IRQ path through the PIC and PPI, ran two interactive HELLO.COM sessions, and checked that both programs exited successfully and returned to the shell. I also verified the actual BIOS, disk loader, compiled C code and DOS process-launch path with an inputless executable.

Verification passed 57,680 arithmetic/FLAGS programs, 86,888 I/O programs, 27,653 string programs, 80,732 software-interrupt programs and 10,226 maskable-interrupt programs. Compiled-C verification passed 258 runs across two compiler configurations and three memory profiles. Tests covered memory stalls, address wrapping, register preservation, divide errors, interrupt return and reset cancellation. After changing division for FPGA timing, I added 33 reset-interruption checks, bringing the arithmetic regression to 51 reset cuts.

I prepared a separate FPGA ROM diagnostic and confirmed its expected LEDs and KEY0 reset behavior on the DE10-Standard. I then integrated my CPU with Ben’s memory/peripheral system and Govind’s software and SDRAM updates for the inputless demo. The system retains the full 640 KiB conventional RAM map in onboard SDRAM, with the BIOS and read-only disk image embedded in the FPGA configuration. I fixed memory-inference problems, incorrect pin-assignment syntax, SDRAM startup initialization and clock constraints. I changed division to run across multiple clock cycles so the CPU could meet the 25 MHz system clock.

The integrated design compiled successfully in Quartus using 5,738 ALMs, or 14% of the device. All four timing corners passed, with minimum setup and hold slack of 2.173 ns and 0.170 ns, no unconstrained paths, and all 82 pin assignments checked. Two complete SDRAM boot/reset simulations passed, each reading 45 sectors, running DEMO.COM, checking zero exit status and reaching the parent success marker. I programmed the integrated demo onto the physical board and observed its VGA output. The remaining display issue is cropping at the left edge, which still needs alignment or scanout investigation.

I updated the architecture, compatibility, interface, toolchain, diagram and test documentation, and prepared repeatable build and programming instructions with pinned image and bitstream hashes. The CPU bring-up work is pushed on my HELLO.COM branch; the latest SDRAM/VGA integration fixes remain local. Remaining work includes resolving the display cropping, repeating the integrated demo’s physical reset and power-cycle checks, and later qualifying keyboard input and the physical microSD storage path.

Josh’s Status Report (10/31)

This week, I connected the CPU to the team’s actual BIOS in simulation using Ben’s memory controller and approved memory map. The CPU starts at FFFF:0000 and executes the BIOS reset jump to F000:E000. I added instruction and bus traces, unsupported-instruction diagnostics, timeout detection and VRAM-write logging so failures identify where execution stopped and what the CPU was doing.

I expanded segment support with ES, segment-register transfers, segment PUSH/POP and segment overrides. I also implemented near and far jumps, making sure far jumps update CS and IP together and discard stale prefetched instructions. The decoder now keeps prefixes, displacements, immediates and far-pointer fields separate, preserving them through stalls and clearing them correctly after redirects and reset.

I added byte MOV instructions, byte and word immediate-to-register/memory forms, and accumulator direct-memory transfers. Byte operations preserve the unaffected register byte and use one bus transaction; words use two. The CPU retains operand width, address and data throughout memory waits, and MOV leaves the arithmetic flags unchanged.

Verification passed 2,826 segment/prefix programs and 10,092 MOV programs, alongside 9,214 MOV decoder checks and 21 reset-interruption cases. An assembled diagnostic checked segment initialization and RAM/VRAM accesses across three configurations. Tests covered register aliases, segment overrides, odd addresses, address wrapping and memory stalls. All previous CPU test targets and Ben’s system regressions also passed.

I updated the design, compatibility, toolchain and test documentation, checked the implementation against Ben’s and Govind’s contracts, and recorded unresolved assumptions. The real BIOS currently stops at the unsupported CLI instruction. Remaining work includes ALU and FLAGS support, port I/O, strings and interrupts before the CPU can complete BIOS initialization and boot HELLO.COM.

Josh’s Status Report 10/24

This week, I expanded the CPU from BX-only memory addressing to all eight 16-bit ModR/M address combinations, plus direct disp16 addresses. Programs can now use forms such as [BX+SI], [BP+DI+disp], and [SI] for word MOV loads and stores.

I added separate base and index selectors and enables to the decoded instruction record. The decoder now handles each form’s displacement, instruction length, and default segment: BP-based addresses use SS, while the other forms use DS. I extended operand collection so the CPU can retain the base, index, and store data using its existing two register-file read ports. Indexed stores use an additional read step before address generation.

I also integrated Ben’s approved memory and bus interfaces. Both sides now compile against one shared bus-command package, and the integration tests use the current CPU source directly. The tests respect his memory map, including separate RAM, VRAM, ROM, and unmapped regions, along with completion timing and reset cancellation.

The new repeatable make addressing test passed 3,120 memory programs and five subroutine demonstrations, checking 6,400 data-byte transactions. It covers every addressing form and data register, positive and negative displacements, odd addresses, both address wraps, memory waits, and decoder stalls. The same matrix also passed against Ben’s actual memory-controller RTL.

The new subroutine demonstration reads stack parameters through BP, accesses an array through indexed DS addressing, and returns using RET 4. It updates the selected array element and restores BP, BX, SI, and the original stack pointer. All twelve existing CPU regression targets and Ben’s Icarus system suite also passed.

I updated the coverage documentation, diagram guide, and test evidence. Next are byte operands, the remaining decoder and ALU operations, and the I/O and interrupt support needed by the BIOS.

Josh’s Status Report 10/10

This week, I took the CPU from register-only programs to reading and writing memory, using a stack, and calling subroutines.

I gave the bus interface unit a second client, so data accesses share the bus with instruction fetch, with data going first when both request. I then added MOV loads and stores with BX-based addressing, a DS register and an address-generation unit. Each 16-bit access is two byte transfers on the 8088’s 8-bit bus, including words that cross a segment boundary or the top of memory.

Next I added the stack: an SS register, PUSH and POP, and near CALL and RET, which redirect instruction fetch like a taken jump. I checked PUSH SP and POP SP, where the 8088 differs from later x86 processors, against 10,000 recorded real-8088 cases each. A second write port for the stack pointer lets each instruction update everything on one clock edge.

Two repeatable demonstrations check registers, memory and every bus transaction under varied memory delays. The second runs two levels of subroutine calls and restores every register, including the stack pointer. Resetting the CPU in the middle of transfers exposed a bug where an interrupted load still wrote its register, which I fixed. The tests also caught all 16 deliberately broken versions of the design.

I also corrected our design report and added a CPU block diagram. Next are the full decoder, the remaining ALU operations, and interrupts, which the BIOS needs.

Josh’s Status Report (10/3)

This week, I took the CPU from a set of separate units to a working processor that fetches programs from memory and executes them, including branches and loops.

I started by defining the CPU side of the bus interface: single-byte transactions, where the CPU holds each request stable until memory signals completion after any number of wait cycles. I drafted these rules for review with Ben and built a simulated memory to stand in for his memory system.

On the CPU side, I implemented the bus interface unit, which captures instruction-fetch requests and returns each byte as memory completes it. In front of it I built a fetch controller with the 8088’s four-byte prefetch queue. It tracks its own fetch position and reserves queue space for requests already in flight, so the queue never overflows. I connected the fetch path to the execution unit in the CPU top level and added an architectural instruction pointer, kept separate from the fetch position, which runs ahead. The instruction pointer advances by each instruction’s length when it completes.

I then added control flow: the short unconditional jump and the conditional jumps JZ and JNZ, which test the zero flag. When a branch is taken, the execution unit sends the target address to the fetch controller, which redirects fetching there. It discards queued bytes and partially decoded instructions from the old path. Memory requests already on the bus can’t be cancelled, so it lets them finish and drops their bytes. A branch that isn’t taken simply continues to the next instruction.

With these pieces in place, the CPU runs a short counting loop loaded from an instruction-memory image at the 8088 reset address. It produces the correct final register values and instruction pointer, regardless of how slowly memory responds. One design observation is that the CPU is currently limited by instruction fetch rather than execution, since the bus delivers one byte every two cycles. That will matter when we tune timing.

I also updated our documentation for the team’s board choice, the Terasic DE10-Standard. Its microSD slot is wired to the ARM processor rather than the FPGA, which affects how we design storage access.

Josh’s Status Report (09/26)

This week, I began RTL implementation of our custom CPU in SystemVerilog, building and verifying the first vertical slice of the datapath. I implemented and tested the general-purpose register file, including byte-register access. I also built an ALU that performs 16-bit ADD and generates all six status flags (carry, parity, auxiliary carry, zero, sign and overflow). It passed over 20,000 directed and reference-model checks. Next, I implemented a decoder subset for MOV r16, imm16 and register-to-register ADD. It consumes instruction bytes through a valid/accept handshake and waits correctly when bytes are unavailable or when execution is not ready. I then built an execution unit that connects the decoder, register file, ALU and writeback through a small instruction controller. The controller retains each instruction’s operation and destination until it finishes. The unit correctly executes a short demonstration program (MOV AX,3; MOV BX,4; ADD AX,BX; ADD AX,AX, leaving AX = 14) and a longer flag-focused program, and it stops safely on unsupported instructions. To check that the tests are meaningful, I injected deliberate bugs into each module and confirmed the testbenches catch them. This also exposed a remaining gap in the execution-unit tests that I will fix. I set up a repeatable local simulation flow with Vivado’s XSim and Make targets for each module, and recorded the test results. I also drafted the CPU-side bus ports (single-byte transactions with explicit completion, plus the interrupt inputs) for review with Ben. The CPU cannot yet fetch instructions from memory, so only these two instruction forms run, fed directly by a testbench. Next week, I plan to review the bus interface draft with Ben. I then plan to build the instruction fetch path (instruction pointer, segment registers, prefetch queue and a minimal bus interface unit) with a simulated memory model, so the CPU can run programs from memory. I will also start extending the decoder and ALU to the full family of arithmetic and logic instructions.

Josh’s Status Report (09/19)

This week, I focused mainly on researching the Intel 8088 specification and creating a block diagram for our custom CPU. I worked through how instruction fetching, decoding, operand reads, address generation, execution, and writeback connect, using an ADD instruction as a concrete example. I also studied how the bus interface unit shares memory access between instruction fetching and execution, along with how interrupts save processor state and redirect execution to a handler. While reviewing the diagram, I corrected inconsistencies in instruction decoding and address calculations and added missing data paths and control logic. This work helped me break the CPU into manageable components and better understand their interfaces before beginning RTL implementation. Next week, I plan to refine the control sequences and coordinate with Ben on the CPU bus interface so that our CPU and memory subsystem designs agree on how requests and responses are handled.