Skip to content

Commit

Permalink
Disable macro ROMs in SIM and FPGA
Browse files Browse the repository at this point in the history
  • Loading branch information
rejunity committed Nov 10, 2024
1 parent a0b3b7a commit e84618d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions fpga/icebreaker.v
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// Also see: https://projectf.io/posts/fpga-graphics/

`default_nettype none
`define FPGA
`define VGA_6BPP
// `define VGA_12BPP
// `define DVI
Expand Down
24 changes: 22 additions & 2 deletions src/tt_um_rejunity_atari2600.v
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,27 @@ module tt_um_rejunity_atari2600 (
reg [7:0] rom2_data_r;
reg [7:0] rom3_data_r;

`ifdef SIM
always @(*)
casez ({use_internal_rom, rom_config[3:1]})
4'b0zzz: rom_data = external_rom_data;
4'b10zz: rom_data = internal_rom_data;
4'b1100: rom_data = internal_rom_data;
4'b1101: rom_data = internal_rom_data;
4'b1110: rom_data = internal_rom_data;
4'b1111: rom_data = internal_rom_data;
endcase
`elsif FPGA
always @(*)
casez ({use_internal_rom, rom_config[3:1]})
4'b0zzz: rom_data = external_rom_data;
4'b10zz: rom_data = internal_rom_data;
4'b1100: rom_data = internal_rom_data;
4'b1101: rom_data = internal_rom_data;
4'b1110: rom_data = internal_rom_data;
4'b1111: rom_data = internal_rom_data;
endcase
`else
rom_2600_0 rom0_I (
.addr (romx_addr),
.q (rom0_data)
Expand Down Expand Up @@ -339,8 +360,6 @@ module tt_um_rejunity_atari2600 (
rom2_data_r <= rom2_data;
rom3_data_r <= rom3_data;
end


always @(*)
casez ({use_internal_rom, rom_config[3:1]})
4'b0zzz: rom_data = external_rom_data;
Expand All @@ -350,6 +369,7 @@ module tt_um_rejunity_atari2600 (
4'b1110: rom_data = rom2_data_r;
4'b1111: rom_data = rom3_data_r;
endcase
`endif

always @(posedge clk) begin
`ifdef VALIDATE_QSPI_ROM_AGAINST_INTERNAL_ROM
Expand Down

0 comments on commit e84618d

Please sign in to comment.