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

Subversion Repositories xge_mac

[/] [xge_mac/] [trunk/] [tbench/] [systemc/] [sc_xgmii_if.h] - Blame information for rev 12

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

Line No. Rev Author Line
1 2 antanguay
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  File name "sc_xgmii_if.h"                                   ////
4
////                                                              ////
5
////  This file is part of the "10GE MAC" project                 ////
6
////  http://www.opencores.org/cores/xge_mac/                     ////
7
////                                                              ////
8
////  Author(s):                                                  ////
9
////      - A. Tanguay (antanguay@opencores.org)                  ////
10
////                                                              ////
11
//////////////////////////////////////////////////////////////////////
12
////                                                              ////
13
//// Copyright (C) 2008 AUTHORS. All rights reserved.             ////
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
//////////////////////////////////////////////////////////////////////
37
 
38
#ifndef XGMII_IF_H
39
#define XGMII_IF_H
40
 
41
#include "systemc.h"
42
 
43
#include "sc_packet.h"
44
#include "sc_scoreboard.h"
45
 
46
SC_MODULE(xgmii_if) {
47
 
48
  public:
49
 
50
    //---
51
    // Ports
52
 
53
    sc_in<bool> clk_xgmii;
54
 
55
    sc_in<bool> reset_xgmii_n;
56
 
57
    sc_out<unsigned int> xgmii_rxc;
58
    sc_out<sc_bv<64> > xgmii_rxd;
59
 
60
    sc_in<unsigned int> xgmii_txc;
61
    sc_in<sc_bv<64> > xgmii_txd;
62
 
63
  private:
64
 
65
    //---
66
    // Variables
67
 
68
    sc_fifo<packet_t*> tx_fifo;
69
    sc_fifo<packet_t*> rx_fifo;
70
 
71
    scoreboard *sb;
72
    scoreboard::sbSourceId sb_id;
73
 
74
  public:
75
 
76
    //---
77
    // Variables
78
 
79
    bool allow_idle_errors;
80
    bool disable_receive;
81
    bool disable_padding;
82
 
83
    bool rx_local_fault;
84
    bool rx_remote_fault;
85
 
86
    //---
87
    // Functions
88
 
89
    sc_fifo<packet_t*> * get_tx_fifo_ptr();
90
    sc_fifo<packet_t*> * get_rx_fifo_ptr();
91
 
92
    void init(void);
93
    void connect_scoreboard(scoreboard *sbptr, scoreboard::sbSourceId sid);
94
 
95
    //---
96
    // Threads
97
 
98
    void transmit();
99
    void receive();
100
    void monitor();
101
 
102
    SC_CTOR(xgmii_if) :
103
        tx_fifo (2),
104
        rx_fifo (2) {
105
 
106
        SC_CTHREAD (transmit, clk_xgmii.pos());
107
 
108
        SC_CTHREAD (receive, clk_xgmii.pos());
109
 
110
        SC_CTHREAD (monitor, clk_xgmii.pos());
111
    }
112
 
113
};
114
 
115
#endif

powered by: WebSVN 2.1.0

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