OpenCores
URL https://opencores.org/ocsvn/a-z80/a-z80/trunk

Subversion Repositories a-z80

[/] [a-z80/] [trunk/] [cpu/] [control/] [test_pin_control.sv] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 gdevic
//==============================================================
2
// Test pin control unit
3
//==============================================================
4
`timescale 100 ns/ 100 ns
5
 
6
module test_pin_control;
7
 
8
// ----------------- CONTROL ----------------
9
logic fFetch_sig=0;
10
logic fMRead_sig=0;
11
logic fMWrite_sig=0;
12
logic fIORead_sig=0;
13
logic fIOWrite_sig=0;
14
logic T1_sig=0;
15
logic T2_sig=0;
16
logic T3_sig=0;
17
logic T4_sig=0;
18
 
19
// ----------------- STATES ----------------
20
wire bus_ab_pin_we_sig;
21
wire bus_db_pin_oe_sig;
22
wire bus_db_pin_re_sig;
23
 
24
// ----------------- TEST -------------------
25
initial begin
26
    // Initial condition
27
    #1  assert(bus_ab_pin_we_sig==0 && bus_db_pin_oe_sig==0 && bus_db_pin_re_sig==0);
28
 
29
        // Activate formula for each signal
30
        fFetch_sig = 1;
31
        T1_sig = 1;
32
    #1  assert(bus_ab_pin_we_sig==1 && bus_db_pin_oe_sig==0 && bus_db_pin_re_sig==0);
33
        T1_sig = 0;
34
        T3_sig = 1;
35
    #1  assert(bus_ab_pin_we_sig==1 && bus_db_pin_oe_sig==0 && bus_db_pin_re_sig==0);
36
        fFetch_sig = 0;
37
        T1_sig = 0;
38
        T3_sig = 0;
39
    #1  assert(bus_ab_pin_we_sig==0 && bus_db_pin_oe_sig==0 && bus_db_pin_re_sig==0);
40
        // Read phase
41
        fMRead_sig = 1;
42
    #1  assert(bus_ab_pin_we_sig==0 && bus_db_pin_oe_sig==0 && bus_db_pin_re_sig==0);
43
        T1_sig = 1;
44
    #1  assert(bus_ab_pin_we_sig==1 && bus_db_pin_oe_sig==0 && bus_db_pin_re_sig==0);
45
        // Write phase
46
        fMRead_sig = 0;
47
        fMWrite_sig = 1;
48
        fIORead_sig = 0;
49
        fIOWrite_sig = 0;
50
    #1  assert(bus_ab_pin_we_sig==1 && bus_db_pin_oe_sig==0 && bus_db_pin_re_sig==0);
51
        // IO Read phase
52
        fMRead_sig = 0;
53
        fMWrite_sig = 0;
54
        fIORead_sig = 1;
55
        fIOWrite_sig = 0;
56
    #1  assert(bus_ab_pin_we_sig==1 && bus_db_pin_oe_sig==0 && bus_db_pin_re_sig==0);
57
        // IO Write phase
58
        fMRead_sig = 0;
59
        fMWrite_sig = 0;
60
        fIORead_sig = 0;
61
        fIOWrite_sig = 1;
62
    #1  assert(bus_ab_pin_we_sig==1 && bus_db_pin_oe_sig==0 && bus_db_pin_re_sig==0);
63
        fIOWrite_sig = 0;
64
    #1  assert(bus_ab_pin_we_sig==0 && bus_db_pin_oe_sig==0 && bus_db_pin_re_sig==0);
65
 
66
        // Test bus pin control
67
        T2_sig = 1;
68
        fMWrite_sig = 1;
69
    #1  assert(bus_ab_pin_we_sig==1 && bus_db_pin_oe_sig==1 && bus_db_pin_re_sig==0);
70
        fMWrite_sig = 0;
71
        fIORead_sig = 1;
72
    #1  assert(bus_ab_pin_we_sig==1 && bus_db_pin_oe_sig==0 && bus_db_pin_re_sig==0);
73
        T3_sig = 1;
74
    #1  assert(bus_ab_pin_we_sig==1 && bus_db_pin_oe_sig==0 && bus_db_pin_re_sig==1);
75
 
76
    #1  $display("End of test");
77
end
78
 
79
//--------------------------------------------------------------
80
// Instantiate pin control
81
//--------------------------------------------------------------
82
 
83
pin_control pin_control_inst
84
(
85
    .fFetch(fFetch_sig) ,               // input  fFetch_sig
86
    .fMRead(fMRead_sig) ,               // input  fMRead_sig
87
    .fMWrite(fMWrite_sig) ,             // input  fMWrite_sig
88
    .fIORead(fIORead_sig) ,             // input  fIORead_sig
89
    .fIOWrite(fIOWrite_sig) ,           // input  fIOWrite_sig
90
    .T1(T1_sig) ,                       // input  T1_sig
91
    .T2(T2_sig) ,                       // input  T2_sig
92
    .T3(T3_sig) ,                       // input  T3_sig
93
    .T4(T4_sig) ,                       // input  T4_sig
94
    .bus_ab_pin_we(bus_ab_pin_we_sig) , // output  bus_ab_pin_we_sig
95
    .bus_db_pin_oe(bus_db_pin_oe_sig) , // output  bus_db_pin_oe_sig
96
    .bus_db_pin_re(bus_db_pin_re_sig)   // output  bus_db_pin_re_sig
97
);
98
 
99
endmodule

powered by: WebSVN 2.1.0

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