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 23

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 7 maverickis
// $Log: not supported by cvs2svn $
42 23 maverickis
// Revision 1.2  2006/01/19 14:07:50  maverickist
43
// verification is complete.
44
//
45 7 maverickis
// Revision 1.2  2005/12/13 12:15:35  Administrator
46
// no message
47 6 maverickis
//
48
// Revision 1.1.1.1  2005/12/13 01:51:44  Administrator
49
// no message
50
// 
51
module User_int_sim (
52 23 maverickis
Reset                           ,
53
Clk_user                                ,
54
CPU_init_end            ,
55
//user inputerface      ,
56
Rx_mac_ra                               ,
57
Rx_mac_rd                               ,
58
Rx_mac_data                             ,
59
Rx_mac_BE                               ,
60
Rx_mac_pa                               ,
61
Rx_mac_sop                              ,
62
Rx_mac_eop                              ,
63
//user inputerface      ,
64
Tx_mac_wa                       ,
65
Tx_mac_wr                       ,
66
Tx_mac_data                     ,
67
Tx_mac_BE                               ,
68
Tx_mac_sop                      ,
69
Tx_mac_eop
70
 
71
);
72
input                   Reset                                   ;
73
input                   Clk_user                                ;
74
input           CPU_init_end            ;
75 6 maverickis
                                //user inputerface 
76 23 maverickis
input                   Rx_mac_ra                               ;
77
output                  Rx_mac_rd                               ;
78
input   [31:0]   Rx_mac_data                             ;
79
input   [1:0]    Rx_mac_BE                               ;
80
input                   Rx_mac_pa                               ;
81
input                   Rx_mac_sop                              ;
82
input                   Rx_mac_eop                              ;
83 6 maverickis
                                //user inputerface 
84 23 maverickis
input                   Tx_mac_wa                       ;
85
output                  Tx_mac_wr                       ;
86
output  [31:0]   Tx_mac_data                     ;
87
output  [1:0]    Tx_mac_BE                               ;//big endian
88
output                  Tx_mac_sop                      ;
89
output                  Tx_mac_eop                              ;
90
 
91 6 maverickis
//////////////////////////////////////////////////////////////////////
92
// inputernal signals
93
//////////////////////////////////////////////////////////////////////
94
reg[4:0]         operation;
95
reg[31:0]                data;
96
reg                             Rx_mac_rd;
97
reg                             Start_tran;
98
//////////////////////////////////////////////////////////////////////
99
//generate Tx user data
100
//////////////////////////////////////////////////////////////////////
101
initial
102
        begin
103
        operation       =0;
104
        data            =0;
105
        end
106
 
107
always @ (posedge Clk_user or posedge Reset)
108
        if (Reset)
109
                Start_tran      <=0;
110
        else if (Tx_mac_eop&&!Tx_mac_wa)
111
                Start_tran      <=0;
112
        else if (Tx_mac_wa)
113
                Start_tran      <=1;
114
 
115
 
116 7 maverickis
always @ (posedge Clk_user)
117
        if (Tx_mac_wa&&CPU_init_end)
118
                $ip_32W_gen("../data/config.ini",operation,data);
119 6 maverickis
        else
120
                begin
121
                operation       <=0;
122
                data            <=0;
123
                end
124
 
125
assign Tx_mac_data      =data;
126
assign Tx_mac_wr        =operation[4];
127
assign Tx_mac_sop       =operation[3];
128
assign Tx_mac_eop   =operation[2];
129
assign Tx_mac_BE    =operation[1:0];
130
//////////////////////////////////////////////////////////////////////
131
//verify Rx user data
132
//////////////////////////////////////////////////////////////////////
133
always @ (posedge Clk_user or posedge Reset)
134
        if (Reset)
135
                Rx_mac_rd       <=0;
136
        else if(Rx_mac_ra)
137
                Rx_mac_rd       <=1;
138
        else
139
                Rx_mac_rd       <=0;
140
 
141
 
142
always @ (posedge Clk_user )
143
        if (Rx_mac_pa)
144
                $ip_32W_check(  Rx_mac_data,
145
                                                {Rx_mac_sop,Rx_mac_eop,Rx_mac_eop?Rx_mac_BE:2'b0});
146
 
147
endmodule
148
 

powered by: WebSVN 2.1.0

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