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

Subversion Repositories xge_mac

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

Go to most recent revision | 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
 
63
------------------------
64
2.2 SystemC Simulation
65
------------------------
66
 
67
In order to use the SystemC environment it is required to first install SystemC from
68
www.systemc.org. Free membership may be required to download the core SystemC files.
69
 
70
The testbench was developed and tested with Verilator, a free HDL simulator that
71
compiles verilog into C++ or SystemC code. You can download Verilator from
72
www.veripool.org. You also need to install SystemPerl and Verilog-Perl for waveform
73
traces.
74
 
75
 
76
Once all the required tools are installed:
77
 
78
  - Move to directory sim/systemc
79
 
80
  - Type "./compile.sh"
81
 
82
  - Type "./run.sh"
83
 
84
 
85
If the simulation is running correctly you should see messages from the scoreboard
86
as packets are transmited and received on the various interfaces.
87
 
88
Simulation output:
89
 
90
    -----------------------
91
    Packet size
92
    -----------------------
93
    SCOREBOARD XGMII INTERFACE TX (60)
94
    SCOREBOARD XGMII INTERFACE TX (60)
95
    SCOREBOARD PACKET INTERFACE TX (50)
96
    SCOREBOARD XGMII INTERFACE TX (60)
97
    SCOREBOARD PACKET INTERFACE TX (51)
98
    SCOREBOARD XGMII INTERFACE TX (60)
99
    SCOREBOARD PACKET INTERFACE RX (TX SIZE=60  RX SIZE=60)
100
    ...
101
 
102
 
103
 
104
 
105
 

powered by: WebSVN 2.1.0

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