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

Subversion Repositories lxp32

[/] [lxp32/] [trunk/] [verify/] [lxp32/] [src/] [tb/] [monitor.vhd] - Blame information for rev 9

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 9 ring0_mipt
---------------------------------------------------------------------
2
-- Test monitor
3
--
4
-- Part of the LXP32 testbench
5
--
6
-- Copyright (c) 2016 by Alex I. Kuznetsov
7
--
8
-- Provide means for a test platform to interact with the testbench.
9
---------------------------------------------------------------------
10
 
11
library ieee;
12
use ieee.std_logic_1164.all;
13
use ieee.numeric_std.all;
14
 
15
use work.common_pkg.all;
16
use work.tb_pkg.all;
17
 
18
entity monitor is
19
        generic(
20
                VERBOSE: boolean
21
        );
22
        port(
23
                clk_i: in std_logic;
24
                rst_i: in std_logic;
25
 
26
                wbs_cyc_i: in std_logic;
27
                wbs_stb_i: in std_logic;
28
                wbs_we_i: in std_logic;
29
                wbs_sel_i: in std_logic_vector(3 downto 0);
30
                wbs_ack_o: out std_logic;
31
                wbs_adr_i: in std_logic_vector(27 downto 2);
32
                wbs_dat_i: in std_logic_vector(31 downto 0);
33
                wbs_dat_o: out std_logic_vector(31 downto 0);
34
 
35
                finished_o: out std_logic;
36
                result_o: out std_logic_vector(31 downto 0)
37
        );
38
end entity;
39
 
40
architecture sim of monitor is
41
 
42
signal result: std_logic_vector(31 downto 0):=(others=>'0');
43
signal finished: std_logic:='0';
44
 
45
begin
46
 
47
wbs_ack_o<=wbs_cyc_i and wbs_stb_i;
48
wbs_dat_o<=(others=>'0');
49
 
50
finished_o<=finished;
51
result_o<=result;
52
 
53
process (clk_i) is
54
begin
55
        if rising_edge(clk_i) then
56
                if rst_i='1' then
57
                        finished<='0';
58
                        result<=(others=>'0');
59
                elsif wbs_cyc_i='1' and wbs_stb_i='1' and wbs_we_i='1' then
60
                        assert wbs_sel_i="1111"
61
                                report "Monitor doesn't support byte-granular access "&
62
                                        "(SEL_I() is 0x"&hex_string(wbs_sel_i)&")"
63
                                severity failure;
64
 
65
                        if VERBOSE then
66
                                report "Monitor: value "&
67
                                        "0x"&hex_string(wbs_dat_i)&
68
                                        " written to address "&
69
                                        "0x"&hex_string(wbs_adr_i);
70
                        end if;
71
 
72
                        if unsigned(wbs_adr_i)=to_unsigned(0,wbs_adr_i'length) then
73
                                result<=wbs_dat_i;
74
                                finished<='1';
75
                        end if;
76
                end if;
77
        end if;
78
end process;
79
 
80
end architecture;

powered by: WebSVN 2.1.0

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