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

Subversion Repositories xge_mac

[/] [xge_mac/] [trunk/] [README.TXT] - Blame information for rev 31

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 antanguay
 
2
========================
3
10GE MAC Core
4
========================
5
 
6 6 antanguay
 
7
------------------------
8
1. Directory Structure
9
------------------------
10
 
11
The directory structure for this project is shown below.
12
 
13
.
14
|-- doc                 - Documentation files
15
|
16
|-- rtl
17
|   |-- include         - Verilog defines and utils
18
|   `-- verilog         - Verilog source files for xge_mac
19
|
20
|-- sim
21
|   |-- systemc         - SystemC simulation directory
22
|   `-- verilog         - Verilog simulation directory
23
|
24
`-- tbench
25
    |-- systemc         - SystemC test-bench source files
26
    `-- verilog         - Verilog test-bench source files
27
 
28
 
29
 
30
------------------------
31
2. Simulation
32
------------------------
33
 
34
There are two simulation environments that can be used to validate the code.
35
The verilog simulation is very basic and meant for those who want to look
36
at how the MAC operates without going through the effort of setting up SystemC.
37
The SystemC environment is more sophisticated and covers all features of the MAC.
38
 
39
 
40
 
41
------------------------
42
2.1 Verilog Simulation
43
------------------------
44
 
45
To run the verilog simulation, compile all project files under rtl/verilog along with
46
top level testbench file:
47
 
48
  - tbench/verilog/tb_xge_mac.v
49
 
50
There is a Modelsim "do" file called "sim.do" under sim/verilog for those using Modelsim.
51
Once all the files are compiled, start simulation using entity "tb".
52
 
53
 
54
The verilog simulation reads packets from "packet_tx.txt" and writes them to the MAC
55
transmit fifo using the packet transmit interface (pkt_tx_data). As frames become
56
available in the transmit fifo, the MAC calulates the CRC and sends them out on xgmii_tx.
57
The xgmii_tx interface is looped-back to xgmii_rx in the testbench. The frames are thus
58
processed by the MAC receive engine and stored in the receive fifo. The testbench reads
59
frames from the receive interface (pkt_rx_data) and prints out the results.
60
 
61
 
62 21 antanguay
Simulation output:
63 6 antanguay
 
64 21 antanguay
  ------------------------
65
  Received Packet
66
  ------------------------
67
  0000010000010010
68
  9400000288b50001
69
  0203040506070809
70
  0a0b0c0d0e0f1011
71
  1213141516171819
72
  1a1b1c1d1e1f2021
73
  2223242526272829
74
  2a2b2c2d2e2f3031
75
  3233343506b33d40
76
  ------------------------
77
  All packets received. Sumulation done!!!
78
 
79
 
80 6 antanguay
------------------------
81
2.2 SystemC Simulation
82
------------------------
83
 
84
In order to use the SystemC environment it is required to first install SystemC from
85
www.systemc.org. Free membership may be required to download the core SystemC files.
86
 
87
The testbench was developed and tested with Verilator, a free HDL simulator that
88
compiles verilog into C++ or SystemC code. You can download Verilator from
89
www.veripool.org. You also need to install SystemPerl and Verilog-Perl for waveform
90
traces.
91
 
92 31 antanguay
Add the following exports to your .bashrc file, adjust based on your version:
93 6 antanguay
 
94 31 antanguay
  export SYSTEMC=/opt/systemc-2.3.1a
95
  export SYSTEMC_INCLUDE=/opt/systemc-2.3.1a/include   # with systemc.h
96
  export SYSTEMC_LIBDIR=/opt/systemc-2.3.1a/lib    # with libsystemc.a
97
  export VERILATOR_ROOT=/opt/verilator-3.900
98
  export SYSTEMPERL=/opt/SystemPerl-1.344
99
  export LD_LIBRARY_PATH=/opt/systemc-2.3.1a/lib-linux64
100
 
101 6 antanguay
Once all the required tools are installed:
102
 
103
  - Move to directory sim/systemc
104
 
105
  - Type "./compile.sh"
106
 
107
  - Type "./run.sh"
108
 
109
 
110
If the simulation is running correctly you should see messages from the scoreboard
111
as packets are transmited and received on the various interfaces.
112
 
113
Simulation output:
114
 
115
    -----------------------
116 21 antanguay
    Packet size
117 6 antanguay
    -----------------------
118
    SCOREBOARD XGMII INTERFACE TX (60)
119
    SCOREBOARD XGMII INTERFACE TX (60)
120
    SCOREBOARD PACKET INTERFACE TX (50)
121
    SCOREBOARD XGMII INTERFACE TX (60)
122
    SCOREBOARD PACKET INTERFACE TX (51)
123
    SCOREBOARD XGMII INTERFACE TX (60)
124
    SCOREBOARD PACKET INTERFACE RX (TX SIZE=60  RX SIZE=60)
125
    ...

powered by: WebSVN 2.1.0

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