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

Subversion Repositories t6507lp

[/] [t6507lp/] [trunk/] [rtl/] [verilog/] [t6507lp_fsm_tb.v] - Blame information for rev 68

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

Line No. Rev Author Line
1 67 creep
////////////////////////////////////////////////////////////////////////////
2
////                                                                    ////
3
//// T6507LP IP Core                                                    ////
4
////                                                                    ////
5
//// This file is part of the T6507LP project                           ////
6
//// http://www.opencores.org/cores/t6507lp/                            ////
7
////                                                                    ////
8
//// Description                                                        ////
9
//// 6507 FSM                                                           ////
10
////                                                                    ////
11
//// TODO:                                                              ////
12
//// - Perform simple tests before going into serious verification      ////
13
////                                                                    ////
14
//// Author(s):                                                         ////
15
//// - Gabriel Oshiro Zardo, gabrieloshiro@gmail.com                    ////
16
//// - Samuel Nascimento Pagliarini (creep), snpagliarini@gmail.com     ////
17
////                                                                    ////
18
////////////////////////////////////////////////////////////////////////////
19
////                                                                    ////
20
//// Copyright (C) 2001 Authors and OPENCORES.ORG                       ////
21
////                                                                    ////
22
//// This source file may be used and distributed without               ////
23
//// restriction provided that this copyright statement is not          ////
24
//// removed from the file and that any derivative work contains        ////
25
//// the original copyright notice and the associated disclaimer.       ////
26
////                                                                    ////
27
//// This source file is free software; you can redistribute it         ////
28
//// and/or modify it under the terms of the GNU Lesser General         ////
29
//// Public License as published by the Free Software Foundation;       ////
30
//// either version 2.1 of the License, or (at your option) any         ////
31
//// later version.                                                     ////
32
////                                                                    ////
33
//// This source is distributed in the hope that it will be             ////
34
//// useful, but WITHOUT ANY WARRANTY; without even the implied         ////
35
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR            ////
36
//// PURPOSE. See the GNU Lesser General Public License for more        ////
37
//// details.                                                           ////
38
////                                                                    ////
39
//// You should have received a copy of the GNU Lesser General          ////
40
//// Public License along with this source; if not, download it         ////
41
//// from http://www.opencores.org/lgpl.shtml                           ////
42
////                                                                    ////
43
////////////////////////////////////////////////////////////////////////////
44
 
45
 
46
`timescale 1ns / 1ps
47
 
48
module t6507lp_fsm_tb();
49
        reg clk_in;
50 68 creep
        reg rst_in_n;
51 67 creep
        reg [7:0] alu_result;
52
        reg [7:0] alu_status;
53
        reg [7:0] data_in;
54
 
55
        wire [12:0] address;
56
        wire control; // one bit is enough? read = 0, write = 1
57
        wire [7:0] data_out;
58
        wire [7:0] alu_opcode;
59
        wire [7:0] alu_a;
60
        wire alu_enable;
61
 
62
        `include "../T6507LP_Package.v"
63
 
64 68 creep
        t6507lp_fsm #(8,13) my_dut(clk_in, rst_in_n, alu_result, alu_status, data_in, address, control, data_out, alu_opcode, alu_a, alu_enable);
65 67 creep
 
66
        always #10 clk_in = ~clk_in;
67
 
68
        initial begin
69
                clk_in = 0;
70
                data_in = ASL_ACC;
71 68 creep
                rst_in_n = 1'b0;
72 67 creep
                alu_result = 0;
73
                alu_status = 0;
74
 
75
                @(negedge clk_in) //will wait for next negative edge of the clock (t=20)
76 68 creep
                rst_in_n=1'b1;
77 67 creep
 
78
                @(negedge clk_in) //will wait for next negative edge of the clock (t=40)
79
                data_in = ROL_ACC;
80
 
81
                @(negedge clk_in) //will wait for next negative edge of the clock (t=60)
82
                data_in = ROR_ACC;
83
 
84
                @(negedge clk_in) //will wait for next negative edge of the clock (t=80)
85
                @(negedge clk_in) //will wait for next negative edge of the clock (t=100)
86
                @(negedge clk_in) //will wait for next negative edge of the clock (t=120)
87
                $finish; // to shut down the simulation
88
        end //initial
89
 
90
 
91
endmodule

powered by: WebSVN 2.1.0

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