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

Subversion Repositories single_port

[/] [single_port/] [tags/] [REL/] [VHDL/] [tb_single_port.vhd] - Blame information for rev 15

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 rpaley_yid
-- $Author: rpaley_yid $
2
-- $Date: 2003-01-14 21:48:11 $
3
-- $Header: /home/marcus/revision_ctrl_test/oc_cvs/cvs/single_port/VHDL/tb_single_port.vhd,v 1.1.1.1 2003-01-14 21:48:11 rpaley_yid Exp $
4
-- $Locker
5
-- $Revision: 1.1.1.1 $
6
-- $State: Exp $
7
 
8
-- --------------------------------------------------------------------------
9
-- 
10
-- Purpose: This file specifies test bench harness for the single_port
11
--          Memory. It also contains the configuration files for all the 
12
--          tests.
13
--
14
-- 
15
-- References: 
16
--   1. The Designer's Guide to VHDL by Peter Ashenden
17
--      ISBN: 1-55860-270-4 (pbk.)
18
--   2. Writing Testbenches - Functional Verification of HDL models by 
19
--      Janick Bergeron | ISBN: 0-7923-7766-4
20
--
21
-- Notes: 
22
--
23
-- --------------------------------------------------------------------------
24
LIBRARY IEEE;
25
LIBRARY WORK;
26
USE IEEE.STD_LOGIC_1164.ALL;
27
USE IEEE.NUMERIC_STD.ALL;
28
USE WORK.linked_list_mem_pkg.ALL;
29
USE WORK.single_port_pkg.all;
30
USE STD.TEXTIO.ALL;
31
 
32
ENTITY tb_single_port IS
33
END ENTITY tb_single_port;
34
 
35
ARCHITECTURE BHV of tb_single_port IS
36
 
37
COMPONENT single_port IS
38
  GENERIC (
39
    rnwtQ : TIME := 1 NS
40
  );
41
  PORT (
42
    d : IN data_inter_typ;
43
    q : OUT data_inter_typ;
44
    a : IN addr_inter_typ;
45
    rnw : IN STD_LOGIC;
46
    dealloc_mem : BOOLEAN
47
);
48
END COMPONENT single_port;
49
 
50
COMPONENT tc_single_port IS
51
  PORT (
52
  to_srv : OUT to_srv_typ;
53
  frm_srv : IN frm_srv_typ
54
);
55
END COMPONENT tc_single_port;
56
 
57
SIGNAL d : data_inter_typ;
58
SIGNAL q : data_inter_typ;
59
SIGNAL a : addr_inter_typ;
60
SIGNAL rnw : STD_LOGIC;
61
SIGNAL dealloc_mem : BOOLEAN;
62
SIGNAL to_srv : to_srv_typ;
63
SIGNAL frm_srv : frm_srv_typ;
64
SIGNAL tie_vdd : STD_LOGIC := '1';
65
BEGIN
66
  dut : single_port
67
    PORT MAP (
68
      d => d,
69
      a => a,
70
      q => q,
71
      rnw => rnw,
72
      dealloc_mem => dealloc_mem
73
  );
74
 
75
  tc : tc_single_port
76
    PORT MAP (
77
    to_srv => to_srv,
78
    frm_srv => frm_srv
79
  );
80
 
81
  single_port_server : PROCESS
82
    VARIABLE frm_srv_v : frm_srv_typ;
83
    CONSTANT ACCESS_DELAY : TIME := 5 NS;
84
  BEGIN
85
    -- Wait until the test case is finished setting up the next memory access.
86
    WAIT ON to_srv'TRANSACTION;
87
    CASE to_srv.do IS
88
      WHEN init =>
89
        ASSERT FALSE
90
          REPORT "initialized"
91
          SEVERITY NOTE;
92
      WHEN read => -- perform memory read
93
        d <= to_srv.data;
94
        a <= to_srv.addr;
95
        rnw <= '1';
96
        -- Wait for data to appear 
97
        WAIT FOR ACCESS_DELAY;
98
      WHEN write => -- perform memory write
99
        d <= to_srv.data;
100
        a <= to_srv.addr;
101
        rnw <= '0';
102
        WAIT FOR ACCESS_DELAY;
103
      WHEN dealloc => -- deallocate the linked list for the LL architecture
104
        dealloc_mem <= true;
105
      WHEN end_test => -- reached the end of the test case
106
        WAIT;
107
    END CASE;
108
    frm_srv_v.data := q;
109
    -- Send message to test case to continue the test.
110
    frm_srv <= frm_srv_v ; WAIT FOR 0 NS;
111
  END PROCESS single_port_server;
112
END BHV;
113
 
114
CONFIGURATION ll_main_cfg OF TB_SINGLE_PORT IS
115
  FOR BHV
116
    FOR dut : single_port
117
      USE ENTITY work.single_port(LinkedList);
118
    END FOR; -- dut 
119
    FOR tc : tc_single_port
120
      USE ENTITY work.tc_single_port(TC0);
121
    END FOR; -- tc;
122
  END FOR; -- BHV
123
END CONFIGURATION ll_main_cfg;
124
 
125
CONFIGURATION ll_error_cfg OF TB_SINGLE_PORT IS
126
  FOR BHV
127
    FOR dut : single_port
128
      USE ENTITY work.single_port(LinkedList);
129
    END FOR; -- dut 
130
    FOR tc : tc_single_port
131
      USE ENTITY work.tc_single_port(TC1);
132
    END FOR; -- tc;
133
  END FOR; -- BHV
134
END CONFIGURATION ll_error_cfg ;
135
 
136
CONFIGURATION mem_main_cfg of TB_SINGLE_PORT IS
137
  FOR BHV
138
    FOR dut : single_port
139
      USE ENTITY work.single_port(ArrayMem);
140
    END FOR; -- dut
141
    FOR tc : tc_single_port
142
      USE ENTITY work.tc_single_port(TC0);
143
    END FOR; -- tc;
144
  END FOR; -- BHV
145
END CONFIGURATION mem_main_cfg;
146
 
147
CONFIGURATION mem_error_cfg of TB_SINGLE_PORT IS
148
  FOR BHV
149
    FOR dut : single_port
150
      USE ENTITY work.single_port(ArrayMem);
151
    END FOR; -- dut
152
    FOR tc : tc_single_port
153
      USE ENTITY work.tc_single_port(TC1);
154
    END FOR; -- tc;
155
  END FOR; -- BHV
156
END CONFIGURATION mem_error_cfg;
157
 
158
CONFIGURATION memnoflag_main_cfg of TB_SINGLE_PORT IS
159
  FOR BHV
160
    FOR dut : single_port
161
      USE ENTITY work.single_port(ArrayMemNoFlag);
162
    END FOR; -- dut
163
    FOR tc : tc_single_port
164
      USE ENTITY work.tc_single_port(TC0);
165
    END FOR; -- tc;
166
  END FOR; -- BHV
167
END CONFIGURATION memnoflag_main_cfg;
168
 
169
CONFIGURATION memnoflag_error_cfg of TB_SINGLE_PORT IS
170
  FOR BHV
171
    FOR dut : single_port
172
      USE ENTITY work.single_port(ArrayMemNoFlag);
173
    END FOR; -- dut
174
    FOR tc : tc_single_port
175
      USE ENTITY work.tc_single_port(TC1);
176
    END FOR; -- tc;
177
  END FOR; -- BHV
178
END CONFIGURATION memnoflag_error_cfg;
179
 
180
-- $Log: not supported by cvs2svn $
181
-- Revision 1.1  2003/01/14 17:49:04  Default
182
-- Initial revision
183
--
184
-- Revision 1.2  2002/12/31 19:19:43  Default
185
-- Updated 'transaction statements for fixed simulator.
186
--
187
-- Revision 1.1  2002/12/24 18:10:18  Default
188
-- Initial revision
189
--
190
 
191
 

powered by: WebSVN 2.1.0

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