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