More WIP on PPU
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user