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

Subversion Repositories axi4_tlm_bfm

[/] [axi4_tlm_bfm/] [trunk/] [rtl/] [quartus-synthesis/] [pkg-axi-tlm.vhdl] - Blame information for rev 44

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 9 daniel.kho
/*
2
        This file is part of the AXI4 Transactor and Bus Functional Model
3
        (axi4_tlm_bfm) project:
4
                http://www.opencores.org/project,axi4_tlm_bfm
5 44 daniel.kho
 
6 9 daniel.kho
        Description
7
        Implementation of AXI4 transactor data structures and high-level API.
8
 
9
        To Do:
10
 
11
        Author(s):
12
        - Daniel C.K. Kho, daniel.kho@opencores.org | daniel.kho@tauhop.com
13
 
14
        Copyright (C) 2012-2013 Authors and OPENCORES.ORG
15
 
16
        This source file may be used and distributed without
17
        restriction provided that this copyright statement is not
18
        removed from the file and that any derivative work contains
19
        the original copyright notice and the associated disclaimer.
20
 
21
        This source file is free software; you can redistribute it
22
        and/or modify it under the terms of the GNU Lesser General
23
        Public License as published by the Free Software Foundation;
24
        either version 2.1 of the License, or (at your option) any
25
        later version.
26
 
27
        This source is distributed in the hope that it will be
28
        useful, but WITHOUT ANY WARRANTY; without even the implied
29
        warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
30
        PURPOSE. See the GNU Lesser General Public License for more
31
        details.
32
 
33
        You should have received a copy of the GNU Lesser General
34
        Public License along with this source; if not, download it
35
        from http://www.opencores.org/lgpl.shtml.
36
*/
37
/* FIXME VHDL-2008 instantiated package. Unsupported by VCS-MX, Quartus, and Vivado. QuestaSim/ModelSim supports well. */
38
library ieee; use ieee.std_logic_1164.all, ieee.numeric_std.all;
39
--use std.textio.all;
40
library tauhop;
41
 
42
/* Record I/O data structures for AXI interface transactor (block interface). */
43
package axiTLM is
44
--      generic(
45
--              type t_qualifier; type t_id; type t_dest; type t_user; type t_resp;
46 17 daniel.kho
--              package i_transactor is new tauhop.tlm generic map(<>)
47 9 daniel.kho
--      );
48 17 daniel.kho
--      /* Makes i_transactor.t_addr, i_transactor.t_msg, and i_transactor.t_cnt visible. */
49
--      use i_transactor.all;
50 9 daniel.kho
 
51
        /* TODO remove once generic packages are supported. */
52
        use tauhop.tlm.all;
53 12 daniel.kho
        --type boolean_vector is array(natural range<>) of boolean;
54
        --subtype t_qualifier is boolean_vector(32/8-1 downto 0);
55 9 daniel.kho
        subtype t_qualifier is std_ulogic_vector(32/8-1 downto 0);
56
        subtype t_id is unsigned(31 downto 0);
57
        subtype t_dest is unsigned(3 downto 0);
58
        subtype t_user is unsigned(7 downto 0);
59
        subtype t_resp is unsigned(1 downto 0);          --2 bits. b"00" = OKAY, b"01" = ExOKAY, b"10" = SLVERR (slave error), b"11" = DECERR (decode error).
60
 
61
        /* AXI Transactor block interfaces. */
62
        type t_axi4Transactor_m2s is record
63
                /* Address must be unresolved, because you need to drive the read address only when read is asserted, and
64
                        drive the write address when write is asserted. Resolution functions are not expected to know how to decide this.
65
                */
66
                /* Write address channel. */
67
                awId:t_id;
68
--              awLen:unsigned(7 downto 0);             --8 bits as defined by the standard.
69
--              awSize:unsigned(2 downto 0);    --3 bits as defined by the standard. Burst size for write transfers.
70
--              awBurst:
71
--              awLock:
72
--              awCache:
73
--              awQoS:
74
--              awRegion:
75
--              awUser:
76
                -- AXI4-Lite required signals.
77
                awAddr:t_addr;
78
                awProt:boolean;
79
                awValid:boolean;
80
 
81
                /* Write data channel. */
82
                wId:t_id;
83
--              wLast:
84
--              wUser:
85
                -- AXI4-Lite required signals.
86
                wValid:boolean;
87
                wData:t_msg;
88
--              wStrb:std_ulogic_vector(wData'length/8-1 downto 0);     --default is all ones if master always performs full datawidth write transactions.
89
                wStrb:t_qualifier;      --default is all ones if master always performs full datawidth write transactions.
90
 
91
                /* Write response channel. */
92
                bReady:boolean;
93
 
94
                /* Read address channel. */
95
                arId:t_id;
96
--              arLen:unsigned(7 downto 0);             --8 bits as defined by the standard.
97
--              arSize:unsigned(2 downto 0);    --3 bits as defined by the standard.
98
--              arBurst:
99
--              arLock:
100
--              arCache:
101
--              arQoS:
102
--              arRegion:
103
--              arUser:
104
                -- AXI4-Lite required signals.
105
                arValid:boolean;
106
                arAddr:t_addr;
107
                arProt:boolean;
108
 
109
                /* Read data channel. */
110
                rReady:boolean;
111
        end record t_axi4Transactor_m2s;
112
 
113
        type t_axi4Transactor_s2m is record
114
                /* Write address channel. */
115
                awReady:boolean;
116
 
117
                /* Write data channel. */
118
                wReady:boolean;
119
 
120
                /* Write response channel. */
121
                bId:t_id;
122
--              bUser:
123
                -- AXI4-Lite required signals.
124
                bValid:boolean;
125
                bResp:t_resp;
126
 
127
                /* Read address channel. */
128
                arReady:boolean;
129
 
130
                /* Read data channel. */
131
                rId:t_id;
132
--              rLast:
133
--              rUser:
134
                -- AXI4-Lite required signals.
135
                rValid:boolean;
136
                rData:t_msg;
137
                rResp:t_resp;
138
        end record t_axi4Transactor_s2m;
139
 
140
        type t_axi4StreamTransactor_m2s is record
141
                /* AXI4 streaming interface. */
142
                tValid:boolean;
143
                tData:t_msg;
144
                tStrb:t_qualifier;
145
                tKeep:t_qualifier;
146
                tLast:boolean;
147
                tId:t_id;
148
                tDest:t_dest;
149
                tUser:t_user;
150
        end record t_axi4StreamTransactor_m2s;
151
 
152
        type t_axi4StreamTransactor_s2m is record
153
                tReady:boolean;
154
        end record t_axi4StreamTransactor_s2m;
155
 
156
--      /* AXI Low-power interface. */
157
--      type tAxiTransactor_lp is record
158
--              cSysReq:
159
--              cSysAck:
160
--              cActive:
161
--      end record tAxiTransactor_lp;
162
end package axiTLM;
163
 
164
package body axiTLM is
165
end package body axiTLM;
166
 
167
 
168
/* AXI Transactor API.
169
 *      Generally, transactors are high-level bus interface models that perform
170
 *              read/write transactions to/from the bus. These models are not concerned
171
 *              with the low-level implementation of the bus protocol. However, the
172
 *              TLM models encapsulate the lower-level models known as the BFM.
173
 *      axiTLM uses generic package tauhop.tlm, hence inherits basic TLM types and
174
 *              procedures generally used in any messaging system (i.e. address and message
175
 *              information, and bus read/write methods). It also extends the tauhop.tlm
176
 *              package with application-specific types, such as record structures specific
177
 *              to the AXI protocol.
178
 *      axiTransactor instantiates the axiTLM, and assigns specific types to the
179
 *              transactor model.
180
 */
181
/*library ieee; use ieee.std_logic_1164.all, ieee.numeric_std.all;
182
library tauhop;
183
package transactor is new tauhop.tlm generic map(
184
        t_addr=>unsigned(31 downto 0),           -- default assignment. Used only for non-stream interfaces.
185
        t_msg=>signed(63 downto 0),
186
        t_cnt=>unsigned(127 downto 0)
187
);
188
 
189
library ieee; use ieee.std_logic_1164.all, ieee.numeric_std.all;
190
library tauhop; use tauhop.transactor.all;
191
package axiTransactor is new tauhop.axiTLM generic map(
192
        t_qualifier=>boolean_vector(32/8-1 downto 0),
193
        t_id=>unsigned(7 downto 0),
194
        t_dest=>unsigned(3 downto 0),
195
        t_user=>unsigned(7 downto 0),    --unsigned(86*2-1 downto 0),
196
        t_resp=>unsigned(1 downto 0),    --only used for AXI4-Lite (non-streaming).
197
        transactor=>tauhop.transactor
198
);
199
*/

powered by: WebSVN 2.1.0

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