Line 1... |
Line 1... |
-- $Id: rritb_rbmon.vhd 314 2010-07-09 17:38:41Z mueller $
|
-- $Id: rb_mon.vhd 346 2010-12-22 22:59:26Z mueller $
|
--
|
--
|
-- Copyright 2007-2010 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
-- Copyright 2007-2010 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
--
|
--
|
-- This program is free software; you may redistribute and/or modify it under
|
-- This program is free software; you may redistribute and/or modify it under
|
-- the terms of the GNU General Public License as published by the Free
|
-- the terms of the GNU General Public License as published by the Free
|
Line 10... |
Line 10... |
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
|
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
|
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
-- for complete details.
|
-- for complete details.
|
--
|
--
|
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
-- Module Name: rritb_rbmon - sim
|
-- Module Name: rb_mon - sim
|
-- Description: rritb: rri rbus monitor
|
-- Description: rbus monitor (for tb's)
|
--
|
--
|
-- Dependencies: -
|
-- Dependencies: -
|
-- Test bench: -
|
-- Test bench: -
|
-- Tool versions: xst 8.1, 8.2, 9.1, 9.2; ghdl 0.18-0.25
|
-- Tool versions: xst 8.1, 8.2, 9.1, 9.2, 12.1; ghdl 0.18-0.29
|
|
--
|
-- Revision History:
|
-- Revision History:
|
-- Date Rev Version Comment
|
-- Date Rev Version Comment
|
|
-- 2010-12-22 346 3.0 renamed rritb_rbmon -> rb_mon
|
-- 2010-06-05 301 2.1.1 renamed _rpmon -> _rbmon
|
-- 2010-06-05 301 2.1.1 renamed _rpmon -> _rbmon
|
-- 2010-06-03 299 2.1 new init encoding (WE=0/1 int/ext)
|
-- 2010-06-03 299 2.1 new init encoding (WE=0/1 int/ext)
|
-- 2010-05-02 287 2.0.1 rename RP_STAT->RB_STAT,AP_LAM->RB_LAM
|
-- 2010-05-02 287 2.0.1 rename RP_STAT->RB_STAT,AP_LAM->RB_LAM
|
-- drop RP_IINT signal from interfaces
|
-- drop RP_IINT signal from interfaces
|
-- 2008-08-24 162 2.0 with new rb_mreq/rb_sres interface
|
-- 2008-08-24 162 2.0 with new rb_mreq/rb_sres interface
|
Line 37... |
Line 39... |
use ieee.std_logic_textio.all;
|
use ieee.std_logic_textio.all;
|
use std.textio.all;
|
use std.textio.all;
|
|
|
use work.slvtypes.all;
|
use work.slvtypes.all;
|
use work.simlib.all;
|
use work.simlib.all;
|
use work.rrilib.all;
|
use work.rblib.all;
|
|
|
entity rritb_rbmon is -- rritb, rri rbus monitor
|
entity rb_mon is -- rbus monitor (for tb's)
|
generic (
|
generic (
|
DBASE : positive := 2); -- base for writing data values
|
DBASE : positive := 2); -- base for writing data values
|
port (
|
port (
|
CLK : in slbit; -- clock
|
CLK : in slbit; -- clock
|
CLK_CYCLE : in slv31 := (others=>'0'); -- clock cycle number
|
CLK_CYCLE : in slv31 := (others=>'0'); -- clock cycle number
|
Line 51... |
Line 53... |
RB_MREQ : in rb_mreq_type; -- rbus: request
|
RB_MREQ : in rb_mreq_type; -- rbus: request
|
RB_SRES : in rb_sres_type; -- rbus: response
|
RB_SRES : in rb_sres_type; -- rbus: response
|
RB_LAM : in slv16 := (others=>'0'); -- rbus: look at me
|
RB_LAM : in slv16 := (others=>'0'); -- rbus: look at me
|
RB_STAT : in slv3 -- rbus: status flags
|
RB_STAT : in slv3 -- rbus: status flags
|
);
|
);
|
end rritb_rbmon;
|
end rb_mon;
|
|
|
|
|
architecture sim of rritb_rbmon is
|
architecture sim of rb_mon is
|
|
|
begin
|
begin
|
|
|
proc_rbmoni: process
|
proc_moni: process
|
variable oline : line;
|
variable oline : line;
|
variable nhold : integer := 0;
|
variable nhold : integer := 0;
|
variable data : slv16 := (others=>'0');
|
variable data : slv16 := (others=>'0');
|
variable tag : string(1 to 8) := (others=>' ');
|
variable tag : string(1 to 8) := (others=>' ');
|
variable err : slbit := '0';
|
variable err : slbit := '0';
|
Line 97... |
Line 99... |
wait until ENA='1'; -- stall process till enabled
|
wait until ENA='1'; -- stall process till enabled
|
end if;
|
end if;
|
|
|
wait until CLK'event and CLK='1'; -- check at end of clock cycle
|
wait until CLK'event and CLK='1'; -- check at end of clock cycle
|
|
|
if RB_MREQ.req = '1' then
|
if RB_MREQ.aval='1' and (RB_MREQ.re='1' or RB_MREQ.we='1') then
|
if RB_SRES.err = '1' then
|
if RB_SRES.err = '1' then
|
err := '1';
|
err := '1';
|
end if;
|
end if;
|
if RB_SRES.busy = '1' then
|
if RB_SRES.busy = '1' then
|
nhold := nhold + 1;
|
nhold := nhold + 1;
|
else
|
else
|
if RB_MREQ.req = '1' then
|
data := (others=>'0');
|
if RB_MREQ.we = '0' then
|
tag := ": ???? ";
|
|
if RB_MREQ.re = '1' then
|
data := RB_SRES.dout;
|
data := RB_SRES.dout;
|
tag := ": rbre ";
|
tag := ": rbre ";
|
else
|
end if;
|
|
if RB_MREQ.we = '1' then
|
data := RB_MREQ.din;
|
data := RB_MREQ.din;
|
tag := ": rbwe ";
|
tag := ": rbwe ";
|
end if;
|
end if;
|
end if;
|
|
|
|
write_data(oline, tag, data, nhold, err='1', " ERR='1'");
|
write_data(oline, tag, data, nhold, err='1', " ERR='1'");
|
nhold := 0;
|
nhold := 0;
|
end if;
|
end if;
|
|
|
Line 139... |
Line 142... |
if unsigned(RB_LAM) /= 0 then
|
if unsigned(RB_LAM) /= 0 then
|
write_data(oline, ": rblam ", RB_LAM, 0, true, " RB_LAM active");
|
write_data(oline, ": rblam ", RB_LAM, 0, true, " RB_LAM active");
|
end if;
|
end if;
|
|
|
end loop;
|
end loop;
|
end process proc_rbmoni;
|
end process proc_moni;
|
|
|
end sim;
|
end sim;
|
|
|
No newline at end of file
|
No newline at end of file
|