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

Subversion Repositories ethernet_tri_mode

[/] [ethernet_tri_mode/] [trunk/] [bench/] [verilog/] [User_int_sim.v] - Blame information for rev 6

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

Line No. Rev Author Line
1 6 maverickis
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  User_input_sim.v                                            ////
4
////                                                              ////
5
////  This file is part of the Ethernet IP core project           ////
6
////  http://www.opencores.org/projects.cgi/web/ethernet_tri_mode/////
7
////                                                              ////
8
////  Author(s):                                                  ////
9
////      - Jon Gao (gaojon@yahoo.com)                            ////
10
////                                                              ////
11
////                                                              ////
12
//////////////////////////////////////////////////////////////////////
13
////                                                              ////
14
//// Copyright (C) 2001 Authors                                   ////
15
////                                                              ////
16
//// This source file may be used and distributed without         ////
17
//// restriction provided that this copyright statement is not    ////
18
//// removed from the file and that any derivative work contains  ////
19
//// the original copyright notice and the associated disclaimer. ////
20
////                                                              ////
21
//// This source file is free software; you can redistribute it   ////
22
//// and/or modify it under the terms of the GNU Lesser General   ////
23
//// Public License as published by the Free Software Foundation; ////
24
//// either version 2.1 of the License, or (at your option) any   ////
25
//// later version.                                               ////
26
////                                                              ////
27
//// This source is distributed in the hope that it will be       ////
28
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
29
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
30
//// PURPOSE.  See the GNU Lesser General Public License for more ////
31
//// details.                                                     ////
32
////                                                              ////
33
//// You should have received a copy of the GNU Lesser General    ////
34
//// Public License along with this source; if not, download it   ////
35
//// from http://www.opencores.org/lgpl.shtml                     ////
36
////                                                              ////
37
//////////////////////////////////////////////////////////////////////
38
//                                                                    
39
// CVS Revision History                                               
40
//                                                                    
41
//
42
// Revision 1.1.1.1  2005/12/13 01:51:44  Administrator
43
// no message
44
// 
45
module User_int_sim (
46
input                   Reset                                   ,
47
input                   Clk_user                                ,
48
                                //user inputerface 
49
input                   Rx_mac_ra                               ,
50
output                  Rx_mac_rd                               ,
51
input   [31:0]   Rx_mac_data                             ,
52
input   [1:0]    Rx_mac_BE                               ,
53
input                   Rx_mac_pa                               ,
54
input                   Rx_mac_sop                              ,
55
input                   Rx_mac_eop                              ,
56
                                //user inputerface 
57
input                   Tx_mac_wa                       ,
58
output                  Tx_mac_wr                       ,
59
output  [31:0]   Tx_mac_data                     ,
60
output  [1:0]    Tx_mac_BE                               ,//big endian
61
output                  Tx_mac_sop                      ,
62
output                  Tx_mac_eop
63
);
64
//////////////////////////////////////////////////////////////////////
65
// inputernal signals
66
//////////////////////////////////////////////////////////////////////
67
reg[4:0]         operation;
68
reg[31:0]                data;
69
reg                             Rx_mac_rd;
70
reg                             Start_tran;
71
//////////////////////////////////////////////////////////////////////
72
//generate Tx user data
73
//////////////////////////////////////////////////////////////////////
74
initial
75
        begin
76
        operation       =0;
77
        data            =0;
78
        end
79
 
80
always @ (posedge Clk_user or posedge Reset)
81
        if (Reset)
82
                Start_tran      <=0;
83
        else if (Tx_mac_eop&&!Tx_mac_wa)
84
                Start_tran      <=0;
85
        else if (Tx_mac_wa)
86
                Start_tran      <=1;
87
 
88
 
89
always @ (posedge Clk_user )
90
        if (Tx_mac_wa)
91
                $ip_32W_gen("config.ini",operation,data);
92
        else
93
                begin
94
                operation       <=0;
95
                data            <=0;
96
                end
97
 
98
assign Tx_mac_data      =data;
99
assign Tx_mac_wr        =operation[4];
100
assign Tx_mac_sop       =operation[3];
101
assign Tx_mac_eop   =operation[2];
102
assign Tx_mac_BE    =operation[1:0];
103
//////////////////////////////////////////////////////////////////////
104
//verify Rx user data
105
//////////////////////////////////////////////////////////////////////
106
always @ (posedge Clk_user or posedge Reset)
107
        if (Reset)
108
                Rx_mac_rd       <=0;
109
        else if(Rx_mac_ra)
110
                Rx_mac_rd       <=1;
111
        else
112
                Rx_mac_rd       <=0;
113
 
114
 
115
always @ (posedge Clk_user )
116
        if (Rx_mac_pa)
117
                $ip_32W_check(  Rx_mac_data,
118
                                                {Rx_mac_sop,Rx_mac_eop,Rx_mac_eop?Rx_mac_BE:2'b0});
119
 
120
endmodule
121
 

powered by: WebSVN 2.1.0

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