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 9

Go to most recent revision | 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
 
6
        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
--              package transactor is new tauhop.tlm generic map(<>)
47
--      );
48
--      /* Makes transactor.t_addr and transactor.t_msg visible. */
49
--      use transactor.all;
50
 
51
        /* TODO remove once generic packages are supported. */
52
        use tauhop.tlm.all;
53
        subtype t_qualifier is std_ulogic_vector(32/8-1 downto 0);
54
        subtype t_id is unsigned(31 downto 0);
55
        subtype t_dest is unsigned(3 downto 0);
56
        subtype t_user is unsigned(7 downto 0);
57
        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).
58
 
59
        /* AXI Transactor block interfaces. */
60
        type t_axi4Transactor_m2s is record
61
                /* Address must be unresolved, because you need to drive the read address only when read is asserted, and
62
                        drive the write address when write is asserted. Resolution functions are not expected to know how to decide this.
63
                */
64
                /* Write address channel. */
65
                awId:t_id;
66
--              awLen:unsigned(7 downto 0);             --8 bits as defined by the standard.
67
--              awSize:unsigned(2 downto 0);    --3 bits as defined by the standard. Burst size for write transfers.
68
--              awBurst:
69
--              awLock:
70
--              awCache:
71
--              awQoS:
72
--              awRegion:
73
--              awUser:
74
                -- AXI4-Lite required signals.
75
                awAddr:t_addr;
76
                awProt:boolean;
77
                awValid:boolean;
78
 
79
                /* Write data channel. */
80
                wId:t_id;
81
--              wLast:
82
--              wUser:
83
                -- AXI4-Lite required signals.
84
                wValid:boolean;
85
                wData:t_msg;
86
--              wStrb:std_ulogic_vector(wData'length/8-1 downto 0);     --default is all ones if master always performs full datawidth write transactions.
87
                wStrb:t_qualifier;      --default is all ones if master always performs full datawidth write transactions.
88
 
89
                /* Write response channel. */
90
                bReady:boolean;
91
 
92
                /* Read address channel. */
93
                arId:t_id;
94
--              arLen:unsigned(7 downto 0);             --8 bits as defined by the standard.
95
--              arSize:unsigned(2 downto 0);    --3 bits as defined by the standard.
96
--              arBurst:
97
--              arLock:
98
--              arCache:
99
--              arQoS:
100
--              arRegion:
101
--              arUser:
102
                -- AXI4-Lite required signals.
103
                arValid:boolean;
104
                arAddr:t_addr;
105
                arProt:boolean;
106
 
107
                /* Read data channel. */
108
                rReady:boolean;
109
        end record t_axi4Transactor_m2s;
110
 
111
        type t_axi4Transactor_s2m is record
112
                /* Write address channel. */
113
                awReady:boolean;
114
 
115
                /* Write data channel. */
116
                wReady:boolean;
117
 
118
                /* Write response channel. */
119
                bId:t_id;
120
--              bUser:
121
                -- AXI4-Lite required signals.
122
                bValid:boolean;
123
                bResp:t_resp;
124
 
125
                /* Read address channel. */
126
                arReady:boolean;
127
 
128
                /* Read data channel. */
129
                rId:t_id;
130
--              rLast:
131
--              rUser:
132
                -- AXI4-Lite required signals.
133
                rValid:boolean;
134
                rData:t_msg;
135
                rResp:t_resp;
136
        end record t_axi4Transactor_s2m;
137
 
138
        type t_axi4StreamTransactor_m2s is record
139
                /* AXI4 streaming interface. */
140
                tValid:boolean;
141
                tData:t_msg;
142
                tStrb:t_qualifier;
143
                tKeep:t_qualifier;
144
                tLast:boolean;
145
                tId:t_id;
146
                tDest:t_dest;
147
                tUser:t_user;
148
        end record t_axi4StreamTransactor_m2s;
149
 
150
        type t_axi4StreamTransactor_s2m is record
151
                tReady:boolean;
152
        end record t_axi4StreamTransactor_s2m;
153
 
154
--      /* AXI Low-power interface. */
155
--      type tAxiTransactor_lp is record
156
--              cSysReq:
157
--              cSysAck:
158
--              cActive:
159
--      end record tAxiTransactor_lp;
160
 
161
        type axiBfmStatesTx is (idle,sendAddr,startOfPacket,payload,endOfPacket,endOfTx);
162
        type axiBfmStatesRx is (idle,checkAddr,startOfPacket,payload);
163
end package axiTLM;
164
 
165
package body axiTLM is
166
end package body axiTLM;
167
 
168
 
169
/* AXI Transactor API.
170
 *      Generally, transactors are high-level bus interface models that perform
171
 *              read/write transactions to/from the bus. These models are not concerned
172
 *              with the low-level implementation of the bus protocol. However, the
173
 *              TLM models encapsulate the lower-level models known as the BFM.
174
 *      axiTLM uses generic package tauhop.tlm, hence inherits basic TLM types and
175
 *              procedures generally used in any messaging system (i.e. address and message
176
 *              information, and bus read/write methods). It also extends the tauhop.tlm
177
 *              package with application-specific types, such as record structures specific
178
 *              to the AXI protocol.
179
 *      axiTransactor instantiates the axiTLM, and assigns specific types to the
180
 *              transactor model.
181
 */
182
/*library ieee; use ieee.std_logic_1164.all, ieee.numeric_std.all;
183
library tauhop;
184
package transactor is new tauhop.tlm generic map(
185
        t_addr=>unsigned(31 downto 0),           -- default assignment. Used only for non-stream interfaces.
186
        t_msg=>signed(63 downto 0),
187
        t_cnt=>unsigned(127 downto 0)
188
);
189
 
190
library ieee; use ieee.std_logic_1164.all, ieee.numeric_std.all;
191
library tauhop; use tauhop.transactor.all;
192
package axiTransactor is new tauhop.axiTLM generic map(
193
        t_qualifier=>boolean_vector(32/8-1 downto 0),
194
        t_id=>unsigned(7 downto 0),
195
        t_dest=>unsigned(3 downto 0),
196
        t_user=>unsigned(7 downto 0),    --unsigned(86*2-1 downto 0),
197
        t_resp=>unsigned(1 downto 0),    --only used for AXI4-Lite (non-streaming).
198
        transactor=>tauhop.transactor
199
);
200
*/

powered by: WebSVN 2.1.0

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