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]>
This commit is contained in:
1 parent
aae1ceabf1
commit
874f4f3083
79 files changed
+81058
-2
No files matched your search
@@ -0,0 +1,27 @@
|
||||
//============================================================================
|
||||
// Simulation stand-in for rtl/VDAC.v (an altsyncram megafunction).
|
||||
//
|
||||
// Same ports and the configuration the megafunction declares: DUAL_PORT,
|
||||
// 256 x 16, write on wrclock, address AND output registered on rdclock
|
||||
// (address_reg_b = outdata_reg_b = CLOCK1), so q lags rdaddress by two
|
||||
// rdclock edges. Preloaded from rtl/VDAC.mif via verilator/rtl/vdac.mem.
|
||||
//============================================================================
|
||||
module VDAC
|
||||
(
|
||||
input [15:0] data,
|
||||
input [7:0] rdaddress,
|
||||
input rdclock,
|
||||
input [7:0] wraddress,
|
||||
input wrclock,
|
||||
input wren,
|
||||
output reg [15:0] q
|
||||
);
|
||||
reg [15:0] mem [0:255];
|
||||
reg [7:0] rd_a;
|
||||
initial $readmemh("rtl/vdac.mem", mem);
|
||||
always @(posedge wrclock) if (wren) mem[wraddress] <= data;
|
||||
always @(posedge rdclock) begin
|
||||
rd_a <= rdaddress;
|
||||
q <= mem[rd_a];
|
||||
end
|
||||
endmodule
|
||||
@@ -0,0 +1,256 @@
|
||||
1C 22 20 20 20 22 1C 08 00 00 00 00 00 00 00 00
|
||||
22 00 22 22 22 26 1A 00 00 00 00 00 00 00 00 00
|
||||
04 08 1C 22 3E 20 1C 00 00 00 00 00 00 00 00 00
|
||||
08 14 1C 02 1E 22 1E 00 00 00 00 00 00 00 00 00
|
||||
14 00 1C 02 1E 22 1E 00 00 00 00 00 00 00 00 00
|
||||
10 08 1C 02 1E 22 1E 00 00 00 00 00 00 00 00 00
|
||||
08 00 1C 02 1E 22 1E 00 00 00 00 00 00 00 00 00
|
||||
00 00 1C 22 20 22 1C 08 00 00 00 00 00 00 00 00
|
||||
08 14 1C 22 3E 20 1C 00 00 00 00 00 00 00 00 00
|
||||
14 00 1C 22 3E 20 1C 00 00 00 00 00 00 00 00 00
|
||||
10 08 1C 22 3E 20 1C 00 00 00 00 00 00 00 00 00
|
||||
14 00 18 08 08 08 1C 00 00 00 00 00 00 00 00 00
|
||||
08 14 00 18 08 08 1C 00 00 00 00 00 00 00 00 00
|
||||
00 0C 12 1C 12 12 1C 20 00 00 00 00 00 00 00 00
|
||||
22 08 14 22 3E 22 22 00 00 00 00 00 00 00 00 00
|
||||
08 08 14 22 3E 22 22 00 00 00 00 00 00 00 00 00
|
||||
04 08 1C 22 22 22 1C 00 00 00 00 00 00 00 00 00
|
||||
00 00 34 0A 1E 28 1E 00 00 00 00 00 00 00 00 00
|
||||
1E 28 28 3C 28 28 2C 00 00 00 00 00 00 00 00 00
|
||||
08 14 1C 22 22 22 1C 00 00 00 00 00 00 00 00 00
|
||||
14 00 1C 22 22 22 1C 00 00 00 00 00 00 00 00 00
|
||||
00 00 1C 26 2E 32 1C 00 00 00 00 00 00 00 00 00
|
||||
08 14 00 22 22 26 1A 00 00 00 00 00 00 00 00 00
|
||||
10 08 22 22 22 26 1A 00 00 00 00 00 00 00 00 00
|
||||
1C 26 2A 2A 2A 32 1C 00 00 00 00 00 00 00 00 00
|
||||
22 1C 22 22 22 22 1C 00 00 00 00 00 00 00 00 00
|
||||
14 22 22 22 22 22 1C 00 00 00 00 00 00 00 00 00
|
||||
1C 20 1C 22 1C 02 1C 00 00 00 00 00 00 00 00 00
|
||||
04 0A 08 1C 08 0A 3C 00 00 00 00 00 00 00 00 00
|
||||
08 08 3E 08 08 00 3E 00 00 00 00 00 00 00 00 00
|
||||
04 0A 04 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
04 0A 08 1C 08 08 28 10 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
08 08 08 08 08 00 08 00 00 00 00 00 00 00 00 00
|
||||
14 14 14 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
14 14 3E 14 3E 14 14 00 00 00 00 00 00 00 00 00
|
||||
08 1E 28 1C 0A 3C 08 00 00 00 00 00 00 00 00 00
|
||||
32 32 04 08 10 26 26 00 00 00 00 00 00 00 00 00
|
||||
10 28 28 10 2A 24 1A 00 00 00 00 00 00 00 00 00
|
||||
08 08 10 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
08 10 20 20 20 10 08 00 00 00 00 00 00 00 00 00
|
||||
08 04 02 02 02 04 08 00 00 00 00 00 00 00 00 00
|
||||
00 08 2A 1C 1C 2A 08 00 00 00 00 00 00 00 00 00
|
||||
00 08 08 3E 08 08 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 08 08 10 00 00 00 00 00 00 00 00
|
||||
00 00 00 3E 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 08 00 00 00 00 00 00 00 00 00
|
||||
00 02 04 08 10 20 00 00 00 00 00 00 00 00 00 00
|
||||
1C 22 26 2A 32 22 1C 00 00 00 00 00 00 00 00 00
|
||||
08 18 08 08 08 08 1C 00 00 00 00 00 00 00 00 00
|
||||
1C 22 02 1C 20 20 3E 00 00 00 00 00 00 00 00 00
|
||||
1C 22 02 04 02 22 1C 00 00 00 00 00 00 00 00 00
|
||||
04 0C 14 24 3E 04 04 00 00 00 00 00 00 00 00 00
|
||||
3E 20 3C 02 02 02 3C 00 00 00 00 00 00 00 00 00
|
||||
1C 20 20 3C 22 22 1C 00 00 00 00 00 00 00 00 00
|
||||
3E 02 04 08 10 20 20 00 00 00 00 00 00 00 00 00
|
||||
1C 22 22 1C 22 22 1C 00 00 00 00 00 00 00 00 00
|
||||
1C 22 22 1E 02 02 1C 00 00 00 00 00 00 00 00 00
|
||||
00 00 08 00 00 08 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 08 00 00 08 08 10 00 00 00 00 00 00 00 00
|
||||
04 08 10 20 10 08 04 00 00 00 00 00 00 00 00 00
|
||||
00 00 3E 00 3E 00 00 00 00 00 00 00 00 00 00 00
|
||||
10 08 04 02 04 08 10 00 00 00 00 00 00 00 00 00
|
||||
1C 22 02 04 08 00 08 00 00 00 00 00 00 00 00 00
|
||||
1C 22 02 1A 2A 2A 1C 00 00 00 00 00 00 00 00 00
|
||||
08 14 22 22 3E 22 22 00 00 00 00 00 00 00 00 00
|
||||
3C 12 12 1C 12 12 3C 00 00 00 00 00 00 00 00 00
|
||||
1C 22 20 20 20 22 1C 00 00 00 00 00 00 00 00 00
|
||||
3C 12 12 12 12 12 3C 00 00 00 00 00 00 00 00 00
|
||||
3E 20 20 3C 20 20 3E 00 00 00 00 00 00 00 00 00
|
||||
3E 20 20 3C 20 20 20 00 00 00 00 00 00 00 00 00
|
||||
1E 20 20 26 22 22 1C 00 00 00 00 00 00 00 00 00
|
||||
22 22 22 3E 22 22 22 00 00 00 00 00 00 00 00 00
|
||||
1C 08 08 08 08 08 1C 00 00 00 00 00 00 00 00 00
|
||||
02 02 02 02 22 22 1C 00 00 00 00 00 00 00 00 00
|
||||
22 24 28 30 28 24 22 00 00 00 00 00 00 00 00 00
|
||||
20 20 20 20 20 20 3E 00 00 00 00 00 00 00 00 00
|
||||
22 36 2A 2A 22 22 22 00 00 00 00 00 00 00 00 00
|
||||
22 32 2A 26 22 22 22 00 00 00 00 00 00 00 00 00
|
||||
1C 22 22 22 22 22 1C 00 00 00 00 00 00 00 00 00
|
||||
3C 22 22 3C 20 20 20 00 00 00 00 00 00 00 00 00
|
||||
1C 22 22 22 2A 24 1A 00 00 00 00 00 00 00 00 00
|
||||
3C 22 22 3C 28 24 22 00 00 00 00 00 00 00 00 00
|
||||
1C 22 10 08 04 22 1C 00 00 00 00 00 00 00 00 00
|
||||
3E 08 08 08 08 08 08 00 00 00 00 00 00 00 00 00
|
||||
22 22 22 22 22 22 1C 00 00 00 00 00 00 00 00 00
|
||||
22 22 22 14 14 08 08 00 00 00 00 00 00 00 00 00
|
||||
22 22 22 2A 2A 36 22 00 00 00 00 00 00 00 00 00
|
||||
22 22 14 08 14 22 22 00 00 00 00 00 00 00 00 00
|
||||
22 22 14 08 08 08 08 00 00 00 00 00 00 00 00 00
|
||||
3E 02 04 08 10 20 3E 00 00 00 00 00 00 00 00 00
|
||||
38 20 20 20 20 20 38 00 00 00 00 00 00 00 00 00
|
||||
20 20 10 08 04 02 02 00 00 00 00 00 00 00 00 00
|
||||
0E 02 02 02 02 02 0E 00 00 00 00 00 00 00 00 00
|
||||
08 1C 2A 08 08 08 08 00 00 00 00 00 00 00 00 00
|
||||
00 08 10 3E 10 08 00 00 00 00 00 00 00 00 00 00
|
||||
08 14 22 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 1C 02 1E 22 1E 00 00 00 00 00 00 00 00 00
|
||||
20 20 2C 32 22 32 2C 00 00 00 00 00 00 00 00 00
|
||||
00 00 1C 22 20 22 1C 00 00 00 00 00 00 00 00 00
|
||||
02 02 1A 26 22 26 1A 00 00 00 00 00 00 00 00 00
|
||||
00 00 1C 22 3E 20 1C 00 00 00 00 00 00 00 00 00
|
||||
04 0A 08 1C 08 08 08 00 00 00 00 00 00 00 00 00
|
||||
00 00 1A 26 26 1A 02 1C 00 00 00 00 00 00 00 00
|
||||
20 20 2C 32 22 22 22 00 00 00 00 00 00 00 00 00
|
||||
00 08 00 18 08 08 1C 00 00 00 00 00 00 00 00 00
|
||||
00 02 00 02 02 02 22 1C 00 00 00 00 00 00 00 00
|
||||
20 20 24 28 30 28 24 00 00 00 00 00 00 00 00 00
|
||||
18 08 08 08 08 08 1C 00 00 00 00 00 00 00 00 00
|
||||
00 00 14 2A 2A 2A 2A 00 00 00 00 00 00 00 00 00
|
||||
00 00 2C 32 22 22 22 00 00 00 00 00 00 00 00 00
|
||||
00 00 1C 22 22 22 1C 00 00 00 00 00 00 00 00 00
|
||||
00 00 2C 32 32 2C 20 20 00 00 00 00 00 00 00 00
|
||||
00 00 1A 26 26 1A 02 02 00 00 00 00 00 00 00 00
|
||||
00 00 2C 32 20 20 20 00 00 00 00 00 00 00 00 00
|
||||
00 00 1E 20 1C 02 3C 00 00 00 00 00 00 00 00 00
|
||||
10 10 38 10 10 12 0C 00 00 00 00 00 00 00 00 00
|
||||
00 00 22 22 22 26 1A 00 00 00 00 00 00 00 00 00
|
||||
00 00 22 22 22 14 08 00 00 00 00 00 00 00 00 00
|
||||
00 00 22 2A 2A 14 14 00 00 00 00 00 00 00 00 00
|
||||
00 00 22 14 08 14 22 00 00 00 00 00 00 00 00 00
|
||||
00 00 22 22 22 1E 02 1C 00 00 00 00 00 00 00 00
|
||||
00 00 3E 04 08 10 3E 00 00 00 00 00 00 00 00 00
|
||||
08 10 10 20 10 10 08 00 00 00 00 00 00 00 00 00
|
||||
08 08 08 00 08 08 08 00 00 00 00 00 00 00 00 00
|
||||
08 04 04 02 04 04 08 00 00 00 00 00 00 00 00 00
|
||||
10 2A 04 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 3E 00 00 00 00 00 00 00 00 00
|
||||
00 00 1C 22 20 20 20 22 1C 08 00 00 00 00 00 00
|
||||
00 00 22 00 22 22 22 26 1A 00 00 00 00 00 00 00
|
||||
00 00 04 08 1C 22 3E 20 1C 00 00 00 00 00 00 00
|
||||
00 00 08 14 1C 02 1E 22 1E 00 00 00 00 00 00 00
|
||||
00 00 14 00 1C 02 1E 22 1E 00 00 00 00 00 00 00
|
||||
00 00 10 08 1C 02 1E 22 1E 00 00 00 00 00 00 00
|
||||
00 00 08 00 1C 02 1E 22 1E 00 00 00 00 00 00 00
|
||||
00 00 00 00 1C 22 20 22 1C 08 00 00 00 00 00 00
|
||||
00 00 08 14 1C 22 3E 20 1C 00 00 00 00 00 00 00
|
||||
00 00 14 00 1C 22 3E 20 1C 00 00 00 00 00 00 00
|
||||
00 00 10 08 1C 22 3E 20 1C 00 00 00 00 00 00 00
|
||||
00 00 14 00 18 08 08 08 1C 00 00 00 00 00 00 00
|
||||
00 00 08 14 00 18 08 08 1C 00 00 00 00 00 00 00
|
||||
00 00 00 0C 12 1C 12 12 1C 20 00 00 00 00 00 00
|
||||
00 00 22 08 14 22 3E 22 22 00 00 00 00 00 00 00
|
||||
00 00 08 08 14 22 3E 22 22 00 00 00 00 00 00 00
|
||||
00 00 04 08 1C 22 22 22 1C 00 00 00 00 00 00 00
|
||||
00 00 00 00 34 0A 1E 28 1E 00 00 00 00 00 00 00
|
||||
00 00 1E 28 28 3C 28 28 2C 00 00 00 00 00 00 00
|
||||
00 00 08 14 1C 22 22 22 1C 00 00 00 00 00 00 00
|
||||
00 00 14 00 1C 22 22 22 1C 00 00 00 00 00 00 00
|
||||
00 00 00 00 1C 26 2E 32 1C 00 00 00 00 00 00 00
|
||||
00 00 08 14 00 22 22 26 1A 00 00 00 00 00 00 00
|
||||
00 00 10 08 22 22 22 26 1A 00 00 00 00 00 00 00
|
||||
00 00 1C 26 2A 2A 2A 32 1C 00 00 00 00 00 00 00
|
||||
00 00 22 1C 22 22 22 22 1C 00 00 00 00 00 00 00
|
||||
00 00 14 22 22 22 22 22 1C 00 00 00 00 00 00 00
|
||||
00 00 1C 20 1C 22 1C 02 1C 00 00 00 00 00 00 00
|
||||
00 00 04 0A 08 1C 08 0A 3C 00 00 00 00 00 00 00
|
||||
00 00 08 08 3E 08 08 00 3E 00 00 00 00 00 00 00
|
||||
00 00 04 0A 04 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 04 0A 08 1C 08 08 28 10 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 08 08 08 08 08 00 08 00 00 00 00 00 00 00
|
||||
00 00 14 14 14 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 14 14 3E 14 3E 14 14 00 00 00 00 00 00 00
|
||||
00 00 08 1E 28 1C 0A 3C 08 00 00 00 00 00 00 00
|
||||
00 00 32 32 04 08 10 26 26 00 00 00 00 00 00 00
|
||||
00 00 10 28 28 10 2A 24 1A 00 00 00 00 00 00 00
|
||||
00 00 08 08 10 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 08 10 20 20 20 10 08 00 00 00 00 00 00 00
|
||||
00 00 08 04 02 02 02 04 08 00 00 00 00 00 00 00
|
||||
00 00 00 08 2A 1C 1C 2A 08 00 00 00 00 00 00 00
|
||||
00 00 00 08 08 3E 08 08 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 08 08 10 00 00 00 00 00 00
|
||||
00 00 00 00 00 3E 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00
|
||||
00 00 00 02 04 08 10 20 00 00 00 00 00 00 00 00
|
||||
00 00 1C 22 26 2A 32 22 1C 00 00 00 00 00 00 00
|
||||
00 00 08 18 08 08 08 08 1C 00 00 00 00 00 00 00
|
||||
00 00 1C 22 02 1C 20 20 3E 00 00 00 00 00 00 00
|
||||
00 00 1C 22 02 04 02 22 1C 00 00 00 00 00 00 00
|
||||
00 00 04 0C 14 24 3E 04 04 00 00 00 00 00 00 00
|
||||
00 00 3E 20 3C 02 02 02 3C 00 00 00 00 00 00 00
|
||||
00 00 1C 20 20 3C 22 22 1C 00 00 00 00 00 00 00
|
||||
00 00 3E 02 04 08 10 20 20 00 00 00 00 00 00 00
|
||||
00 00 1C 22 22 1C 22 22 1C 00 00 00 00 00 00 00
|
||||
00 00 1C 22 22 1E 02 02 1C 00 00 00 00 00 00 00
|
||||
00 00 00 00 08 00 00 08 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 08 00 00 08 08 10 00 00 00 00 00 00
|
||||
00 00 04 08 10 20 10 08 04 00 00 00 00 00 00 00
|
||||
00 00 00 00 3E 00 3E 00 00 00 00 00 00 00 00 00
|
||||
00 00 10 08 04 02 04 08 10 00 00 00 00 00 00 00
|
||||
00 00 1C 22 02 04 08 00 08 00 00 00 00 00 00 00
|
||||
00 00 1C 22 02 1A 2A 2A 1C 00 00 00 00 00 00 00
|
||||
00 00 08 14 22 22 3E 22 22 00 00 00 00 00 00 00
|
||||
00 00 3C 12 12 1C 12 12 3C 00 00 00 00 00 00 00
|
||||
00 00 1C 22 20 20 20 22 1C 00 00 00 00 00 00 00
|
||||
00 00 3C 12 12 12 12 12 3C 00 00 00 00 00 00 00
|
||||
00 00 3E 20 20 3C 20 20 3E 00 00 00 00 00 00 00
|
||||
00 00 3E 20 20 3C 20 20 20 00 00 00 00 00 00 00
|
||||
00 00 1E 20 20 26 22 22 1C 00 00 00 00 00 00 00
|
||||
00 00 22 22 22 3E 22 22 22 00 00 00 00 00 00 00
|
||||
00 00 1C 08 08 08 08 08 1C 00 00 00 00 00 00 00
|
||||
00 00 02 02 02 02 22 22 1C 00 00 00 00 00 00 00
|
||||
00 00 22 24 28 30 28 24 22 00 00 00 00 00 00 00
|
||||
00 00 20 20 20 20 20 20 3E 00 00 00 00 00 00 00
|
||||
00 00 22 36 2A 2A 22 22 22 00 00 00 00 00 00 00
|
||||
00 00 22 32 2A 26 22 22 22 00 00 00 00 00 00 00
|
||||
00 00 1C 22 22 22 22 22 1C 00 00 00 00 00 00 00
|
||||
00 00 3C 22 22 3C 20 20 20 00 00 00 00 00 00 00
|
||||
00 00 1C 22 22 22 2A 24 1A 00 00 00 00 00 00 00
|
||||
00 00 3C 22 22 3C 28 24 22 00 00 00 00 00 00 00
|
||||
00 00 1C 22 10 08 04 22 1C 00 00 00 00 00 00 00
|
||||
00 00 3E 08 08 08 08 08 08 00 00 00 00 00 00 00
|
||||
00 00 22 22 22 22 22 22 1C 00 00 00 00 00 00 00
|
||||
00 00 22 22 22 14 14 08 08 00 00 00 00 00 00 00
|
||||
00 00 22 22 22 2A 2A 36 22 00 00 00 00 00 00 00
|
||||
00 00 22 22 14 08 14 22 22 00 00 00 00 00 00 00
|
||||
00 00 22 22 14 08 08 08 08 00 00 00 00 00 00 00
|
||||
00 00 3E 02 04 08 10 20 3E 00 00 00 00 00 00 00
|
||||
00 00 38 20 20 20 20 20 38 00 00 00 00 00 00 00
|
||||
00 00 20 20 10 08 04 02 02 00 00 00 00 00 00 00
|
||||
00 00 0E 02 02 02 02 02 0E 00 00 00 00 00 00 00
|
||||
00 00 08 1C 2A 08 08 08 08 00 00 00 00 00 00 00
|
||||
00 00 00 08 10 3E 10 08 00 00 00 00 00 00 00 00
|
||||
00 00 08 14 22 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 1C 02 1E 22 1E 00 00 00 00 00 00 00
|
||||
00 00 20 20 2C 32 22 32 2C 00 00 00 00 00 00 00
|
||||
00 00 00 00 1C 22 20 22 1C 00 00 00 00 00 00 00
|
||||
00 00 02 02 1A 26 22 26 1A 00 00 00 00 00 00 00
|
||||
00 00 00 00 1C 22 3E 20 1C 00 00 00 00 00 00 00
|
||||
00 00 04 0A 08 1C 08 08 08 00 00 00 00 00 00 00
|
||||
00 00 00 00 1A 26 26 1A 02 1C 00 00 00 00 00 00
|
||||
00 00 20 20 2C 32 22 22 22 00 00 00 00 00 00 00
|
||||
00 00 00 08 00 18 08 08 1C 00 00 00 00 00 00 00
|
||||
00 00 00 02 00 02 02 02 22 1C 00 00 00 00 00 00
|
||||
00 00 20 20 24 28 30 28 24 00 00 00 00 00 00 00
|
||||
00 00 18 08 08 08 08 08 1C 00 00 00 00 00 00 00
|
||||
00 00 00 00 14 2A 2A 2A 2A 00 00 00 00 00 00 00
|
||||
00 00 00 00 2C 32 22 22 22 00 00 00 00 00 00 00
|
||||
00 00 00 00 1C 22 22 22 1C 00 00 00 00 00 00 00
|
||||
00 00 00 00 2C 32 32 2C 20 20 00 00 00 00 00 00
|
||||
00 00 00 00 1A 26 26 1A 02 02 00 00 00 00 00 00
|
||||
00 00 00 00 2C 32 20 20 20 00 00 00 00 00 00 00
|
||||
00 00 00 00 1E 20 1C 02 3C 00 00 00 00 00 00 00
|
||||
00 00 10 10 38 10 10 12 0C 00 00 00 00 00 00 00
|
||||
00 00 00 00 22 22 22 26 1A 00 00 00 00 00 00 00
|
||||
00 00 00 00 22 22 22 14 08 00 00 00 00 00 00 00
|
||||
00 00 00 00 22 2A 2A 14 14 00 00 00 00 00 00 00
|
||||
00 00 00 00 22 14 08 14 22 00 00 00 00 00 00 00
|
||||
00 00 00 00 22 22 22 1E 02 1C 00 00 00 00 00 00
|
||||
00 00 00 00 3E 04 08 10 3E 00 00 00 00 00 00 00
|
||||
00 00 08 10 10 20 10 10 08 00 00 00 00 00 00 00
|
||||
00 00 08 08 08 00 08 08 08 00 00 00 00 00 00 00
|
||||
00 00 08 04 04 02 04 04 08 00 00 00 00 00 00 00
|
||||
00 00 10 2A 04 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 3E 00 00 00 00 00 00 00
|
||||
@@ -0,0 +1,102 @@
|
||||
//============================================================================
|
||||
// Verilog conversions of the CoCo3 ROM entities in rtl/rom/*.vhd.
|
||||
//
|
||||
// Line-for-line translations: same entity names, same ports, same clocking.
|
||||
// The three loadable ROMs are single-clock RAMs filled over ioctl; while a
|
||||
// write is in progress the read register holds its previous value, exactly as
|
||||
// the VHDL `if WRITE = '1' ... else DATA <= ...` does.
|
||||
//============================================================================
|
||||
|
||||
// rtl/rom/coco_rom_32K.vhd -- CoCo3 system ROM (boot0.rom, ioctl index 0)
|
||||
module COCO_ROM_32K
|
||||
(
|
||||
input [14:0] ADDR,
|
||||
output reg [7:0] DATA,
|
||||
input CLK,
|
||||
input [14:0] WR_ADDR,
|
||||
input [7:0] WR_DATA,
|
||||
input WRITE
|
||||
);
|
||||
reg [7:0] ROM [0:32767];
|
||||
always @(posedge CLK) begin
|
||||
if (WRITE) ROM[WR_ADDR] <= WR_DATA;
|
||||
else DATA <= ROM[ADDR];
|
||||
end
|
||||
endmodule
|
||||
|
||||
// rtl/rom/coco_rom_8K.vhd -- Disk BASIC ROM (boot1.rom, ioctl index 64)
|
||||
module COCO_ROM_8K
|
||||
(
|
||||
input [12:0] ADDR,
|
||||
output reg [7:0] DATA,
|
||||
input CLK,
|
||||
input [12:0] WR_ADDR,
|
||||
input [7:0] WR_DATA,
|
||||
input WRITE
|
||||
);
|
||||
reg [7:0] ROM [0:8191];
|
||||
always @(posedge CLK) begin
|
||||
if (WRITE) ROM[WR_ADDR] <= WR_DATA;
|
||||
else DATA <= ROM[ADDR];
|
||||
end
|
||||
endmodule
|
||||
|
||||
// rtl/rom/coco_rom_cart.vhd -- Program Pak, up to 128K (ioctl index 1)
|
||||
module COCO_ROM_CART
|
||||
(
|
||||
input [16:0] ADDR,
|
||||
output reg [7:0] DATA,
|
||||
input CLK,
|
||||
input [16:0] WR_ADDR,
|
||||
input [7:0] WR_DATA,
|
||||
input WRITE
|
||||
);
|
||||
reg [7:0] ROM [0:131071];
|
||||
always @(posedge CLK) begin
|
||||
if (WRITE) ROM[WR_ADDR] <= WR_DATA;
|
||||
else DATA <= ROM[ADDR];
|
||||
end
|
||||
endmodule
|
||||
|
||||
// rtl/rom/coco_rom_16.vhd -- the AMW (automatic memory write) script: three
|
||||
// {valid, a24..a0, data} records followed by a terminator. Asynchronous.
|
||||
module COCO_ROM_16
|
||||
(
|
||||
input [3:0] ADDR,
|
||||
output reg [7:0] DATA
|
||||
);
|
||||
always @(*) begin
|
||||
case (ADDR)
|
||||
// Clear $71 [Warm Start Flag]
|
||||
4'd0: DATA = 8'h80; 4'd1: DATA = 8'h07; 4'd2: DATA = 8'h00;
|
||||
4'd3: DATA = 8'h71; 4'd4: DATA = 8'h00;
|
||||
// Set $C000 <- $55 [Clear D in DK identifier in rom]
|
||||
4'd5: DATA = 8'h80; 4'd6: DATA = 8'h07; 4'd7: DATA = 8'hC0;
|
||||
4'd8: DATA = 8'h00; 4'd9: DATA = 8'h55;
|
||||
// Clear $72 [Warm Start Jump]
|
||||
4'd10: DATA = 8'h80; 4'd11: DATA = 8'h07; 4'd12: DATA = 8'h00;
|
||||
4'd13: DATA = 8'h72; 4'd14: DATA = 8'h00;
|
||||
// terminator
|
||||
default: DATA = 8'h00;
|
||||
endcase
|
||||
end
|
||||
endmodule
|
||||
|
||||
// rtl/rom/coco3_char_rom.vhd -- 4K font RAM, preloaded with the CoCo3 font
|
||||
// (verilator/rtl/coco3_char_rom.mem, extracted from the VHDL by gen_mem.py).
|
||||
// Separate write and registered-read clocks, as in the VHDL.
|
||||
module coco3_Char_ROM
|
||||
(
|
||||
input RD_CLK,
|
||||
input [11:0] ADDR_R,
|
||||
output reg [7:0] DATA_R,
|
||||
input WR_CLK,
|
||||
input WE,
|
||||
input [11:0] ADDR_W,
|
||||
input [7:0] DATA_W
|
||||
);
|
||||
reg [7:0] RAM [0:4095];
|
||||
initial $readmemh("rtl/coco3_char_rom.mem", RAM);
|
||||
always @(posedge WR_CLK) if (WE) RAM[ADDR_W] <= DATA_W;
|
||||
always @(posedge RD_CLK) DATA_R <= RAM[ADDR_R];
|
||||
endmodule
|
||||
@@ -0,0 +1,33 @@
|
||||
//============================================================================
|
||||
// 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
|
||||
@@ -0,0 +1,327 @@
|
||||
//============================================================================
|
||||
// Simulation replacement for rtl/sdram/sdram2.sv (module sdram_32r8w).
|
||||
//
|
||||
// The controller below is rtl/sdram/sdram2.sv copied verbatim -- the same
|
||||
// state machine, refresh schedule, CAS/burst delays and ack/ready timing the
|
||||
// core is written against. Only the pins changed:
|
||||
//
|
||||
// - SDRAM_DQ is not a tristate. The controller's drive is SDRAM_DQ (a reg
|
||||
// that it sets to 16'bZ when idle, harmless here) and what it samples is
|
||||
// chip_dq, driven by the chip model at the bottom of this file.
|
||||
// - The block-local registers of the main always block are declared at
|
||||
// module scope instead; see the note there.
|
||||
// - The altddio_out that forwards the (inverted) clock to the chip is gone;
|
||||
// the chip model samples the controller's registered command one clk
|
||||
// later, which is where the inverted SDRAM_CLK edge lands.
|
||||
//
|
||||
// Chip model: one 32 MB x16 SDR SDRAM, CAS latency 3, sequential burst 2,
|
||||
// single-word writes, DQM byte masks on A[12:11] -- the mode sdram2.sv
|
||||
// programs. A READ registered at clk edge k (command <= CMD_READ) makes word 0
|
||||
// land in dq_reg at edge k+4 and word 1 at k+5, which is exactly when the
|
||||
// controller's data_*_ready_delay taps say the data is there.
|
||||
//============================================================================
|
||||
module sdram_32r8w
|
||||
(
|
||||
input init, // reset to initialize RAM
|
||||
input clk, // clock ~100MHz
|
||||
|
||||
// CPU R/W port
|
||||
input [24:0] sdram_cpu_addr, // 25 bit address for 8bit mode.
|
||||
output [15:0] sdram_dout, // data output to cpu [for both ports]
|
||||
input [7:0] sdram_cpu_din, // data input from cpu
|
||||
input sdram_cpu_req, // request
|
||||
input sdram_cpu_rnw, // 1 - read, 0 - write
|
||||
output reg sdram_cpu_ack, // 1 = ack
|
||||
output reg sdram_cpu_ready, // dout is valid. Ready to accept new read/write.
|
||||
|
||||
// Video R port
|
||||
input [24:0] sdram_vid_addr, // 25 bit A0=0.
|
||||
input sdram_vid_req, // request
|
||||
output reg sdram_vid_ack, // 1 = ack
|
||||
output reg sdram_vid_ready, // dout is valid. Ready to accept new read/write.
|
||||
|
||||
output reg sdram_busy // doing something...
|
||||
);
|
||||
|
||||
reg [15:0] SDRAM_DQ;
|
||||
reg [12:0] SDRAM_A;
|
||||
reg [1:0] SDRAM_BA;
|
||||
reg [15:0] chip_dq;
|
||||
|
||||
|
||||
assign sdram_dout = dq_reg;
|
||||
|
||||
// Burst length = 4
|
||||
localparam BURST_LENGTH = 2;
|
||||
localparam BURST_CODE = (BURST_LENGTH == 8) ? 3'b011 : (BURST_LENGTH == 4) ? 3'b010 : (BURST_LENGTH == 2) ? 3'b001 : 3'b000; // 000=1, 001=2, 010=4, 011=8
|
||||
localparam ACCESS_TYPE = 1'b0; // 0=sequential, 1=interleaved
|
||||
localparam CAS_LATENCY = 3'd3; // 2 for < 100MHz, 3 for >100MHz
|
||||
localparam OP_MODE = 2'b00; // only 00 (standard operation) allowed
|
||||
localparam NO_WRITE_BURST = 1'b1; // 0= write burst enabled, 1=only single access write
|
||||
localparam MODE = {3'b000, NO_WRITE_BURST, OP_MODE, CAS_LATENCY, ACCESS_TYPE, BURST_CODE};
|
||||
|
||||
localparam sdram_startup_cycles= 14'd12100;// 100us, plus a little more, @ 100MHz
|
||||
localparam startup_refresh_max = 14'b11111111111111;
|
||||
//localparam cycles_per_refresh = 14'd780; // (64000*100)/8192-1 Calc'd as (64ms @ 100MHz)/8192 rose
|
||||
localparam cycles_per_refresh = 14'd890; // (64000*100)/8192-1 Calc'd as (64ms @ 114.560MHz)/8192 rose (act 895)
|
||||
|
||||
// SDRAM commands
|
||||
wire [2:0] CMD_NOP = 3'b111;
|
||||
wire [2:0] CMD_ACTIVE = 3'b011;
|
||||
wire [2:0] CMD_READ = 3'b101;
|
||||
wire [2:0] CMD_WRITE = 3'b100;
|
||||
wire [2:0] CMD_PRECHARGE = 3'b010;
|
||||
wire [2:0] CMD_AUTO_REFRESH = 3'b001;
|
||||
wire [2:0] CMD_LOAD_MODE = 3'b000;
|
||||
|
||||
reg [13:0] refresh_count = startup_refresh_max - sdram_startup_cycles;
|
||||
reg [2:0] command;
|
||||
|
||||
localparam STATE_STARTUP = 0;
|
||||
localparam STATE_WAIT = 1;
|
||||
localparam STATE_WAIT1 = 2;
|
||||
localparam STATE_RW1 = 3;
|
||||
localparam STATE_IDLE = 4;
|
||||
localparam STATE_DLY1 = 5;
|
||||
localparam STATE_DLY2 = 6;
|
||||
localparam STATE_IDLE_7 = 17;
|
||||
localparam STATE_IDLE_6 = 16;
|
||||
localparam STATE_IDLE_5 = 15;
|
||||
localparam STATE_IDLE_4 = 14;
|
||||
localparam STATE_IDLE_3 = 13;
|
||||
localparam STATE_IDLE_2 = 12;
|
||||
localparam STATE_IDLE_1 = 11;
|
||||
|
||||
reg [15:0] dq_reg;
|
||||
|
||||
// In the original these are declared inside the always block below, with
|
||||
// `state` initialised there. Verilator (5.044) re-applies a block-local
|
||||
// initialiser every time the block runs, so `state` was forced back to
|
||||
// STATE_STARTUP on every clock and no request was ever served. At module scope
|
||||
// the initialiser runs once, as Quartus treats it.
|
||||
reg [CAS_LATENCY+BURST_LENGTH:0] data_cpu_ready_delay;
|
||||
reg [CAS_LATENCY+BURST_LENGTH:0] data_vid_ready_delay;
|
||||
|
||||
reg saved_wr;
|
||||
reg saved_vid;
|
||||
reg [12:0] cas_addr;
|
||||
reg [31:0] saved_data;
|
||||
reg [4:0] state = STATE_STARTUP;
|
||||
|
||||
always @(posedge clk) begin
|
||||
|
||||
refresh_count <= refresh_count + 1'b1;
|
||||
|
||||
data_vid_ready_delay[CAS_LATENCY+BURST_LENGTH] <= 0;
|
||||
|
||||
data_cpu_ready_delay[CAS_LATENCY+BURST_LENGTH] <= 0;
|
||||
|
||||
data_cpu_ready_delay <= data_cpu_ready_delay>>1;
|
||||
data_vid_ready_delay <= data_vid_ready_delay>>1;
|
||||
|
||||
dq_reg <= chip_dq;
|
||||
|
||||
// if(data_ready_delay[1]) sdram_ldout[15:00] <= dq_reg;
|
||||
// if(data_ready_delay[0]) sdram_ldout[31:16] <= dq_reg;
|
||||
|
||||
sdram_cpu_ready <= 1'b0;
|
||||
sdram_vid_ready <= 1'b0;
|
||||
|
||||
if (data_cpu_ready_delay[2]) sdram_cpu_ready <= 1'b1; // Data valid for the first 16 bits
|
||||
if (data_cpu_ready_delay[1]) sdram_busy <= 1'b0;
|
||||
|
||||
if (data_vid_ready_delay[2]) sdram_vid_ready <= 1'b1; // Data valid for the first 16 bits
|
||||
if (data_vid_ready_delay[1]) sdram_vid_ready <= 1'b1; // Data valid for the second 16 bits
|
||||
|
||||
if (data_vid_ready_delay[0]) sdram_busy <= 1'b0;
|
||||
|
||||
|
||||
SDRAM_DQ <= 16'h0000; // was 16'bZ: the bus is not tristated here
|
||||
|
||||
command <= CMD_NOP;
|
||||
|
||||
if (!sdram_cpu_req)
|
||||
sdram_cpu_ack <= 1'b0;
|
||||
|
||||
if (!sdram_vid_req)
|
||||
sdram_vid_ack <= 1'b0;
|
||||
|
||||
case (state)
|
||||
STATE_STARTUP: begin
|
||||
SDRAM_A <= 0;
|
||||
SDRAM_BA <= 0;
|
||||
sdram_cpu_ready <= 0; //not ready
|
||||
sdram_vid_ready <= 0; //not ready
|
||||
sdram_busy <= 1'b1;
|
||||
|
||||
// All the commands during the startup are NOPS, except these
|
||||
if (refresh_count == startup_refresh_max-31) begin
|
||||
// ensure all rows are closed
|
||||
command <= CMD_PRECHARGE;
|
||||
SDRAM_A[10] <= 1; // all banks
|
||||
SDRAM_BA <= 2'b00;
|
||||
end
|
||||
if (refresh_count == startup_refresh_max-23) begin
|
||||
// these refreshes need to be at least tREF (66ns) apart
|
||||
command <= CMD_AUTO_REFRESH;
|
||||
end
|
||||
if (refresh_count == startup_refresh_max-15) begin
|
||||
command <= CMD_AUTO_REFRESH;
|
||||
end
|
||||
if (refresh_count == startup_refresh_max-7) begin
|
||||
// Now load the mode register
|
||||
command <= CMD_LOAD_MODE;
|
||||
SDRAM_A <= MODE;
|
||||
end
|
||||
|
||||
if (!refresh_count) begin
|
||||
state <= STATE_IDLE;
|
||||
sdram_busy <= 1'b0;
|
||||
refresh_count <= 0;
|
||||
end
|
||||
end
|
||||
|
||||
STATE_IDLE_7: state <= STATE_IDLE_6;
|
||||
STATE_IDLE_6: state <= STATE_IDLE_5;
|
||||
STATE_IDLE_5: state <= STATE_IDLE_4;
|
||||
STATE_IDLE_4: state <= STATE_IDLE_3;
|
||||
STATE_IDLE_3: state <= STATE_IDLE_2;
|
||||
STATE_IDLE_2: state <= STATE_IDLE_1;
|
||||
STATE_IDLE_1: begin
|
||||
state <= STATE_IDLE;
|
||||
sdram_busy <= 1'b0;
|
||||
// mask possible refresh to reduce colliding.
|
||||
if(refresh_count > cycles_per_refresh) begin
|
||||
state <= STATE_IDLE_7;
|
||||
command <= CMD_AUTO_REFRESH;
|
||||
refresh_count <= 0;
|
||||
sdram_busy <= 1'b1;
|
||||
end
|
||||
end
|
||||
|
||||
STATE_IDLE: begin
|
||||
saved_vid <= 1'b0;
|
||||
if(refresh_count > (cycles_per_refresh<<1))
|
||||
begin
|
||||
state <= STATE_IDLE_1;
|
||||
sdram_busy <= 1'b1;
|
||||
end
|
||||
else
|
||||
begin
|
||||
if(sdram_cpu_req & !sdram_cpu_ack) // request has to go away after ready=0
|
||||
begin
|
||||
// fix byte writes [no new command until data is actually written]
|
||||
if (~sdram_cpu_rnw)
|
||||
{cas_addr[12:9],SDRAM_BA,SDRAM_A,cas_addr[8:0]} <= {~sdram_cpu_addr[0], sdram_cpu_addr[0], 2'b10, sdram_cpu_addr[24:1]}; // Bytes by A0 for writes
|
||||
else
|
||||
{cas_addr[12:9],SDRAM_BA,SDRAM_A,cas_addr[8:0]} <= {2'b00, 2'b10, sdram_cpu_addr[24:1]}; // No bytes for reads...
|
||||
|
||||
saved_data <= {sdram_cpu_din, sdram_cpu_din};
|
||||
saved_wr <= ~sdram_cpu_rnw;
|
||||
command <= CMD_ACTIVE;
|
||||
state <= STATE_WAIT;
|
||||
sdram_busy <= 1'b1;
|
||||
end
|
||||
else
|
||||
begin
|
||||
if (sdram_vid_req)
|
||||
begin
|
||||
{cas_addr[12:9],SDRAM_BA,SDRAM_A,cas_addr[8:0]} <= {2'b00, 2'b10, sdram_vid_addr[24:1]}; // No bytes for reads...
|
||||
command <= CMD_ACTIVE;
|
||||
saved_vid <= 1'b1;
|
||||
saved_wr <= 1'b0;
|
||||
sdram_busy <= 1'b1;
|
||||
state <= STATE_WAIT;
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
STATE_WAIT: state <= STATE_WAIT1;
|
||||
STATE_WAIT1: begin
|
||||
if (saved_wr)
|
||||
begin
|
||||
if ((data_vid_ready_delay[5:1] == 5'b00000) && (data_cpu_ready_delay[5:1] == 5'b00000))
|
||||
state <= STATE_RW1; // added for clk > 100Mhz
|
||||
end
|
||||
else
|
||||
state <= STATE_RW1; // added for clk > 100Mhz
|
||||
end
|
||||
|
||||
STATE_RW1: begin
|
||||
SDRAM_A <= cas_addr;
|
||||
if (saved_vid)
|
||||
sdram_vid_ack <= 1'b1;
|
||||
else
|
||||
sdram_cpu_ack <= 1'b1;
|
||||
|
||||
if(saved_wr) begin
|
||||
command <= CMD_WRITE;
|
||||
SDRAM_DQ <= saved_data[15:0];
|
||||
// state <= STATE_IDLE;
|
||||
state <= STATE_DLY1;
|
||||
sdram_cpu_ready <= 1'b1; // write done
|
||||
sdram_busy <= 1'b0;
|
||||
end
|
||||
else begin
|
||||
command <= CMD_READ;
|
||||
state <= STATE_IDLE;
|
||||
if (saved_vid)
|
||||
begin
|
||||
data_vid_ready_delay[CAS_LATENCY+BURST_LENGTH] <= 1;
|
||||
state <= STATE_DLY1;
|
||||
end
|
||||
else
|
||||
data_cpu_ready_delay[CAS_LATENCY+BURST_LENGTH] <= 1;
|
||||
state <= STATE_DLY1;
|
||||
end
|
||||
end
|
||||
STATE_DLY1:
|
||||
state <= STATE_DLY2;
|
||||
STATE_DLY2:
|
||||
state <= STATE_IDLE;
|
||||
endcase
|
||||
|
||||
if (init) begin
|
||||
sdram_cpu_ack <= 1'b0;
|
||||
sdram_vid_ack <= 1'b0;
|
||||
state <= STATE_STARTUP;
|
||||
refresh_count <= startup_refresh_max - sdram_startup_cycles;
|
||||
end
|
||||
end
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// SDR SDRAM chip model
|
||||
//----------------------------------------------------------------------------
|
||||
reg [15:0] chip_mem [0:(1<<24)-1];
|
||||
reg [12:0] chip_row [0:3];
|
||||
|
||||
reg rd_p1, rd_p2, rd_w1;
|
||||
reg [23:0] rd_a1, rd_a2, rd_aw;
|
||||
|
||||
wire [23:0] cmd_addr = {SDRAM_BA, chip_row[SDRAM_BA], SDRAM_A[8:0]};
|
||||
|
||||
always @(posedge clk) begin
|
||||
case (command)
|
||||
3'b011: chip_row[SDRAM_BA] <= SDRAM_A; // ACTIVE
|
||||
3'b100: begin // WRITE
|
||||
if (!SDRAM_A[11]) chip_mem[cmd_addr][7:0] <= SDRAM_DQ[7:0];
|
||||
if (!SDRAM_A[12]) chip_mem[cmd_addr][15:8] <= SDRAM_DQ[15:8];
|
||||
end
|
||||
default: ;
|
||||
endcase
|
||||
|
||||
// READ: two pipeline stages, then word 0 and word 1 on consecutive edges.
|
||||
rd_p1 <= (command == 3'b101);
|
||||
rd_a1 <= cmd_addr;
|
||||
rd_p2 <= rd_p1;
|
||||
rd_a2 <= rd_a1;
|
||||
rd_w1 <= rd_p2;
|
||||
rd_aw <= {rd_a2[23:1], ~rd_a2[0]}; // burst 2, sequential
|
||||
|
||||
if (rd_p2) chip_dq <= chip_mem[rd_a2];
|
||||
else if (rd_w1) chip_dq <= chip_mem[rd_aw];
|
||||
else chip_dq <= 16'h0000;
|
||||
end
|
||||
|
||||
endmodule
|
||||
@@ -0,0 +1,32 @@
|
||||
0000 0010 0020 0030 0040 0050 0060 0070
|
||||
0080 0090 00A0 00B0 00C0 00D0 00E0 00F0
|
||||
0100 0110 0120 0130 0140 0150 0160 0170
|
||||
0180 0190 01A0 01B0 01C0 01D0 01E0 01F0
|
||||
0200 0210 0220 0230 0240 0250 0260 0270
|
||||
0280 0290 02A0 02B0 02C0 02D0 02E0 02F0
|
||||
0300 0310 0320 0330 0340 0350 0360 0370
|
||||
0380 0390 03A0 03B0 03C0 03D0 03E0 03F0
|
||||
0400 0410 0420 0430 0440 0450 0460 0470
|
||||
0480 0490 04A0 04B0 04C0 04D0 04E0 04F0
|
||||
0500 0510 0520 0530 0540 0550 0560 0570
|
||||
0580 0590 05A0 05B0 05C0 05D0 05E0 05F0
|
||||
0600 0610 0620 0630 0640 0650 0660 0670
|
||||
0680 0690 06A0 06B0 06C0 06D0 06E0 06F0
|
||||
0700 0710 0720 0730 0740 0750 0760 0770
|
||||
0780 0790 07A0 07B0 07C0 07D0 07E0 07F0
|
||||
0800 0810 0820 0830 0840 0850 0860 0870
|
||||
0880 0890 08A0 08B0 08C0 08D0 08E0 08F0
|
||||
0900 0910 0920 0930 0940 0950 0960 0970
|
||||
0980 0990 09A0 09B0 09C0 09D0 09E0 09F0
|
||||
0A00 0A10 0A20 0A30 0A40 0A50 0A60 0A70
|
||||
0A80 0A90 0AA0 0AB0 0AC0 0AD0 0AE0 0AF0
|
||||
0B00 0B10 0B20 0B30 0B40 0B50 0B60 0B70
|
||||
0B80 0B90 0BA0 0BB0 0BC0 0BD0 0BE0 0BF0
|
||||
0C00 0C10 0C20 0C30 0C40 0C50 0C60 0C70
|
||||
0C80 0C90 0CA0 0CB0 0CC0 0CD0 0CE0 0CF0
|
||||
0D00 0D10 0D20 0D30 0D40 0D50 0D60 0D70
|
||||
0D80 0D90 0DA0 0DB0 0DC0 0DD0 0DE0 0DF0
|
||||
0E00 0E10 0E20 0E30 0E40 0E50 0E60 0E70
|
||||
0E80 0E90 0EA0 0EB0 0EC0 0ED0 0EE0 0EF0
|
||||
0F00 0F10 0F20 0F30 0F40 0F50 0F60 0F70
|
||||
0F80 0F90 0FA0 0FB0 0FC0 0FD0 0FE0 0FF0
|
||||
Reference in new issue
Block a user