1 |
4 |
dwp |
//////////////////////////////////////////////////////////////////////
|
2 |
|
|
//// ////
|
3 |
|
|
//// File name "interfaces.v" ////
|
4 |
|
|
//// ////
|
5 |
|
|
//// This file is part of the : ////
|
6 |
|
|
//// ////
|
7 |
|
|
//// "1000BASE-X IEEE 802.3-2008 Clause 36 - PCS project" ////
|
8 |
|
|
//// ////
|
9 |
|
|
//// http://opencores.org/project,1000base-x ////
|
10 |
|
|
//// ////
|
11 |
|
|
//// Author(s): ////
|
12 |
|
|
//// - D.W.Pegler Cambridge Broadband Networks Ltd ////
|
13 |
|
|
//// ////
|
14 |
|
|
//// { peglerd@gmail.com, dwp@cambridgebroadand.com } ////
|
15 |
|
|
//// ////
|
16 |
|
|
//////////////////////////////////////////////////////////////////////
|
17 |
|
|
//// ////
|
18 |
|
|
//// Copyright (C) 2009 AUTHORS. All rights reserved. ////
|
19 |
|
|
//// ////
|
20 |
|
|
//// This source file may be used and distributed without ////
|
21 |
|
|
//// restriction provided that this copyright statement is not ////
|
22 |
|
|
//// removed from the file and that any derivative work contains ////
|
23 |
|
|
//// the original copyright notice and the associated disclaimer. ////
|
24 |
|
|
//// ////
|
25 |
|
|
//// This source file is free software; you can redistribute it ////
|
26 |
|
|
//// and/or modify it under the terms of the GNU Lesser General ////
|
27 |
|
|
//// Public License as published by the Free Software Foundation; ////
|
28 |
|
|
//// either version 2.1 of the License, or (at your option) any ////
|
29 |
|
|
//// later version. ////
|
30 |
|
|
//// ////
|
31 |
|
|
//// This source is distributed in the hope that it will be ////
|
32 |
|
|
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
|
33 |
|
|
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
|
34 |
|
|
//// PURPOSE. See the GNU Lesser General Public License for more ////
|
35 |
|
|
//// details. ////
|
36 |
|
|
//// ////
|
37 |
|
|
//// You should have received a copy of the GNU Lesser General ////
|
38 |
|
|
//// Public License along with this source; if not, download it ////
|
39 |
|
|
//// from http://www.opencores.org/lgpl.shtml ////
|
40 |
|
|
//// ////
|
41 |
|
|
//////////////////////////////////////////////////////////////////////
|
42 |
|
|
//// ////
|
43 |
|
|
//// ////
|
44 |
|
|
//////////////////////////////////////////////////////////////////////
|
45 |
|
|
|
46 |
|
|
`include "timescale_tb.v"
|
47 |
|
|
|
48 |
|
|
import ethernet_frame::EthernetFrame;
|
49 |
|
|
import ethernet_frame::FrameMailBox;
|
50 |
|
|
import ethernet_frame::ethernet_address_t;
|
51 |
|
|
import ethernet_frame::EthernetSpeed;
|
52 |
|
|
|
53 |
|
|
interface serial_model_if();
|
54 |
|
|
modport testbench(
|
55 |
|
|
import function string whoami(),
|
56 |
|
|
import task write(int address, integer value),
|
57 |
|
|
import task read(int address, output integer value)
|
58 |
|
|
);
|
59 |
|
|
modport model(
|
60 |
|
|
export function string whoami(),
|
61 |
|
|
export task write(),
|
62 |
|
|
export task read()
|
63 |
|
|
);
|
64 |
|
|
endinterface
|
65 |
|
|
|
66 |
|
|
interface gmii_tx_if();
|
67 |
|
|
modport testbench(
|
68 |
|
|
import function string whoami(),
|
69 |
|
|
import function void queue_frame(EthernetFrame frame),
|
70 |
|
|
import function void queue_delay(time delay),
|
71 |
|
|
import task sleep(time timeout),
|
72 |
|
|
import function void set_speed(EthernetSpeed m)
|
73 |
|
|
);
|
74 |
|
|
modport model(
|
75 |
|
|
export function string whoami(),
|
76 |
|
|
export function void queue_frame(),
|
77 |
|
|
export function void queue_delay(),
|
78 |
|
|
export task sleep(),
|
79 |
|
|
export function void set_speed()
|
80 |
|
|
);
|
81 |
|
|
endinterface
|
82 |
|
|
|
83 |
|
|
interface gmii_rx_if();
|
84 |
|
|
modport testbench(
|
85 |
|
|
import function string whoami(),
|
86 |
|
|
import function void register_mailbox(ethernet_address_t sa, FrameMailBox mbx),
|
87 |
|
|
import function void unregister_mailbox(ethernet_address_t sa),
|
88 |
|
|
import function void enable_loopback(virtual gmii_tx_if intf),
|
89 |
|
|
import function void set_parity_errors(int parity, int errors),
|
90 |
|
|
import function void set_speed(EthernetSpeed m)
|
91 |
|
|
);
|
92 |
|
|
modport model(
|
93 |
|
|
export function string whoami(),
|
94 |
|
|
export function void register_mailbox(),
|
95 |
|
|
export function void unregister_mailbox(),
|
96 |
|
|
export function void enable_loopback(virtual gmii_tx_if intf),
|
97 |
|
|
export function void set_parity_errors(),
|
98 |
|
|
export function void set_speed()
|
99 |
|
|
);
|
100 |
|
|
endinterface
|
101 |
|
|
|
102 |
|
|
interface encoder_8b_tx_if();
|
103 |
|
|
|
104 |
|
|
modport testbench(
|
105 |
|
|
import function string whoami(),
|
106 |
|
|
import function void push_8B_symbol(reg[7:0] value),
|
107 |
|
|
import function void push_config(reg[15:0] value),
|
108 |
|
|
import function void queue_frame(EthernetFrame frame),
|
109 |
|
|
import task sleep(time timeout)
|
110 |
|
|
);
|
111 |
|
|
|
112 |
|
|
modport model(
|
113 |
|
|
export function string whoami(),
|
114 |
|
|
export function void push_8B_symbol(),
|
115 |
|
|
export function void push_config(),
|
116 |
|
|
export function void queue_frame(),
|
117 |
|
|
export task sleep()
|
118 |
|
|
);
|
119 |
|
|
|
120 |
|
|
endinterface
|
121 |
|
|
|
122 |
|
|
interface encoder_10b_rx_if();
|
123 |
|
|
|
124 |
|
|
modport testbench(
|
125 |
|
|
import function string whoami()
|
126 |
|
|
);
|
127 |
|
|
modport model(
|
128 |
|
|
export function string whoami()
|
129 |
|
|
);
|
130 |
|
|
|
131 |
|
|
endinterface
|
132 |
|
|
|
133 |
|
|
|
134 |
|
|
interface decoder_8b_rx_if();
|
135 |
|
|
|
136 |
|
|
modport testbench(
|
137 |
|
|
import function string whoami()
|
138 |
|
|
);
|
139 |
|
|
modport model(
|
140 |
|
|
export function string whoami()
|
141 |
|
|
);
|
142 |
|
|
endinterface
|
143 |
|
|
|