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

Subversion Repositories usb11

[/] [usb11/] [trunk/] [rtl/] [systemc/] [usb_fifo2.h] - Blame information for rev 15

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

Line No. Rev Author Line
1 2 alfoltran
/////////////////////////////////////////////////////////////////////
2
////                                                             ////
3
////  USB Fast FIFO - 2 Entries Deep                             ////
4
////                                                             ////
5
////  SystemC Version: usb_fifo2.h                               ////
6
////  Author: Alfredo Luiz Foltran Fialho                        ////
7
////          alfoltran@ig.com.br                                ////
8
////                                                             ////
9
////                                                             ////
10
/////////////////////////////////////////////////////////////////////
11
////                                                             ////
12
//// Verilog Version: usb1_fifo2.v                               ////
13
//// Copyright (C) 2000-2002 Rudolf Usselmann                    ////
14
////                         www.asics.ws                        ////
15
////                         rudi@asics.ws                       ////
16
////                                                             ////
17
//// This source file may be used and distributed without        ////
18
//// restriction provided that this copyright statement is not   ////
19
//// removed from the file and that any derivative work contains ////
20
//// the original copyright notice and the associated disclaimer.////
21
////                                                             ////
22
////     THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY     ////
23
//// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED   ////
24
//// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS   ////
25
//// FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR      ////
26
//// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,         ////
27
//// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES    ////
28
//// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE   ////
29
//// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR        ////
30
//// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF  ////
31
//// LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT  ////
32
//// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT  ////
33
//// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE         ////
34
//// POSSIBILITY OF SUCH DAMAGE.                                 ////
35
////                                                             ////
36
/////////////////////////////////////////////////////////////////////
37
 
38
#ifndef USB_FIFO2_H
39
#define USB_FIFO2_H
40
 
41
SC_MODULE(usb_fifo2) {
42
 
43
  public:
44
 
45
        sc_in<bool>                     clk;
46
        sc_in<bool>                     rst;
47
        sc_in<bool>                     clr;
48
        sc_in<sc_uint<8> >      din;
49
        sc_in<bool>                     we;
50
        sc_out<sc_uint<8> >     dout;
51
        sc_in<bool>                     re;
52
 
53
        // Local Signals
54
        sc_uint<8>              mem[2];
55
        sc_signal<bool> wp;
56
        sc_signal<bool> rp;
57
 
58
        // Write and Read Pointers Update Functions
59
        void wp_update(void);
60
        void rp_update(void);
61
 
62
        // Write and Read FIFO Functions
63
        void write(void);
64
        void read(void);
65
 
66
        SC_CTOR(usb_fifo2) {
67
                SC_METHOD(wp_update);
68
                sensitive << clk.pos() << rst.neg();
69
                SC_METHOD(rp_update);
70
                sensitive << clk.pos() << rst.neg();
71
                SC_METHOD(write);
72
                sensitive << clk.pos();
73
                SC_METHOD(read);
74
                sensitive << rp << wp;
75
        }
76
 
77
};
78
 
79
#endif
80
 

powered by: WebSVN 2.1.0

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