w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
tb_is61lv25616al.vhd
Go to the documentation of this file.
1-- $Id: tb_is61lv25616al.vhd 1181 2019-07-08 17:00:50Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2007-2011 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Module Name: tb_is61lv25616al - sim
7-- Description: Test bench for is61lv25616al memory model
8--
9-- Dependencies: is61lv25616al [UUT]
10--
11-- To test: is61lv25616al
12--
13-- Verified (with tb_is61lv25616al_stim.dat):
14-- Date Rev Code ghdl ise Target Comment
15-- 2010-05-16 291 - 0.26 - - c:ok
16-- 2007-12-15 101 - 0.26 - - c:ok
17--
18-- Revision History:
19-- Date Rev Version Comment
20-- 2011-11-21 432 1.1.1 now numeric_std clean
21-- 2010-05-16 291 1.1 initial values for all act.low signals now '1'
22-- 2007-12-14 101 1.0 Initial version
23------------------------------------------------------------------------------
24
25library ieee;
26use ieee.std_logic_1164.all;
27use ieee.numeric_std.all;
28use ieee.std_logic_textio.all;
29use std.textio.all;
30
31use work.slvtypes.all;
32use work.simlib.all;
33
36
37architecture sim of tb_is61lv25616al is
38
39 signal CE_N : slbit := '1';
40 signal OE_N : slbit := '1';
41 signal WE_N : slbit := '1';
42 signal UB_N : slbit := '1';
43 signal LB_N : slbit := '1';
44 signal ADDR : slv18 := (others=>'0');
45 signal DATA : slv16 := (others=>'0');
46
47begin
48
49 UUT : entity work.is61lv25616al
50 port map (
51 CE_N => CE_N,
52 OE_N => OE_N,
53 WE_N => WE_N,
54 UB_N => UB_N,
55 LB_N => LB_N,
56 ADDR => ADDR,
57 DATA => DATA
58 );
59
60 proc_stim: process
61 file fstim : text open read_mode is "tb_is61lv25616al_stim";
62 variable iline : line;
63 variable oline : line;
64 variable ok : boolean;
65 variable dname : string(1 to 6) := (others=>' ');
66 variable idtime : Delay_length := 0 ns;
67 variable imatch : boolean := false;
68 variable ival : slbit := '0';
69 variable ival2 : slv2 := (others=>'0');
70 variable ival16 : slv16 := (others=>'0');
71 variable ival18 : slv18 := (others=>'0');
72 variable ice : slbit := '0';
73 variable ioe : slbit := '0';
74 variable iwe : slbit := '0';
75 variable ibe : slv2 := "00";
76 variable iaddr : slv18 := (others=>'0');
77 variable idata : slv16 := (others=>'0');
78 variable ide : slbit := '0';
79 variable idchk : slv16 := (others=>'0');
80
81 begin
82
83 file_loop: while not endfile(fstim) loop
84
85 readline (fstim, iline);
86
87 readcomment(iline, ok);
88 next file_loop when ok;
89
90 readword(iline, dname, ok);
91 if ok then
92 case dname is
93 when "wdo " => -- wdo
94 read_ea(iline, idtime);
95 wait for idtime;
96
97 readtagval_ea(iline, "ce", imatch, ival);
98 if imatch then ice := ival; end if;
99 readtagval_ea(iline, "oe", imatch, ival);
100 if imatch then ioe := ival; end if;
101 readtagval_ea(iline, "we", imatch, ival);
102 if imatch then iwe := ival; end if;
103 readtagval_ea(iline, "be", imatch, ival2, 2);
104 if imatch then ibe := ival2; end if;
105 readtagval_ea(iline, "a", imatch, ival18, 16);
106 if imatch then iaddr := ival18; end if;
107 readtagval_ea(iline, "de", imatch, ival);
108 if imatch then ide := ival; end if;
109 readtagval_ea(iline, "d", imatch, ival16, 16);
110 if imatch then idata := ival16; end if;
111
112 CE_N <= not ice;
113 OE_N <= not ioe;
114 WE_N <= not iwe;
115 LB_N <= not ibe(0);
116 UB_N <= not ibe(1);
117 ADDR <= iaddr;
118 if ide = '1' then
119 DATA <= idata;
120 else
121 DATA <= (others=>'Z');
122 end if;
123
124 write(oline, now, right, 12);
125 write(oline, string'(": wdo "));
126 write(oline, string'(" ce="));
127 write(oline, ice);
128 write(oline, string'(" oe="));
129 write(oline, ioe);
130 write(oline, string'(" we="));
131 write(oline, iwe);
132 write(oline, string'(" be="));
133 write(oline, ibe, right, 2);
134 write(oline, string'(" a="));
135 writegen(oline, iaddr, right, 5, 16);
136 write(oline, string'(" de="));
137 write(oline, ide);
138 if ide = '1' then
139 write(oline, string'(" d="));
140 writegen(oline, idata, right, 4, 16);
141 end if;
142
143 readtagval_ea(iline, "D", imatch, idchk, 16);
144 if imatch then
145 write(oline, string'(" D="));
146 writegen(oline, DATA, right, 4, 16);
147 write(oline, string'(" CHECK"));
148 if DATA = idchk then
149 write(oline, string'(" OK"));
150 else
151 write(oline, string'(" FAIL exp="));
152 writegen(oline, idchk, right, 4, 16);
153 end if;
154 end if;
155
156 writeline(output, oline);
157
158 when others => -- unknown command
159 write(oline, string'("?? unknown command: "));
160 write(oline, dname);
161 writeline(output, oline);
162 report "aborting" severity failure;
163 end case;
164
165 else
166 report "failed to find command" severity failure;
167
168 end if;
169
170 testempty_ea(iline);
171
172 end loop;
173
174 write(oline, now, right, 12);
175 write(oline, string'(": DONE"));
176 writeline(output, oline);
177
178 wait; -- suspend proc_stim forever
179 -- no clock, sim will end
180
181 end process proc_stim;
182
183
184end sim;
in UB_N slbit
in ADDR slv18
in WE_N slbit
in CE_N slbit
in OE_N slbit
in LB_N slbit
inout DATA slv16
std_logic_vector( 17 downto 0) slv18
Definition: slvtypes.vhd:51
std_logic_vector( 15 downto 0) slv16
Definition: slvtypes.vhd:48
std_logic slbit
Definition: slvtypes.vhd:30
std_logic_vector( 1 downto 0) slv2
Definition: slvtypes.vhd:34
slv16 :=( others => '0') DATA
slv18 :=( others => '0') ADDR