# Tiny demo scene ## What this builds A small, original demo that fits in a tight gate budget (around 4k gates, as counted by a documented tool), written in Verilog. A testbench clocks the design and dumps a framebuffer. Golden frames are compared. No FPGA, no board, and no tapeout are required. The art and the music (if any) are original. Read `spekkr.inputs.json` first. `title` may appear on a frame. `width` and `height` size the buffer. `audio` and `scanline` change what is dumped. `sim` is the simulator. ## Out of scope - A real FPGA, a tapeout, or a board in the checks. - A copyrighted demo or a commercial game's art. - A gate-array vendor's licence server. ## Requirements Each requirement has an id. Checks name the id they cover. ### R1. Testbench and goldens - The testbench runs a documented number of frames (for example 4) and writes framebuffer dumps. Frames 0 and N (the last, or a mid frame in the file) match goldens within the tolerance in `design.md`. - If `title` is drawn, the pixels of the title region match a mask or a glyph dump in the file. - Reset is deterministic: two runs hash the same dumps. Accept when: the golden frames match, the title mask matches if used, and two runs hash equal. ### R2. Gate cap and files - A documented count (Yosys or an equivalent, with the script in the repo) reports a gate or cell count at or under 4096, or the bound in the file, for the default size. - Renders: frame 0, frame N, a title-card still, and a small diff view (empty when goldens match). - One command simulates, counts, and writes the dumps and renders. No FPGA. Accept when: the count is under the cap, the command passes for both simulators, and a deliberately large fixture exceeds the cap. ### R3. Inputs - Inputs are read from `spekkr.inputs.json`. Values outside the ranges or choices in `design.md` are refused before a netlist, a board or a testbench is built. - Options turn the optional circuits, ports or features in the Inputs table on or off. Accept when: an illegal input is refused by name, and the default input set produces the measurements in `design.md`. ### R4. Checks and report - One command runs the simulation or the testbench, writes the plots or dumps, and compares them to the numbers in `design.md`. - The command works without a physical board, a lab instrument or a network. Accept when: the command passes at the defaults, and fails if a documented value in the netlist or the ROM is corrupted on purpose. ## Verification A Verilog testbench dumps a framebuffer that matches golden frames. A documented gate-count script stays at or under the cap. Two runs are deterministic. No FPGA, no handheld, and no tapeout are required. ## Definition of done - Every acceptance check above runs from one command, and all pass at the person's inputs. - A README says how to simulate, how the count is taken, and that a tapeout is optional.