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 33

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

powered by: WebSVN 2.1.0

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