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

Subversion Repositories wishbone_bfm

[/] [wishbone_bfm/] [branches/] [avendor/] [rtl/] [wbtb_1m_1s.vhd] - Blame information for rev 6

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

Line No. Rev Author Line
1 2 amulcock
-------------------------------------------------------------------------------
2
----                                                                       ----
3
---- WISHBONE XXX IP Core                                                  ----
4
----                                                                       ----
5
---- This file is part of the XXX project                                                          ----
6
---- http://www.opencores.org/cores/xxx/                                                   ----
7
----                                                                       ----
8
---- Description                                                           ----
9
---- Implementation of XXX IP core according to                            ----
10
---- XXX IP core specification document.                                   ----
11
----                                                                       ----
12
---- To Do:                                                                ----
13
----    NA                                                                 ----
14
----                                                                       ----
15
---- Author(s):                                                            ----
16
----   Andrew Mulcock, amulcock@opencores.org                              ----
17
----                                                                       ----
18
-------------------------------------------------------------------------------
19
----                                                                       ----
20
---- Copyright (C) 2008 Authors and OPENCORES.ORG                          ----
21
----                                                                       ----
22
---- This source file may be used and distributed without                  ----
23
---- restriction provided that this copyright statement is not             ----
24
---- removed from the file and that any derivative work contains           ----
25
---- the original copyright notice and the associated disclaimer.          ----
26
----                                                                       ----
27
---- This source file is free software; you can redistribute it            ----
28
---- and/or modify it under the terms of the GNU Lesser General            ----
29
---- Public License as published by the Free Software Foundation           ----
30
---- either version 2.1 of the License, or (at your option) any            ----
31
---- later version.                                                        ----
32
----                                                                       ----
33
---- This source is distributed in the hope that it will be                ----
34
---- useful, but WITHOUT ANY WARRANTY; without even the implied            ----
35
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR               ----
36
---- PURPOSE. See the GNU Lesser General Public License for more           ----
37
---- details.                                                              ----
38
----                                                                       ----
39
---- You should have received a copy of the GNU Lesser General             ----
40
---- Public License along with this source; if not, download it            ----
41
---- from http://www.opencores.org/lgpl.shtml                              ----
42
----                                                                       ----
43
-------------------------------------------------------------------------------
44
----                                                                       ----
45
-- CVS Revision History                                                    ----
46
----                                                                       ----
47
-- $Log: not supported by cvs2svn $                                                                   ----
48
----                                                                       ----
49
 
50
--
51
-- wbtb_1m_1s
52
-- 
53
-- this testbench joins together 
54
--  one wishbone master and one wishbone slave,
55
--  along with the required sys_con module
56
--
57
--  having only on emaster and one slave, no logic is 
58
--   required, outputs of one connect to inputs of the other.
59
--
60
 
61
 
62
use work.io_pack.all;
63
 
64
library ieee;
65
use ieee.std_logic_1164.all;
66
 
67
ENTITY wbtb_1m_1s_vhd IS
68
END wbtb_1m_1s_vhd;
69
 
70
ARCHITECTURE behavior OF wbtb_1m_1s_vhd IS
71
 
72
        -- Component Declaration for wishbone system controler
73
        COMPONENT syscon
74
        PORT(
75
        RST_sys    : in  std_logic;
76
        CLK_stop   : in  std_logic;
77
        RST_O      : out std_logic;
78
        CLK_O      : out std_logic
79
                );
80
        END COMPONENT;
81
 
82
        -- Component Declaration for wishbone master
83
        COMPONENT wb_master
84
        PORT(
85 6 amulcock
                RST_I    : IN std_logic;
86
                CLK_I    : IN std_logic;
87
                DAT_I    : IN std_logic_vector(31 downto 0);
88
                ACK_I    : IN std_logic;
89
                ERR_I    : IN std_logic;
90
                RTY_I    : IN std_logic;
91
                SEL_O    : OUT std_logic_vector(3 downto 0);
92
                RST_sys  : OUT std_logic;
93 2 amulcock
                CLK_stop : OUT std_logic;
94 6 amulcock
                ADR_O    : OUT std_logic_vector(31 downto 0);
95
                DAT_O    : OUT std_logic_vector(31 downto 0);
96
                WE_O     : OUT std_logic;
97
                STB_O    : OUT std_logic;
98
                CYC_O    : OUT std_logic;
99
                LOCK_O   : OUT std_logic;
100 2 amulcock
        CYCLE_IS : OUT cycle_type
101
                );
102
        END COMPONENT;
103
 
104
 
105 6 amulcock
        -- Component Declaration for wishbone slave
106
        COMPONENT wb_mem_32x16
107
        PORT(
108
        ACK_O   : out   std_logic;
109
        ADR_I   : in    std_logic_vector( 3 downto 0 );
110
        CLK_I   : in    std_logic;
111
        DAT_I   : in    std_logic_vector( 31 downto 0 );
112
        DAT_O   : out   std_logic_vector( 31 downto 0 );
113
        STB_I   : in    std_logic;
114
        WE_I    : in    std_logic
115
                );
116
        END COMPONENT;
117
 
118 2 amulcock
        --Inputs
119
        SIGNAL RST_I :  std_logic := '0';
120
        SIGNAL CLK_I :  std_logic := '0';
121
        SIGNAL ACK_I :  std_logic := '0';
122
        SIGNAL ERR_I :  std_logic := '0';
123
        SIGNAL RTY_I :  std_logic := '0';
124
        SIGNAL DAT_I :  std_logic_vector(31 downto 0) := (others=>'0');
125
 
126
        --Outputs
127 6 amulcock
        SIGNAL RST_sys  :  std_logic;
128 2 amulcock
        SIGNAL CLK_stop :  std_logic;
129 6 amulcock
        SIGNAL ADR_O    :  std_logic_vector(31 downto 0);
130
        SIGNAL DAT_O    :  std_logic_vector(31 downto 0);
131
        SIGNAL WE_O     :  std_logic;
132
        SIGNAL STB_O    :  std_logic;
133
        SIGNAL CYC_O    :  std_logic;
134
        SIGNAL LOCK_O   :  std_logic;
135
        SIGNAL SEL_O    :  std_logic_vector(3 downto 0);
136 2 amulcock
    SIGNAL CYCLE_IS : cycle_type;
137
 
138
 
139
-- ---------------------------------------------------------------
140
BEGIN
141
-- ---------------------------------------------------------------
142 6 amulcock
 -- module port  => signal name
143 2 amulcock
        -- Instantiate the system controler
144
        sys_con: syscon PORT MAP(
145 6 amulcock
                RST_sys  => RST_sys,
146 2 amulcock
                CLK_stop => CLK_stop,
147 6 amulcock
                RST_O    => RST_I,
148
                CLK_O    => CLK_I
149 2 amulcock
        );
150
 
151
        -- Instantiate the wishbone master
152
        wb_m1: wb_master PORT MAP(
153 6 amulcock
                RST_sys  => RST_sys,
154 2 amulcock
                CLK_stop => CLK_stop,
155 6 amulcock
                RST_I    => RST_I,
156
                CLK_I    => CLK_I,
157
                ADR_O    => ADR_O,
158
                DAT_I    => DAT_I,
159
                DAT_O    => DAT_O,
160
                WE_O     => WE_O,
161
                STB_O    => STB_O,
162
                CYC_O    => CYC_O,
163
                ACK_I    => ACK_I,
164
                ERR_I    => ERR_I,
165
                RTY_I    => RTY_I,
166
                LOCK_O   => LOCK_O,
167
                SEL_O    => SEL_O,
168 2 amulcock
        CYCLE_IS => CYCLE_IS
169
        );
170
 
171
 
172 6 amulcock
        -- Instantiate the wishbone slave
173
        wb_s1: wb_mem_32x16 PORT MAP(
174
        ACK_O => ACK_I,
175
        ADR_I => ADR_O( 3 downto 0 ),
176
        CLK_I => CLK_I,
177
        DAT_I => DAT_O,
178
        DAT_O => DAT_I,
179
        STB_I => STB_O,
180
        WE_I  => WE_O
181
        );
182 2 amulcock
 
183 6 amulcock
 
184 2 amulcock
END;

powered by: WebSVN 2.1.0

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