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 19

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 19 antanguay
#include "sc_defines.h"
44
 
45 2 antanguay
#include "sc_packet.h"
46
#include "sc_scoreboard.h"
47
 
48
SC_MODULE(xgmii_if) {
49
 
50
  public:
51
 
52
    //---
53
    // Ports
54
 
55
    sc_in<bool> clk_xgmii;
56
 
57
    sc_in<bool> reset_xgmii_n;
58
 
59
    sc_out<unsigned int> xgmii_rxc;
60 19 antanguay
    sc_out<vluint64_t > xgmii_rxd;
61 2 antanguay
 
62
    sc_in<unsigned int> xgmii_txc;
63 19 antanguay
    sc_in<vluint64_t > xgmii_txd;
64 2 antanguay
 
65
  private:
66
 
67
    //---
68
    // Variables
69
 
70
    sc_fifo<packet_t*> tx_fifo;
71
    sc_fifo<packet_t*> rx_fifo;
72
 
73
    scoreboard *sb;
74
    scoreboard::sbSourceId sb_id;
75
 
76
  public:
77
 
78
    //---
79
    // Variables
80
 
81
    bool allow_idle_errors;
82
    bool disable_receive;
83
    bool disable_padding;
84
 
85
    bool rx_local_fault;
86
    bool rx_remote_fault;
87
 
88
    //---
89
    // Functions
90
 
91
    sc_fifo<packet_t*> * get_tx_fifo_ptr();
92
    sc_fifo<packet_t*> * get_rx_fifo_ptr();
93
 
94
    void init(void);
95
    void connect_scoreboard(scoreboard *sbptr, scoreboard::sbSourceId sid);
96
 
97
    //---
98
    // Threads
99
 
100
    void transmit();
101
    void receive();
102
    void monitor();
103
 
104 15 antanguay
    SC_CTOR(xgmii_if) :
105 2 antanguay
        tx_fifo (2),
106
        rx_fifo (2) {
107
 
108
        SC_CTHREAD (transmit, clk_xgmii.pos());
109
 
110
        SC_CTHREAD (receive, clk_xgmii.pos());
111
 
112
        SC_CTHREAD (monitor, clk_xgmii.pos());
113
    }
114
 
115
};
116
 
117
#endif

powered by: WebSVN 2.1.0

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