Skip to content

Commit 1ca0c12

Browse files
committed
Attempt to fix GL_TEST
1 parent efa7443 commit 1ca0c12

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

test/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ VERILOG_SOURCES += $(PWD)/gate_level_netlist.v
3333
endif
3434

3535
# Include the testbench sources:
36-
VERILOG_SOURCES += $(PWD)/tb.v
37-
# VERILOG_SOURCES += $(PWD)/qspi_rom_emu.v # compilation error in IHP130 devcontainer
36+
VERILOG_SOURCES += $(PWD)/qspi_rom_emu.v
3837
# VERILOG_SOURCES += $(PWD)/macro_rom_emu.v # external ROMs are not supported with IHP130
38+
VERILOG_SOURCES += $(PWD)/tb.v
3939
TOPLEVEL = tb
4040

4141
MODULE = test

test/qspi_rom_emu.v

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ module qspi_rom_emu #(parameter ADDR_BITS = 24) (
2020

2121
reg [ADDR_BITS-1:0] addr; // read address
2222

23+
reg [15:0] data;
24+
reg [7:0] rom [4095:0]; initial $readmemh("../roms/rom.mem", rom, 0, 4095);
25+
2326
reg sclk_prev; always @(posedge clk) sclk_prev <= sclk;
2427
wire sclk_negedge = sclk_prev != sclk && !sclk;
2528
reg [7:0] counter;
@@ -46,11 +49,9 @@ module qspi_rom_emu #(parameter ADDR_BITS = 24) (
4649
end
4750
end
4851

49-
reg [15:0] data;
50-
reg [7:0] rom [4095:0];
51-
initial begin
52-
$readmemh("../roms/rom.mem", rom, 0, 4095);
53-
// DEBUG: override reset vector
54-
// rom[12'hFFD] <= 8'hF0; rom[12'hFFC] <= 8'h00;
55-
end
52+
// // DEBUG: override reset vector
53+
// initial begin
54+
// rom[12'hFFD] <= 8'hF0; rom[12'hFFC] <= 8'h00;
55+
// end
56+
5657
endmodule

test/tb.v

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ module tb ();
2424
wire [7:0] uio_out;
2525
wire [7:0] uio_oe;
2626

27+
qspi_rom_emu qspi_rom_emu(
28+
.clk (clk),
29+
.reset (~rst_n),
30+
.sclk ( uio_out[3]),
31+
.select ( uio_out[0]),
32+
.cmd_addr_in({uio_out[5:4], uio_out[2:1]}),
33+
.data_out ({ uio_in[5:4], uio_in [2:1]}));
34+
2735
// Replace tt_um_example with your module name:
2836
tt_um_rejunity_atari2600 user_project (
2937
.ui_in (ui_in), // Dedicated inputs

0 commit comments

Comments
 (0)