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

Subversion Repositories t6507lp

[/] [t6507lp/] [trunk/] [sim/] [T6507LP_ULA/] [T6507LP_ALU_TestBench.v] - Blame information for rev 142

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 79 gabrielosh
`timescale 1ns / 1ps
2
module T6507LP_ALU_TestBench(input dummy,output error);
3
 
4
`include  "T6507LP_Package.v"
5
 
6
reg clk_i;
7
reg n_rst_i;
8
reg alu_enable;
9
wire [7:0] alu_result;
10
wire [7:0] alu_status;
11
reg [7:0] alu_opcode;
12
reg [7:0] alu_a;
13
 
14
//`include "T6507LP_Package.v"
15
 
16
T6507LP_ALU DUT (
17
                        .clk_i          (clk_i),
18
                        .n_rst_i        (n_rst_i),
19
                        .alu_enable     (alu_enable),
20
                        .alu_result     (alu_result),
21
                        .alu_status     (alu_status),
22
                        .alu_opcode     (alu_opcode),
23
                        .alu_a          (alu_a)
24
                );
25 113 gabrielosh
 
26 81 gabrielosh
/*
27 79 gabrielosh
localparam period = 10;
28
 
29
always begin
30
        #(period/2) clk_i = ~clk_i;
31
end
32
 
33
 
34
initial
35
begin
36
        clk_i = 0;
37
        n_rst_i = 1;
38
        @(negedge clk_i);
39 113 gabrielosh
        n_rst_i = 0;
40
        alu_opcode = LDA_IMM;
41
        alu_a = 0;
42
        @(negedge clk_i);
43 79 gabrielosh
        alu_opcode = ADC_IMM;
44
        alu_a = 1;
45
        while (1) begin
46 80 gabrielosh
                $display("op1 = %h op2 =  c = %h d = %h n = %h v = %h ", alu_a, alu_status[C], alu_status[D], alu_status[N], alu_status[V]);
47 79 gabrielosh
        end
48
        $finish;
49 113 gabrielosh
end
50 81 gabrielosh
*/
51 79 gabrielosh
endmodule
52
 

powered by: WebSVN 2.1.0

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