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

Subversion Repositories wb_fifo

[/] [wb_fifo/] [trunk/] [model/] [vhdl/] [packages/] [pkg-fifo-tlm.vhdl] - Blame information for rev 7

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 daniel.kho
/*
2
        This file is part of the Memories project:
3
                http://www.opencores.org/project,wb_fifo
4
 
5
        Description
6
        Implementation of FIFO transactor data structures and high-level API.
7
 
8
        To Do:
9
 
10
        Author(s):
11
        - Daniel C.K. Kho, daniel.kho@opencores.org | daniel.kho@tauhop.com
12
 
13
        Copyright (C) 2012-2013 Authors and OPENCORES.ORG
14
 
15
        This source file may be used and distributed without
16
        restriction provided that this copyright statement is not
17
        removed from the file and that any derivative work contains
18
        the original copyright notice and the associated disclaimer.
19
 
20
        This source file is free software; you can redistribute it
21
        and/or modify it under the terms of the GNU Lesser General
22
        Public License as published by the Free Software Foundation;
23
        either version 2.1 of the License, or (at your option) any
24
        later version.
25
 
26
        This source is distributed in the hope that it will be
27
        useful, but WITHOUT ANY WARRANTY; without even the implied
28
        warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
29
        PURPOSE. See the GNU Lesser General Public License for more
30
        details.
31
 
32
        You should have received a copy of the GNU Lesser General
33
        Public License along with this source; if not, download it
34
        from http://www.opencores.org/lgpl.shtml.
35
*/
36
/* FIXME VHDL-2008 instantiated package. Unsupported by VCS-MX, Quartus, and Vivado. QuestaSim/ModelSim supports well. */
37
library ieee; use ieee.std_logic_1164.all, ieee.numeric_std.all;
38
--use std.textio.all;
39
library tauhop; --use tauhop.transactor.all;
40
 
41
package fifoTLM is
42
        generic(
43
                package i_transactor is new tauhop.tlm generic map(<>)
44
        );
45
        /* Makes i_transactor.t_addr, i_transactor.t_msg, and i_transactor.t_cnt visible. */
46
        use i_transactor.all;
47
 
48
        /* FIFO Transactor block interface. */
49
        type t_fifoTransactor is record
50
                writeRequest,readRequest:t_bfm;
51
                writeResponse,readResponse:t_bfm;
52
        end record t_fifoTransactor;
53 3 daniel.kho
 
54 4 daniel.kho
        /* Use separate record for FIFO signalling.
55
                This will make it easier when we need to split up the request and response
56
                structures into separate records (for different directions).
57 3 daniel.kho
        */
58
        type t_fifo is record
59
                pctFilled:unsigned(7 downto 0);
60
                nearFull,full:boolean;
61
                nearEmpty,empty:boolean;
62
                overflow,underflow:boolean;
63
        end record t_fifo;
64 2 daniel.kho
end package fifoTLM;
65
 
66
package body fifoTLM is
67
end package body fifoTLM;
68
 
69
 
70
/* FIFO Transactor API.
71
 *      Generally, transactors are high-level bus interface models that perform
72
 *              read/write transactions to/from the bus. These models are not concerned
73
 *              with the low-level implementation of the bus protocol. However, the
74
 *              TLM models encapsulate the lower-level models known as the BFM.
75
 *      fifoTLM uses generic package tauhop.tlm, hence inherits basic TLM types and
76
 *              procedures generally used in any messaging system (i.e. address and message
77
 *              information, and bus read/write methods). It also extends the tauhop.tlm
78
 *              package with application-specific types, such as record structures specific
79
 *              to the AXI protocol.
80
 *      fifoTransactor instantiates the fifoTLM, and assigns specific types to the
81
 *              transactor model.
82
 */
83
library ieee; use ieee.std_logic_1164.all, ieee.numeric_std.all;
84
library tauhop;
85
package transactor is new tauhop.tlm generic map(
86
        t_addr=>unsigned(31 downto 0),           -- default assignment. Used only for non-stream interfaces.
87
        t_msg=>unsigned(63 downto 0),
88
        t_cnt=>unsigned(127 downto 0)
89
);
90
 
91
library ieee; use ieee.std_logic_1164.all, ieee.numeric_std.all;
92
library tauhop; use tauhop.transactor.all;
93
package fifoTransactor is new tauhop.fifoTLM generic map(
94
        --t_data=>unsigned(31 downto 0),
95
        i_transactor=>tauhop.transactor
96
);

powered by: WebSVN 2.1.0

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