OpenCores
URL https://opencores.org/ocsvn/t6507lp/t6507lp/trunk

Subversion Repositories t6507lp

[/] [t6507lp/] [trunk/] [rtl/] [verilog/] [t6507lp_fsm_tb.v] - Diff between revs 116 and 117

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 116 Rev 117
Line 44... Line 44...
module t6507lp_fsm_tb();
module t6507lp_fsm_tb();
        // mem_rw signals
        // mem_rw signals
        localparam MEM_READ = 1'b0;
        localparam MEM_READ = 1'b0;
        localparam MEM_WRITE = 1'b1;
        localparam MEM_WRITE = 1'b1;
 
 
        reg clk;
        reg clk; // regs are inputs
        reg reset_n;
        reg reset_n;
        reg [7:0] alu_result;
        reg [7:0] alu_result;
        reg [7:0] alu_status;
        reg [7:0] alu_status;
        reg [7:0] data_in;
        reg [7:0] data_in;
 
 
        reg [7:0] alu_x;
        reg [7:0] alu_x;
        reg [7:0] alu_y;
        reg [7:0] alu_y;
 
        wire [12:0] address; // wires are outputs
        wire [12:0] address;
 
        wire mem_rw;
        wire mem_rw;
        wire [7:0] data_out;
        wire [7:0] data_out;
        wire [7:0] alu_opcode;
        wire [7:0] alu_opcode;
        wire [7:0] alu_a;
        wire [7:0] alu_a;
        wire alu_enable;
        wire alu_enable;
 
 
        integer my_i;
        integer my_i;
 
 
        `include "T6507LP_Package.v"
        `include "T6507LP_Package.v"
 
 
        t6507lp_fsm #(8,13) my_dut(
        t6507lp_fsm #(8,13) t6507lp_fsm(
                .clk(clk),
                .clk(clk),
                .reset_n(reset_n),
                .reset_n(reset_n),
                .alu_result(alu_result),
                .alu_result(alu_result),
                .alu_status(alu_status),
                .alu_status(alu_status),
                .data_in(data_in),
                .data_in(data_in),
 
                .alu_x(alu_x),
 
                .alu_y(alu_y),
                .address(address),
                .address(address),
                .mem_rw(mem_rw),
                .mem_rw(mem_rw),
                .data_out(data_out),
                .data_out(data_out),
                .alu_opcode(alu_opcode),
                .alu_opcode(alu_opcode),
                .alu_a(alu_a),
                .alu_a(alu_a),
                .alu_enable(alu_enable),
                .alu_enable(alu_enable)
                .alu_x(alu_x),
 
                .alu_y(alu_y)
 
        );
        );
 
 
        always #10 clk = ~clk;
        always #10 clk = ~clk;
 
 
        reg[7:0] fake_mem[2**13-1:0];
        reg[7:0] fake_mem[2**13-1:0];
 
 
        initial begin
        initial begin
                clk = 0;
                clk = 1'b0;
                reset_n = 1'b0;
                reset_n = 1'b0;
                alu_result = 8'h01;
                alu_result = 8'h01;
                alu_status = 8'h00;
                alu_status = 8'h00;
                alu_x = 8'h07;
                alu_x = 8'h07;
                alu_y = 8'h03;
                alu_y = 8'h03;
Line 97... Line 95...
                for (my_i=0; my_i < 2**13; my_i= my_i+1) begin
                for (my_i=0; my_i < 2**13; my_i= my_i+1) begin
                        $write("\n%d",my_i);
                        $write("\n%d",my_i);
                        fake_mem[my_i]=8'h00;
                        fake_mem[my_i]=8'h00;
                end
                end
 
 
 
 
                fake_mem[0] = ASL_ACC; // testing ACC mode
                fake_mem[0] = ASL_ACC; // testing ACC mode
                fake_mem[1] = ADC_IMM; // testing IMM mode
                fake_mem[1] = ADC_IMM; // testing IMM mode
                fake_mem[2] = 8'h27;
                fake_mem[2] = 8'h27;
                fake_mem[3] = JMP_ABS; // testing ABS mode, JMP type
                fake_mem[3] = JMP_ABS; // testing ABS mode, JMP type
                fake_mem[4] = 8'h09;
                fake_mem[4] = 8'h09;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.