Files
CoCo3_Plus_MiSTer/verilator/rtl/coco_sram.v
T
Alan SterembergandClaude Opus 5.5 874f4f3083 Add Verilator simulation (ImGui + headless)
verilator/ runs the core on the host with the shared FM-7 / Apple-IIgs sim
framework: windowed (ImGui/SDL2) or --headless, typing on a frame schedule,
screenshots, text-screen dump, 6809 disassembly trace, floppy/SDC/cart/cassette,
and RS-232 Pak serial debugging (TXD decoder, RXD driver, pty bridge, ACIA
trace) with a minimal DriveWire server and a script to run the real FujiNet
daemon against the sim. See verilator/README.md.

- The VHDL the build uses (ROMs, RAMs, font) is converted to Verilog in
  verilator/rtl/; the VHDL CPU is not instantiated (CoCo3_CYC_ACC_6809).
- sdram2.sv is simulated with its own controller logic and an SDR chip model.
- run_tests.sh: boot, keyboard, disk, WIDTH 80 and HSCREEN tests, judged on
  the text screen and byte-for-byte against test-ref/ screenshots.

rtl/wd1793.sv: spt_addr and buff_wr are declared at module scope instead of
inside generate blocks. They are assigned outside those blocks; Quartus
accepted it, Verilator rejected spt_addr and silently split buff_wr into a
separate net. No change on the FPGA (FM-7 made the same fix).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-02 07:15:44 -04:00

34 lines
1006 B
Verilog

//============================================================================
// Verilog conversions of rtl/sram/*.vhd: synchronous write, asynchronous
// read, matching the VHDL (`DATA_O <= SRAM(ADDR)` outside the process).
//============================================================================
// rtl/sram/coco_ram.vhd -- 64K cassette buffer (R_W low = write)
module COCO_SRAM
(
input CLK,
input [15:0] ADDR,
input R_W,
input [7:0] DATA_I,
output [7:0] DATA_O
);
reg [7:0] SRAM [0:65535];
always @(posedge CLK) if (!R_W) SRAM[ADDR] <= DATA_I;
assign DATA_O = SRAM[ADDR];
endmodule
// rtl/sram/coco_vid_ram_buf.vhd -- 512 x 16 video line buffer
module COCO_VID_RAM_BUF
(
input CLK,
input [8:0] ADDR_I,
input [8:0] ADDR_O,
input WE,
input [15:0] DATA_I,
output [15:0] DATA_O
);
reg [15:0] SRAM [0:511];
always @(posedge CLK) if (WE) SRAM[ADDR_I] <= DATA_I;
assign DATA_O = SRAM[ADDR_O];
endmodule