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

Subversion Repositories mips_enhanced

[/] [mips_enhanced/] [trunk/] [grlib-gpl-1.0.19-b3188/] [designs/] [leon3-gr-cpci-ax/] [testmod.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dimamali
------------------------------------------------------------------------------
2
--  LEON3 Demonstration design test bench
3
--  Copyright (C) 2004 Jiri Gaisler, Gaisler Research
4
--
5
--  This program is free software; you can redistribute it and/or modify
6
--  it under the terms of the GNU General Public License as published by
7
--  the Free Software Foundation; either version 2 of the License, or
8
--  (at your option) any later version.
9
--
10
--  This program is distributed in the hope that it will be useful,
11
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
--  GNU General Public License for more details.
14
------------------------------------------------------------------------------
15
 
16
library ieee;
17
use ieee.std_logic_1164.all;
18
library gaisler;
19
use gaisler.sim.all;
20
library grlib;
21
use grlib.stdlib.all;
22
use grlib.stdio.all;
23
use grlib.tech.all;
24
 
25
use std.textio.all;
26
 
27
use work.config.all;    -- configuration
28
 
29
entity testmod is
30
  port (
31
    resetn      : in  std_ulogic;
32
    clk         : in  std_ulogic;
33
    errorn      : in std_ulogic;
34
    address     : in std_logic_vector(21 downto 2);
35
    data        : inout std_logic_vector(31 downto 0);
36
    cb          : inout std_logic_vector(7 downto 0);
37
    romsn       : in std_logic_vector(1 downto 0);
38
    ramsn       : in std_logic_vector(3 downto 0);
39
    iosn        : in std_ulogic;
40
    oen         : in std_ulogic;
41
    rwen        : in std_logic_vector(3 downto 0);
42
    writen      : in std_ulogic;
43
    brdyn       : out  std_ulogic
44
 );
45
 
46
end;
47
 
48
architecture sim of testmod is
49
subtype msgtype is string(1 to 40);
50
constant ntests : integer := 11;
51
type msgarr is array (0 to ntests) of msgtype;
52
constant msg : msgarr := (
53
    "*** Starting GRLIB system test ***      ", -- 0
54
    "Test completed OK, halting simulation   ", -- 1
55
    "Test FAILED                             ", -- 2
56
    "Leon3 register file                     ", -- 3
57
    "Leon3 multiplier                        ", -- 4
58
    "Leon3 divider                           ", -- 5
59
    "Leon3 cache system                      ", -- 6
60
    "APB uart                                ", -- 7
61
    "FT sram controller                      ", -- 8
62
    "GPIO port                               ", -- 9
63
    "Cache memory                            ", -- 10
64
    "Interrupt controller                    "  -- 11
65
);
66
 
67
signal ior, iow : std_ulogic;
68
 
69
begin
70
 
71
  ior <= iosn or oen;
72
  iow <= iosn or writen;
73
 
74
  data <= (others => 'Z');
75
  cb   <= (others => 'Z');
76
 
77
  log : process(ior, iow)
78
  variable a, d, d2 : integer;
79
  begin
80
    brdyn <= '0';
81
    if rising_edge(iow) then
82
      a := conv_integer(address(7 downto 2));
83
      d := conv_integer(data(7 downto 0));
84
      d2 := conv_integer(data(15 downto 8));
85
      if (d >= 0) and (d <= ntests) then
86
        if a = 0 then
87
          print(msg(d));
88
        else
89
          print(msg(d) & "failed (" & tost(d2) & ")");
90
        end if;
91
      end if;
92
    end if;
93
  end process;
94
end;
95
 

powered by: WebSVN 2.1.0

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