FPGARelated.com

Homebrew CPUs: Messing around with a J1

Victor YurkovskyVictor Yurkovsky May 29, 2015

Victor Yurkovsky takes James Bowman's compact J1 stack CPU and starts hacking: he trims the ALU, replaces the barrel shifter with simpler shifts, and experiments with dual stacks and memory/IO feeding directly into the ALU. The article walks through small, practical changes that cut logic, add instructions, and boost timing on Spartan-6. It's a hands-on tour that shows how approachable homebrew CPUs can be.


PC and SP for a small CPU

Victor YurkovskyVictor Yurkovsky July 23, 2013

Victor Yurkovsky walks through a compact stack-based CPU idea that tosses the conventional PC register in favor of a return stack living in Xilinx distributed RAM. The clever twist uses the stack memory addressed by SP as the program counter, making calls trivial and keeping the design tiny. The article shows the Verilog stack module and explains the practical tradeoffs of isolating the return stack.


PicoBlaze - Program RAM Access for an Interactive Monitor

Victor YurkovskyVictor Yurkovsky June 14, 20132 comments

You can give PicoBlaze a live interactive monitor without reconfiguring the FPGA. Victor Yurkovsky walks through using the BRAM's unused port by replacing the assembler template with a dual-ported RAMB16_S18_S18 and exposing maddr, mfromram, mtoram and mwr ports. The post includes IO decoding and a PicoBlaze assembly test to read, write and increment program memory over a serial link.


StrangeCPU #4. Microcode

Victor YurkovskyVictor Yurkovsky May 13, 20137 comments

Victor Yurkovsky shows how a sliding-window opcode scheme turns tiny 8–9 bit tokens into wide microinstructions on an FPGA, letting you pack rich behavior into compact code. The post explains visibility ranges, instruction-data representation, and a low-cost way to add a Red-program counter so runs of microcode execute efficiently with minimal hardware overhead.


StrangeCPU #3. Instruction Slides - The Strangest CPU Yet!

Victor YurkovskyVictor Yurkovsky March 18, 201311 comments

Victor Yurkovsky extends his sliding-window token machine idea to instruction decoding, showing how 8/9-bit tokens can index shared "Blue" memory as 32-bit literals, call targets, or decoded instructions. The approach makes instructions dynamic entries that slide with the window, enabling rare opcodes to be synthesized on demand and reducing fixed opcode bloat. He also covers the 0-bit window (the stack), FPGA BRAM tagging, and the latency trade-offs.


StrangeCPU #2. Sliding Window Token Machines

Victor YurkovskyVictor Yurkovsky March 5, 201313 comments

Victor Yurkovsky walks through a surprising CPU design that expands tiny 8/9-bit tokens into full 32-bit call targets using a sliding-window pointer table. The article explains the red/blue memory model, compilation tradeoffs like table overrun and under-run, literal factoring, FPGA scaling, and even includes an ARM Cortex-M implementation snippet to show how the interpreter works in practice.


StrangeCPU #1. A new CPU

Victor YurkovskyVictor Yurkovsky February 24, 20136 comments

This post rethinks call instructions by factoring call targets out of every callsite and replacing them with tiny tokens. Victor Yurkovsky introduces StrangeCPU, a bytecode CPU that uses 8-bit tokens plus a static sliding-window token table to give byte-long calls full 32-bit reach while dramatically reducing code size. The article includes rationale, tradeoffs, a simple proof-of-concept x86 interpreter, and the basic lookup equation for hardware implementation.


Designing a FPGA Micro Pt2 - Clock and Counter build and test.

Paul J ClarkePaul J Clarke June 26, 20121 comment

Paul J Clarke continues building his PIC12F509-style soft core by implementing the clock and program counter. He walks through a simple clock_gen.vhd that rotates a four-bit shift register to produce Q1 to Q4 phases, wires it into monpjc_pic_core.vhd for a XuLA target, and adds a 12-bit integer pc_counter that increments on Q1. The post shows simulation testbench results and previews stack and memory work next.


Designing a FPGA Micro Pt1 - Start The Clock

Paul J ClarkePaul J Clarke May 22, 2012

Paul J Clarke takes on cloning a Microchip PIC12F509 inside an FPGA, picking it for its tiny, well-documented architecture. He outlines the core pieces you'll need: 1024×12-bit ROM, 41 bytes of RAM, an ALU, status register, program counter with a two-level stack, GPIO, and the PIC's unusual four-phase internal clock. This post sets the plan and previews the next installment with the first implementation work.


StrangeCPU #1. A new CPU

Victor YurkovskyVictor Yurkovsky February 24, 20136 comments

This post rethinks call instructions by factoring call targets out of every callsite and replacing them with tiny tokens. Victor Yurkovsky introduces StrangeCPU, a bytecode CPU that uses 8-bit tokens plus a static sliding-window token table to give byte-long calls full 32-bit reach while dramatically reducing code size. The article includes rationale, tradeoffs, a simple proof-of-concept x86 interpreter, and the basic lookup equation for hardware implementation.


StrangeCPU #2. Sliding Window Token Machines

Victor YurkovskyVictor Yurkovsky March 5, 201313 comments

Victor Yurkovsky walks through a surprising CPU design that expands tiny 8/9-bit tokens into full 32-bit call targets using a sliding-window pointer table. The article explains the red/blue memory model, compilation tradeoffs like table overrun and under-run, literal factoring, FPGA scaling, and even includes an ARM Cortex-M implementation snippet to show how the interpreter works in practice.


Homebrew CPUs: Messing around with a J1

Victor YurkovskyVictor Yurkovsky May 29, 2015

Victor Yurkovsky takes James Bowman's compact J1 stack CPU and starts hacking: he trims the ALU, replaces the barrel shifter with simpler shifts, and experiments with dual stacks and memory/IO feeding directly into the ALU. The article walks through small, practical changes that cut logic, add instructions, and boost timing on Spartan-6. It's a hands-on tour that shows how approachable homebrew CPUs can be.


StrangeCPU #3. Instruction Slides - The Strangest CPU Yet!

Victor YurkovskyVictor Yurkovsky March 18, 201311 comments

Victor Yurkovsky extends his sliding-window token machine idea to instruction decoding, showing how 8/9-bit tokens can index shared "Blue" memory as 32-bit literals, call targets, or decoded instructions. The approach makes instructions dynamic entries that slide with the window, enabling rare opcodes to be synthesized on demand and reducing fixed opcode bloat. He also covers the 0-bit window (the stack), FPGA BRAM tagging, and the latency trade-offs.


PC and SP for a small CPU

Victor YurkovskyVictor Yurkovsky July 23, 2013

Victor Yurkovsky walks through a compact stack-based CPU idea that tosses the conventional PC register in favor of a return stack living in Xilinx distributed RAM. The clever twist uses the stack memory addressed by SP as the program counter, making calls trivial and keeping the design tiny. The article shows the Verilog stack module and explains the practical tradeoffs of isolating the return stack.


StrangeCPU #4. Microcode

Victor YurkovskyVictor Yurkovsky May 13, 20137 comments

Victor Yurkovsky shows how a sliding-window opcode scheme turns tiny 8–9 bit tokens into wide microinstructions on an FPGA, letting you pack rich behavior into compact code. The post explains visibility ranges, instruction-data representation, and a low-cost way to add a Red-program counter so runs of microcode execute efficiently with minimal hardware overhead.


PicoBlaze - Program RAM Access for an Interactive Monitor

Victor YurkovskyVictor Yurkovsky June 14, 20132 comments

You can give PicoBlaze a live interactive monitor without reconfiguring the FPGA. Victor Yurkovsky walks through using the BRAM's unused port by replacing the assembler template with a dual-ported RAMB16_S18_S18 and exposing maddr, mfromram, mtoram and mwr ports. The post includes IO decoding and a PicoBlaze assembly test to read, write and increment program memory over a serial link.


Designing a FPGA Micro Pt1 - Start The Clock

Paul J ClarkePaul J Clarke May 22, 2012

Paul J Clarke takes on cloning a Microchip PIC12F509 inside an FPGA, picking it for its tiny, well-documented architecture. He outlines the core pieces you'll need: 1024×12-bit ROM, 41 bytes of RAM, an ALU, status register, program counter with a two-level stack, GPIO, and the PIC's unusual four-phase internal clock. This post sets the plan and previews the next installment with the first implementation work.


Designing a FPGA Micro Pt2 - Clock and Counter build and test.

Paul J ClarkePaul J Clarke June 26, 20121 comment

Paul J Clarke continues building his PIC12F509-style soft core by implementing the clock and program counter. He walks through a simple clock_gen.vhd that rotates a four-bit shift register to produce Q1 to Q4 phases, wires it into monpjc_pic_core.vhd for a XuLA target, and adds a 12-bit integer pc_counter that increments on Q1. The post shows simulation testbench results and previews stack and memory work next.