1 |
9 |
wfjm |
-- $Id: rb_sres_or_mon.vhd 347 2010-12-24 12:10:42Z mueller $
|
2 |
2 |
wfjm |
--
|
3 |
|
|
-- Copyright 2010- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
4 |
|
|
--
|
5 |
|
|
-- This program is free software; you may redistribute and/or modify it under
|
6 |
|
|
-- the terms of the GNU General Public License as published by the Free
|
7 |
|
|
-- Software Foundation, either version 2, or at your option any later version.
|
8 |
|
|
--
|
9 |
|
|
-- This program is distributed in the hope that it will be useful, but
|
10 |
|
|
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
|
11 |
|
|
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
12 |
|
|
-- for complete details.
|
13 |
|
|
--
|
14 |
|
|
------------------------------------------------------------------------------
|
15 |
9 |
wfjm |
-- Module Name: rb_sres_or_mon - sim
|
16 |
|
|
-- Description: rbus result or monitor
|
17 |
2 |
wfjm |
--
|
18 |
|
|
-- Dependencies: -
|
19 |
|
|
-- Test bench: -
|
20 |
|
|
-- Tool versions: ghdl 0.29
|
21 |
9 |
wfjm |
--
|
22 |
2 |
wfjm |
-- Revision History:
|
23 |
|
|
-- Date Rev Version Comment
|
24 |
9 |
wfjm |
-- 2010-12-23 347 3.0 rename rritb_sres_or_mon->rb_sres_or_mon
|
25 |
8 |
wfjm |
-- 2010-10-28 336 1.0.1 log errors only if now>0ns (drop startup glitches)
|
26 |
2 |
wfjm |
-- 2010-06-26 309 1.0 Initial version
|
27 |
|
|
------------------------------------------------------------------------------
|
28 |
|
|
|
29 |
|
|
library ieee;
|
30 |
|
|
use ieee.std_logic_1164.all;
|
31 |
|
|
use ieee.std_logic_textio.all;
|
32 |
|
|
use std.textio.all;
|
33 |
|
|
|
34 |
|
|
use work.slvtypes.all;
|
35 |
9 |
wfjm |
use work.rblib.all;
|
36 |
2 |
wfjm |
|
37 |
|
|
-- ----------------------------------------------------------------------------
|
38 |
|
|
|
39 |
9 |
wfjm |
entity rb_sres_or_mon is -- rbus result or monitor
|
40 |
2 |
wfjm |
port (
|
41 |
|
|
RB_SRES_1 : in rb_sres_type; -- rb_sres input 1
|
42 |
|
|
RB_SRES_2 : in rb_sres_type; -- rb_sres input 2
|
43 |
|
|
RB_SRES_3 : in rb_sres_type := rb_sres_init; -- rb_sres input 3
|
44 |
|
|
RB_SRES_4 : in rb_sres_type := rb_sres_init -- rb_sres input 4
|
45 |
|
|
);
|
46 |
9 |
wfjm |
end rb_sres_or_mon;
|
47 |
2 |
wfjm |
|
48 |
9 |
wfjm |
architecture sim of rb_sres_or_mon is
|
49 |
2 |
wfjm |
|
50 |
|
|
begin
|
51 |
|
|
|
52 |
|
|
proc_comb : process (RB_SRES_1, RB_SRES_2, RB_SRES_3, RB_SRES_4)
|
53 |
|
|
constant dzero : slv16 := (others=>'0');
|
54 |
|
|
variable oline : line;
|
55 |
|
|
variable nack : integer := 0;
|
56 |
|
|
variable nbusy : integer := 0;
|
57 |
|
|
variable nerr : integer := 0;
|
58 |
|
|
variable ndout : integer := 0;
|
59 |
|
|
begin
|
60 |
|
|
|
61 |
|
|
nack := 0;
|
62 |
|
|
nbusy := 0;
|
63 |
|
|
nerr := 0;
|
64 |
|
|
ndout := 0;
|
65 |
|
|
|
66 |
|
|
if RB_SRES_1.ack /= '0' then nack := nack + 1; end if;
|
67 |
|
|
if RB_SRES_2.ack /= '0' then nack := nack + 1; end if;
|
68 |
|
|
if RB_SRES_3.ack /= '0' then nack := nack + 1; end if;
|
69 |
|
|
if RB_SRES_4.ack /= '0' then nack := nack + 1; end if;
|
70 |
|
|
|
71 |
|
|
if RB_SRES_1.busy /= '0' then nbusy := nbusy + 1; end if;
|
72 |
|
|
if RB_SRES_2.busy /= '0' then nbusy := nbusy + 1; end if;
|
73 |
|
|
if RB_SRES_3.busy /= '0' then nbusy := nbusy + 1; end if;
|
74 |
|
|
if RB_SRES_4.busy /= '0' then nbusy := nbusy + 1; end if;
|
75 |
|
|
|
76 |
|
|
if RB_SRES_1.err /= '0' then nerr := nerr + 1; end if;
|
77 |
|
|
if RB_SRES_2.err /= '0' then nerr := nerr + 1; end if;
|
78 |
|
|
if RB_SRES_3.err /= '0' then nerr := nerr + 1; end if;
|
79 |
|
|
if RB_SRES_4.err /= '0' then nerr := nerr + 1; end if;
|
80 |
|
|
|
81 |
|
|
if RB_SRES_1.dout /= dzero then ndout := ndout + 1; end if;
|
82 |
|
|
if RB_SRES_2.dout /= dzero then ndout := ndout + 1; end if;
|
83 |
|
|
if RB_SRES_3.dout /= dzero then ndout := ndout + 1; end if;
|
84 |
|
|
if RB_SRES_4.dout /= dzero then ndout := ndout + 1; end if;
|
85 |
|
|
|
86 |
8 |
wfjm |
if now > 0 ns and (nack>1 or nbusy>1 or nerr>1 or ndout>1) then
|
87 |
2 |
wfjm |
write(oline, now, right, 12);
|
88 |
|
|
if nack > 1 then
|
89 |
|
|
write(oline, string'(" #ack="));
|
90 |
|
|
write(oline, nack);
|
91 |
|
|
end if;
|
92 |
|
|
if nbusy > 1 then
|
93 |
|
|
write(oline, string'(" #busy="));
|
94 |
|
|
write(oline, nbusy);
|
95 |
|
|
end if;
|
96 |
|
|
if nerr > 1 then
|
97 |
|
|
write(oline, string'(" #err="));
|
98 |
|
|
write(oline, nerr);
|
99 |
|
|
end if;
|
100 |
|
|
if ndout > 1 then
|
101 |
|
|
write(oline, string'(" #dout="));
|
102 |
|
|
write(oline, ndout);
|
103 |
|
|
end if;
|
104 |
|
|
write(oline, string'(" FAIL in "));
|
105 |
9 |
wfjm |
write(oline, rb_sres_or_mon'path_name);
|
106 |
2 |
wfjm |
writeline(output, oline);
|
107 |
|
|
end if;
|
108 |
|
|
|
109 |
|
|
end process proc_comb;
|
110 |
|
|
|
111 |
|
|
end sim;
|