Skip to content

Commit

Permalink
Gate level test updated after refactoreing atari system related code …
Browse files Browse the repository at this point in the history
…into a separate atari2600.v file
  • Loading branch information
rejunity committed Nov 7, 2024
1 parent 1f02f30 commit 35a0712
Showing 1 changed file with 121 additions and 121 deletions.
242 changes: 121 additions & 121 deletions test/tb.v
Original file line number Diff line number Diff line change
Expand Up @@ -19,132 +19,132 @@ module tb ();
end

`ifdef GL_TEST
wire TIA_stall_cpu = user_project.\tia.stall_cpu ;
wire TIA_valid_read_cmd = user_project.\tia.valid_read_cmd ;
wire TIA_enabl = user_project.\tia.enabl ;
wire TIA_enam0 = user_project.\tia.enam0 ;
wire TIA_enam1 = user_project.\tia.enam1 ;

wire [5:0] CPU_state = { user_project.\cpu.state[5] ,
user_project.\cpu.state[4] ,
user_project.\cpu.state[3] ,
user_project.\cpu.state[2] ,
user_project.\cpu.state[1] ,
user_project.\cpu.state[0] };
wire CPU_store = user_project.\cpu.store ;
wire CPU_N = user_project.\cpu.N ;
wire CPU_V = user_project.\cpu.V ;
wire CPU_D = user_project.\cpu.D ;
wire CPU_I = user_project.\cpu.I ;
wire CPU_Z = user_project.\cpu.Z ;
wire CPU_C = user_project.\cpu.C ;

wire [1:0] CPU_src_reg = {user_project.\cpu.src_reg[1] ,
user_project.\cpu.src_reg[0] };
wire [1:0] CPU_dst_reg = {user_project.\cpu.dst_reg[1] ,
user_project.\cpu.dst_reg[0] };

wire CPU_plp = user_project.\cpu.plp ;
wire CPU_load_reg = user_project.\cpu.load_reg ;
wire CPU_alu_HC = user_project.\cpu.ALU.HC ;
wire CPU_alu_CO = user_project.\cpu.ALU.CO ;
wire CPU_adj_bcd = user_project.\cpu.adj_bcd ;
wire CPU_adc_sbc = user_project.\cpu.adc_sbc ;
wire CPU_adc_bcd = user_project.\cpu.adc_bcd ;

wire [15:0] PC = { user_project.\cpu.PC[15] ,
user_project.\cpu.PC[14] ,
user_project.\cpu.PC[13] ,
user_project.\cpu.PC[12] ,
user_project.\cpu.PC[11] ,
user_project.\cpu.PC[10] ,
user_project.\cpu.PC[9] ,
user_project.\cpu.PC[8] ,
user_project.\cpu.PC[7] ,
user_project.\cpu.PC[6] ,
user_project.\cpu.PC[5] ,
user_project.\cpu.PC[4] ,
user_project.\cpu.PC[3] ,
user_project.\cpu.PC[2] ,
user_project.\cpu.PC[1] ,
user_project.\cpu.PC[0] };

wire [15:0] ABr ={ user_project.\address_bus_r[12] * 4'b1111,
user_project.\address_bus_r[11] ,
user_project.\address_bus_r[10] ,
user_project.\address_bus_r[9] ,
user_project.\address_bus_r[8] ,
user_project.\address_bus_r[7] ,
user_project.\address_bus_r[6] ,
user_project.\address_bus_r[5] ,
user_project.\address_bus_r[4] ,
user_project.\address_bus_r[3] ,
user_project.\address_bus_r[2] ,
user_project.\address_bus_r[1] ,
user_project.\address_bus_r[0] };

wire [ 7:0] ADD ={ user_project.\cpu.ADD[7] ,
user_project.\cpu.ADD[6] ,
user_project.\cpu.ADD[5] ,
user_project.\cpu.ADD[4] ,
user_project.\cpu.ADD[3] ,
user_project.\cpu.ADD[2] ,
user_project.\cpu.ADD[1] ,
user_project.\cpu.ADD[0] };

wire [ 7:0] DO = { user_project.\cpu.DO[7] ,
user_project.\cpu.DO[6] ,
user_project.\cpu.DO[5] ,
user_project.\cpu.DO[4] ,
user_project.\cpu.DO[3] ,
user_project.\cpu.DO[2] ,
user_project.\cpu.DO[1] ,
user_project.\cpu.DO[0] };
wire [ 7:0] DI = { user_project.\cpu.DI[7] ,
user_project.\cpu.DI[6] ,
user_project.\cpu.DI[5] ,
user_project.\cpu.DI[4] ,
user_project.\cpu.DI[3] ,
user_project.\cpu.DI[2] ,
user_project.\cpu.DI[1] ,
user_project.\cpu.DI[0] };
wire TIA_stall_cpu = user_project.\atari2600.stall_cpu ;
wire TIA_valid_read_cmd = user_project.\atari2600.tia.valid_read_cmd ;
wire TIA_enabl = user_project.\atari2600.tia.enabl ;
wire TIA_enam0 = user_project.\atari2600.tia.enam0 ;
wire TIA_enam1 = user_project.\atari2600.tia.enam1 ;

wire [5:0] CPU_state = { user_project.\atari2600.cpu.state[5] ,
user_project.\atari2600.cpu.state[4] ,
user_project.\atari2600.cpu.state[3] ,
user_project.\atari2600.cpu.state[2] ,
user_project.\atari2600.cpu.state[1] ,
user_project.\atari2600.cpu.state[0] };
wire CPU_store = user_project.\atari2600.cpu.store ;
wire CPU_N = user_project.\atari2600.cpu.N ;
wire CPU_V = user_project.\atari2600.cpu.V ;
wire CPU_D = user_project.\atari2600.cpu.D ;
wire CPU_I = user_project.\atari2600.cpu.I ;
wire CPU_Z = user_project.\atari2600.cpu.Z ;
wire CPU_C = user_project.\atari2600.cpu.C ;

wire [1:0] CPU_src_reg = {user_project.\atari2600.cpu.src_reg[1] ,
user_project.\atari2600.cpu.src_reg[0] };
wire [1:0] CPU_dst_reg = {user_project.\atari2600.cpu.dst_reg[1] ,
user_project.\atari2600.cpu.dst_reg[0] };

wire CPU_plp = user_project.\atari2600.cpu.plp ;
wire CPU_load_reg = user_project.\atari2600.cpu.load_reg ;
wire CPU_alu_HC = user_project.\atari2600.cpu.ALU.HC ;
wire CPU_alu_CO = user_project.\atari2600.cpu.ALU.CO ;
wire CPU_adj_bcd = user_project.\atari2600.cpu.adj_bcd ;
wire CPU_adc_sbc = user_project.\atari2600.cpu.adc_sbc ;
wire CPU_adc_bcd = user_project.\atari2600.cpu.adc_bcd ;

wire [15:0] PC = { user_project.\atari2600.cpu.PC[15] ,
user_project.\atari2600.cpu.PC[14] ,
user_project.\atari2600.cpu.PC[13] ,
user_project.\atari2600.cpu.PC[12] ,
user_project.\atari2600.cpu.PC[11] ,
user_project.\atari2600.cpu.PC[10] ,
user_project.\atari2600.cpu.PC[9] ,
user_project.\atari2600.cpu.PC[8] ,
user_project.\atari2600.cpu.PC[7] ,
user_project.\atari2600.cpu.PC[6] ,
user_project.\atari2600.cpu.PC[5] ,
user_project.\atari2600.cpu.PC[4] ,
user_project.\atari2600.cpu.PC[3] ,
user_project.\atari2600.cpu.PC[2] ,
user_project.\atari2600.cpu.PC[1] ,
user_project.\atari2600.cpu.PC[0] };

wire [15:0] ABr ={ user_project.\atari2600.address_bus_r[12] * 4'b1111,
user_project.\atari2600.address_bus_r[11] ,
user_project.\atari2600.address_bus_r[10] ,
user_project.\atari2600.address_bus_r[9] ,
user_project.\atari2600.address_bus_r[8] ,
user_project.\atari2600.address_bus_r[7] ,
user_project.\atari2600.address_bus_r[6] ,
user_project.\atari2600.address_bus_r[5] ,
user_project.\atari2600.address_bus_r[4] ,
user_project.\atari2600.address_bus_r[3] ,
user_project.\atari2600.address_bus_r[2] ,
user_project.\atari2600.address_bus_r[1] ,
user_project.\atari2600.address_bus_r[0] };

wire [ 7:0] ADD ={ user_project.\atari2600.cpu.ADD[7] ,
user_project.\atari2600.cpu.ADD[6] ,
user_project.\atari2600.cpu.ADD[5] ,
user_project.\atari2600.cpu.ADD[4] ,
user_project.\atari2600.cpu.ADD[3] ,
user_project.\atari2600.cpu.ADD[2] ,
user_project.\atari2600.cpu.ADD[1] ,
user_project.\atari2600.cpu.ADD[0] };

wire [ 7:0] DO = { user_project.\atari2600.cpu.DO[7] ,
user_project.\atari2600.cpu.DO[6] ,
user_project.\atari2600.cpu.DO[5] ,
user_project.\atari2600.cpu.DO[4] ,
user_project.\atari2600.cpu.DO[3] ,
user_project.\atari2600.cpu.DO[2] ,
user_project.\atari2600.cpu.DO[1] ,
user_project.\atari2600.cpu.DO[0] };
wire [ 7:0] DI = { user_project.\atari2600.cpu.DI[7] ,
user_project.\atari2600.cpu.DI[6] ,
user_project.\atari2600.cpu.DI[5] ,
user_project.\atari2600.cpu.DI[4] ,
user_project.\atari2600.cpu.DI[3] ,
user_project.\atari2600.cpu.DI[2] ,
user_project.\atari2600.cpu.DI[1] ,
user_project.\atari2600.cpu.DI[0] };

// SEL_A = 2'd0,
// SEL_S = 2'd1,
// SEL_X = 2'd2,
// SEL_Y = 2'd3;
wire [ 7:0] REG_A = { user_project.\cpu.AXYS[0][7] ,
user_project.\cpu.AXYS[0][6] ,
user_project.\cpu.AXYS[0][5] ,
user_project.\cpu.AXYS[0][4] ,
user_project.\cpu.AXYS[0][3] ,
user_project.\cpu.AXYS[0][2] ,
user_project.\cpu.AXYS[0][1] ,
user_project.\cpu.AXYS[0][0] };
wire [ 7:0] REG_S = { user_project.\cpu.AXYS[1][7] ,
user_project.\cpu.AXYS[1][6] ,
user_project.\cpu.AXYS[1][5] ,
user_project.\cpu.AXYS[1][4] ,
user_project.\cpu.AXYS[1][3] ,
user_project.\cpu.AXYS[1][2] ,
user_project.\cpu.AXYS[1][1] ,
user_project.\cpu.AXYS[1][0] };
wire [ 7:0] REG_X = { user_project.\cpu.AXYS[2][7] ,
user_project.\cpu.AXYS[2][6] ,
user_project.\cpu.AXYS[2][5] ,
user_project.\cpu.AXYS[2][4] ,
user_project.\cpu.AXYS[2][3] ,
user_project.\cpu.AXYS[2][2] ,
user_project.\cpu.AXYS[2][1] ,
user_project.\cpu.AXYS[2][0] };
wire [ 7:0] REG_Y = { user_project.\cpu.AXYS[3][7] ,
user_project.\cpu.AXYS[3][6] ,
user_project.\cpu.AXYS[3][5] ,
user_project.\cpu.AXYS[3][4] ,
user_project.\cpu.AXYS[3][3] ,
user_project.\cpu.AXYS[3][2] ,
user_project.\cpu.AXYS[3][1] ,
user_project.\cpu.AXYS[3][0] };
wire [ 7:0] REG_A = { user_project.\atari2600.cpu.AXYS[0][7] ,
user_project.\atari2600.cpu.AXYS[0][6] ,
user_project.\atari2600.cpu.AXYS[0][5] ,
user_project.\atari2600.cpu.AXYS[0][4] ,
user_project.\atari2600.cpu.AXYS[0][3] ,
user_project.\atari2600.cpu.AXYS[0][2] ,
user_project.\atari2600.cpu.AXYS[0][1] ,
user_project.\atari2600.cpu.AXYS[0][0] };
wire [ 7:0] REG_S = { user_project.\atari2600.cpu.AXYS[1][7] ,
user_project.\atari2600.cpu.AXYS[1][6] ,
user_project.\atari2600.cpu.AXYS[1][5] ,
user_project.\atari2600.cpu.AXYS[1][4] ,
user_project.\atari2600.cpu.AXYS[1][3] ,
user_project.\atari2600.cpu.AXYS[1][2] ,
user_project.\atari2600.cpu.AXYS[1][1] ,
user_project.\atari2600.cpu.AXYS[1][0] };
wire [ 7:0] REG_X = { user_project.\atari2600.cpu.AXYS[2][7] ,
user_project.\atari2600.cpu.AXYS[2][6] ,
user_project.\atari2600.cpu.AXYS[2][5] ,
user_project.\atari2600.cpu.AXYS[2][4] ,
user_project.\atari2600.cpu.AXYS[2][3] ,
user_project.\atari2600.cpu.AXYS[2][2] ,
user_project.\atari2600.cpu.AXYS[2][1] ,
user_project.\atari2600.cpu.AXYS[2][0] };
wire [ 7:0] REG_Y = { user_project.\atari2600.cpu.AXYS[3][7] ,
user_project.\atari2600.cpu.AXYS[3][6] ,
user_project.\atari2600.cpu.AXYS[3][5] ,
user_project.\atari2600.cpu.AXYS[3][4] ,
user_project.\atari2600.cpu.AXYS[3][3] ,
user_project.\atari2600.cpu.AXYS[3][2] ,
user_project.\atari2600.cpu.AXYS[3][1] ,
user_project.\atari2600.cpu.AXYS[3][0] };

`endif

Expand Down

0 comments on commit 35a0712

Please sign in to comment.