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

Subversion Repositories lxp32

[/] [lxp32/] [trunk/] [verify/] [icache/] [src/] [tb/] [tb.vhd] - Blame information for rev 2

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ring0_mipt
---------------------------------------------------------------------
2
-- LXP32 instruction cache verification environment (self-checking
3
-- testbench)
4
--
5
-- Part of the LXP32 instruction cache testbench
6
--
7
-- Copyright (c) 2016 by Alex I. Kuznetsov
8
--
9
-- Parameters:
10
--     CACHE_BURST_SIZE:     burst size for cache unit
11
--     CACHE_PREFETCH_SIZE:  prefetch distance for cache unit
12
--     CPU_BLOCKS:           number of data blocks to fetch
13
--     VERBOSE:              print more messages
14
---------------------------------------------------------------------
15
 
16
library ieee;
17
use ieee.std_logic_1164.all;
18
 
19
entity tb is
20
        generic(
21
                CACHE_BURST_SIZE: integer:=16;
22
                CACHE_PREFETCH_SIZE: integer:=32;
23
                CPU_BLOCKS: integer:=100000;
24
                VERBOSE: boolean:=false
25
        );
26
end entity;
27
 
28
architecture testbench of tb is
29
 
30
signal clk: std_logic:='0';
31
signal rst: std_logic:='0';
32
 
33
signal lli_re: std_logic;
34
signal lli_adr: std_logic_vector(29 downto 0);
35
signal lli_dat: std_logic_vector(31 downto 0);
36
signal lli_busy: std_logic;
37
 
38
signal wbm_cyc: std_logic;
39
signal wbm_stb: std_logic;
40
signal wbm_cti: std_logic_vector(2 downto 0);
41
signal wbm_bte: std_logic_vector(1 downto 0);
42
signal wbm_ack: std_logic;
43
signal wbm_adr: std_logic_vector(29 downto 0);
44
signal wbm_dat: std_logic_vector(31 downto 0);
45
 
46
signal finish: std_logic:='0';
47
 
48
begin
49
 
50
clk<=not clk and not finish after 5 ns;
51
 
52
dut: entity work.lxp32_icache(rtl)
53
        generic map(
54
                BURST_SIZE=>CACHE_BURST_SIZE,
55
                PREFETCH_SIZE=>CACHE_PREFETCH_SIZE
56
        )
57
        port map(
58
                clk_i=>clk,
59
                rst_i=>rst,
60
 
61
                lli_re_i=>lli_re,
62
                lli_adr_i=>lli_adr,
63
                lli_dat_o=>lli_dat,
64
                lli_busy_o=>lli_busy,
65
 
66
                wbm_cyc_o=>wbm_cyc,
67
                wbm_stb_o=>wbm_stb,
68
                wbm_cti_o=>wbm_cti,
69
                wbm_bte_o=>wbm_bte,
70
                wbm_ack_i=>wbm_ack,
71
                wbm_adr_o=>wbm_adr,
72
                wbm_dat_i=>wbm_dat
73
        );
74
 
75
ram_model_inst: entity work.ram_model(sim)
76
        port map(
77
                clk_i=>clk,
78
 
79
                wbm_cyc_i=>wbm_cyc,
80
                wbm_stb_i=>wbm_stb,
81
                wbm_cti_i=>wbm_cti,
82
                wbm_bte_i=>wbm_bte,
83
                wbm_ack_o=>wbm_ack,
84
                wbm_adr_i=>wbm_adr,
85
                wbm_dat_o=>wbm_dat
86
        );
87
 
88
cpu_model_inst: entity work.cpu_model(sim)
89
        generic map(
90
                BLOCKS=>CPU_BLOCKS,
91
                VERBOSE=>VERBOSE
92
        )
93
        port map(
94
                clk_i=>clk,
95
 
96
                lli_re_o=>lli_re,
97
                lli_adr_o=>lli_adr,
98
                lli_dat_i=>lli_dat,
99
                lli_busy_i=>lli_busy,
100
 
101
                finish_o=>finish
102
        );
103
 
104
end architecture;

powered by: WebSVN 2.1.0

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