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 7

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

powered by: WebSVN 2.1.0

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