More WIP on PPU

This commit is contained in:
2023-10-31 22:48:14 +00:00
parent 3c3dbd2175
commit 82584dab34
5 changed files with 179 additions and 70 deletions

View File

@@ -138,7 +138,7 @@ assign we = gb_inst.cpu_we;
assign vram_sel = gb_inst.vram_sel;
assign hiram_sel = gb_inst.hiram_sel;
assign ppu_sel = gb_inst.ppu_inst.sva_ppu_sel;
assign ppu_sel = gb_inst.ppu_inst.ppu_ioregs_inst.sva_sel;
always_ff @(posedge gb_clk or negedge nreset) begin
if (!nreset)

View File

@@ -17,15 +17,18 @@ import "DPI-C" function int vgasim_init(input int screen_h, input int screen_w,
import "DPI-C" function int vgasim_reset();
import "DPI-C" function int vgasim_tick(input int r, input int g, input int b, input int hsync, input int vsync);
logic vgasim_initialised = 0;
initial begin
automatic int ret = vgasim_init(SCREEN_W, SCREEN_H, DEPTH);
assert (ret == 0) else begin
if (ret != 0) begin
$display($sformatf("[%0t] vgasim init failed: %d", $time, ret));
$fatal();
end else begin
vgasim_initialised = '1;
end
end
always @(negedge nreset) begin
always @(negedge nreset iff vgasim_initialised) begin
automatic int ret = vgasim_reset();
assert (ret == 0) else begin
$display($sformatf("[%0t] vgasim reset failed: %d", $time, ret));
@@ -33,7 +36,7 @@ always @(negedge nreset) begin
end
end
always @(posedge clk iff nreset) begin
always @(posedge clk iff nreset && vgasim_initialised) begin
automatic int ret = vgasim_tick(r_i, g_i, b_i, hsync_i, vsync_i);
assert (ret == 0) else begin
$display($sformatf("[%0t] vgasim tick failed: %d", $time, ret));