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

Subversion Repositories vhdl_wb_tb

[/] [vhdl_wb_tb/] [trunk/] [rtl/] [vhdl/] [packages/] [wishbone_pkg.vhd] - Blame information for rev 4

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

Line No. Rev Author Line
1 2 sinx
---------------------------------------------------------------------- 
2
----                                                              ---- 
3
----  VHDL Wishbone TESTBENCH                                     ---- 
4
----                                                              ---- 
5
----  This file is part of the vhdl_wb_tb project                 ---- 
6
----  http://www.opencores.org/cores/vhdl_wb_tb/                  ---- 
7
----                                                              ---- 
8
----  This file contains the wishbone_pkg package and defines     ----
9
----  basic wishbone types.                                       ---- 
10
----                                                              ---- 
11
----  This file bases on the file wishbone_pkg.vhd located at     ----
12
----  https://github.com/twlostow/dsi-shield/blob/master/hdl/ip_cores/local/wishbone_pkg.vhd ---
13
----  See this file also for the authors name.                    ---- 
14
----  Its original file was licensed under LGPL 3.0               ---- 
15
----                                                              ---- 
16
----  To Do:                                                      ---- 
17
----   -                                                          ---- 
18
----                                                              ---- 
19
----  Author(s):                                                  ---- 
20 4 sinx
----      - Sinx, sinx@opencores.org                              ---- 
21 2 sinx
----                                                              ---- 
22
---------------------------------------------------------------------- 
23 4 sinx
----    SVN information
24
----
25
----      $URL:  $
26
---- $Revision:  $
27
----     $Date:  $
28
----   $Author:  $
29
----       $Id:  $
30
---------------------------------------------------------------------- 
31 2 sinx
----                                                              ---- 
32
---- Copyright (C) 2018 Authors and OPENCORES.ORG                 ---- 
33
----                                                              ---- 
34
---- This source file may be used and distributed without         ---- 
35
---- restriction provided that this copyright statement is not    ---- 
36
---- removed from the file and that any derivative work contains  ---- 
37
---- the original copyright notice and the associated disclaimer. ---- 
38
----                                                              ---- 
39
---- This source file is free software; you can redistribute it   ---- 
40
---- and/or modify it under the terms of the GNU Lesser General   ---- 
41
---- Public License as published by the Free Software Foundation; ---- 
42
---- either version 2.1 of the License, or (at your option) any   ---- 
43
---- later version.                                               ---- 
44
----                                                              ---- 
45
---- This source is distributed in the hope that it will be       ---- 
46
---- useful, but WITHOUT ANY WARRANTY; without even the implied   ---- 
47
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ---- 
48
---- PURPOSE.  See the GNU Lesser General Public License for more ---- 
49
---- details.                                                     ---- 
50
----                                                              ---- 
51
---- You should have received a copy of the GNU Lesser General    ---- 
52
---- Public License along with this source; if not, download it   ---- 
53
---- from http://www.opencores.org/lgpl.shtml                     ---- 
54
----                                                              ---- 
55
----------------------------------------------------------------------
56
-- library -----------------------------------------------------------
57
library ieee;
58
use ieee.std_logic_1164.all;
59
use ieee.numeric_std.all;
60
library work;
61
use work.my_project_pkg.all;
62
 
63
-- package -----------------------------------------------------------
64
package wishbone_pkg is
65
 
66
  subtype wishbone_address_t is std_logic_vector(wishbone_address_width_c-1 downto 0);
67
  subtype wishbone_data_t is std_logic_vector(wishbone_data_width_c-1 downto 0);
68
  subtype wishbone_byte_select_t is std_logic_vector((wishbone_address_width_c/8)-1 downto 0);
69
  --subtype wishbone_cycle_type_t is std_logic_vector(2 downto 0);
70
  --subtype wishbone_burst_type_t is std_logic_vector(1 downto 0);
71
 
72
  type wishbone_master_out_t is record
73
    -- 2.2.2 Signals Common to MASTER and SLAVE Interfaces 
74
    clk : std_logic; -- clock [mandatory RULE 3.40]
75
    dat : wishbone_data_t; -- data []
76
    rst : std_logic; -- reset [mandatory RULE 3.40]
77
    tgd : wishbone_tag_data_t; -- data tag []
78
    -- 2.2.3 MASTER Signals
79
    adr : wishbone_address_t; -- address [optional]
80
    cyc : std_logic; -- cycle [mandatory RULE 3.40]
81
    lock: std_logic; -- lock []
82
    sel : wishbone_byte_select_t;
83
    stb : std_logic; -- strobe [mandatory RULE 3.40]
84
    tga : wishbone_tag_address_t; -- address tag []
85
    tgc : wishbone_tag_cycle_t; -- cycle tag []
86
    we  : std_logic; -- write enable []
87
  end record wishbone_master_out_t;
88
  subtype wishbone_slave_in_t is wishbone_master_out_t;
89
 
90
  type wishbone_slave_out_t is record
91
    -- 2.2.2 Signals Common to MASTER and SLAVE Interfaces 
92
    dat   : wishbone_data_t; -- read data []
93
    tgd   : wishbone_tag_data_t; -- read data tag []
94
    -- 2.2.4 SLAVE Signals 
95
    ack   : std_logic; -- acknowledge [mandatory RULE 3.40]
96
    err   : std_logic; -- error [optional PERMISSION 3.20]
97
    rty   : std_logic; -- retry [optional PERMISSION 3.25]
98
    --stall : std_logic;
99
    int   : std_logic; -- interrupt [non WB signal]
100
  end record wishbone_slave_out_t;
101
  subtype wishbone_master_in_t is wishbone_slave_out_t;
102
 
103
  -- subtype wishbone_device_descriptor_t is std_logic_vector(255 downto 0);
104
 
105
  -- type wishbone_byte_select_array_t is array(natural range <>) of wishbone_byte_select_t; 
106
  -- type wishbone_data_array_t is array(natural range <>) of wishbone_data_t; 
107
  type wishbone_address_array_t is array(natural range <>) of wishbone_address_t;
108
  type wishbone_master_out_array_t is array (natural range <>) of wishbone_master_out_t;
109
  type wishbone_slave_in_array_t is array (natural range <>) of wishbone_slave_in_t;
110
  -- subtype wishbone_slave_in_array_t is wishbone_master_out_array_t;
111
  type wishbone_slave_out_array_t is array (natural range <>) of wishbone_slave_out_t;
112
  --type wishbone_master_in_array_t is array (natural range <>) of wishbone_master_in_t;
113
  subtype wishbone_master_in_array_t is wishbone_slave_out_array_t;
114
 
115
  constant wb_master_out_idle_c : wishbone_master_out_t := (
116
                                                        clk  =>  '0',
117
                                                        dat  =>  wishbone_data_of_unused_address_c,
118
                                                        rst  =>  '0',
119
                                                        tgd  =>  (others=>'0'),
120
                                                        adr  =>  (others=>'U'),
121
                                                        cyc  =>  '0',
122
                                                        lock =>  '0',
123
                                                        sel  =>  (others=>'0'),
124
                                                        stb  =>  '0',
125
                                                        tga  =>  (others=>'0'),
126
                                                        tgc  =>  (others=>'0'),
127
                                                        we   =>  '0'
128
                                                        );
129
 
130
  -- constant cc_dummy_address : std_logic_vector(wishbone_address_width_c-1 downto 0) :=(others => 'X');
131
  -- constant cc_dummy_data : std_logic_vector(wishbone_address_width_c-1 downto 0) := (others => 'X');
132
  -- constant cc_dummy_sel : std_logic_vector(wishbone_data_width_c/8-1 downto 0) := (others => 'X');
133
  -- constant cc_dummy_slave_in : wishbone_slave_in_t :=('0', '0', cc_dummy_address, cc_dummy_sel, 'X', cc_dummy_data);
134
  -- constant cc_dummy_master_out : wishbone_master_out_t := cc_dummy_slave_in;
135
 
136
  -- -- Dangerous! Will stall a bus.
137
  -- constant cc_dummy_slave_out : wishbone_slave_out_t :=('X', 'X', 'X', 'X', 'X', cc_dummy_data);
138
  -- constant cc_dummy_master_in : wishbone_master_in_t := cc_dummy_slave_out;
139
 
140
  -- constant cc_dummy_address_array : wishbone_address_array_t(0 downto 0) := (0 => cc_dummy_address);
141
 
142
end wishbone_pkg;
143
 
144
-- package body ------------------------------------------------------
145
package body wishbone_pkg is
146
end wishbone_pkg;
147
----------------------------------------------------------------------
148
---- end of file                                                  ---- 
149
----------------------------------------------------------------------

powered by: WebSVN 2.1.0

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