Skip navigation
A whole CPU, designed by Fable 5.2 from 147 lines of code.
0:00 / 1:04

A whole CPU, designed by Fable 5.2 from 147 lines of code.

Rina

@irinatoxi3.7K followers

Visit on X
674 likesDownloadOriginal post

52,567 views

A whole CPU, designed by Fable 5.2 from 147 lines of code. It started with 147 lines of code that describe a CPU, and those turned into 6,258 logic gates and 1,023 memory cells. The chip was then checked against a reference model on 242,400 random instructions, with zero mismatches. Then it placed all 7,281 cells across the chip and drew the wiring, which came out 5.5 times shorter than a random layout. When it powers on, every single gate is simulated on every clock tick, and the processor prints text on its own and runs Game of Life on a tiny 32×32 screen. 300 generations later, still zero mismatches. It’s never been printed in real silicon, but the design holds up down to the last gate.

28 Comments

Comments from the original post on X (Twitter)

  • Tyler Giacoma's profile picture

    @TylerGiacoma

    What’s crazy is how quickly hardware advancements are about to be…. People will legitimately be 3D printing their entire robots and using open source models to run them locally 🤯 Things are about to get wild

    10 likes

  • Rina's profile picture

    @irinatoxi

    Still early though, this one is a tiny CPU that only runs in simulation. But a year ago I couldn’t have made even that.

    4 likes

  • Petros's profile picture

    @phobiaphilia

    Calling both an in-order scalar processor and a modern out-of-order superscalar processor just a "CPU" is misleading... Actually this one is closer to a microcontroller than a typical CPU :(

    9 likes

  • Ilnur's profile picture

    @I1nurSu

    >It started with 147 lines of code that describe a CPU, and those turned into 6,258 logic gates and 1,023 memory cells. Verilog has been around for decades already.

    5 likes

  • Steven Cheng's profile picture

    @stevencheng

    Zero mismatches on 242k instructions is wild.

    4 likes

  • Alfredo Canziani's profile picture

    @alfcnz

    Cool! I may try to get it running on my FPGA! At the moment I was planning to just try an 8080. But, hey, Fable's design is more than welcome! 😀 Not sure why you added music to your video. It's distracting.

    3 likes

  • Rina's profile picture

    @irinatoxi

    Thanks! It was built and tested only in simulation, and it assumes memory that answers instantly, which most FPGAs don’t have without changes. The 8080 is probably the more fun project for now. Would love to see that one!

    1 like

  • Alfredo Canziani's profile picture

    @alfcnz

    You can see a few tweets on my profile and the repo with all lessons is on GitHub! 🤓🤓🤓

  • Ethan Codewell's profile picture

    @buildsmrtr

    Takes me back to my VLSI labs. A full semester to get a single-cycle core through synthesis, and timing closure failed half the class. A model going straight to a clean netlist saves a semester. Would love to see this on an open PDK shuttle.

    3 likes

  • what257's profile picture

    @bar96169

    Are the reference model and test harness public? I’d love to see the edge cases alongside the random instructions. Tiny CPU, potentially very creative bugs 😅

    3 likes

  • virajitgp💽's profile picture

    @virajitgp

    you generated 147 lines of hdl code, the rest was done by compilers and interpreters, the pnr is also not a big deal there is enough oss tooling alr

    2 likes

  • AI Quanting's profile picture

    @AIQuanting

    Gates plus memory cells add up to the 7,281, nice. The number I would push on is wiring 5.5 times shorter than random. Random placement is about the easiest baseline there is. Did they compare it to an actual place and route tool?

    2 likes

  • nker's profile picture

    @nker212223

    想问一下你这个是什么软件?

    2 likes

  • Kenyoyo27's profile picture

    @pokygonguy

    In digital land yes , in real world with heat and entropy , no.

    1 like

  • MerlincsYin's profile picture

    @MerlincsZeroYin

    The chip design field will gradually be cracked by AI too. The more chip engineers use AI, the stronger AI’s chip-related capabilities become. The formerly closed-source chip world is slowly following the path that software development took.

    1 like

  • zbt3sup's profile picture

    @zbt3sup1

    6k gates is essentially non existent. This is not the accomplishment your first sentence misleadingly conveys.

    1 like

  • Don Brubaker's profile picture

    @DBru42

    Makes me wonder if in the future there will be software designed CPUs like there is software designed radio.

    1 like

  • HUMAN_BOT's profile picture

    @1day1money

    @grok intel이 커스텀 칩보다 나은점은? 혹시 없다고해도 특허로 보호받을수 있나?

  • CompilingThings's profile picture

    @Compilethings

    He cooks hard, I will let him check some pcb, tomorrow.

  • Stanislav Sorokin's profile picture

    @stas_sorokin_

    147 lines turning into 6,258 gates and getting checked against a reference model is the part that sells it, a lot of generated hardware never gets that far. Do you run the reference model in your own flow, or only for demos like this one?