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

Subversion Repositories srdydrdy_lib

[/] [srdydrdy_lib/] [trunk/] [external/] [ethernet_tri_mode/] [MAC_tx/] [MAC_tx_addr_add.v] - Blame information for rev 23

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 23 ghutchis
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  MAC_tx_addr_add.v                                           ////
4
////                                                              ////
5
////  This file is part of the Ethernet IP core project           ////
6
////  http://www.opencores.org/projects.cgi/wr_en/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
// $Log: MAC_tx_addr_add.v,v $
42
// Revision 1.3  2006/01/19 14:07:54  maverickist
43
// verification is complete.
44
//
45
// Revision 1.2  2005/12/16 06:44:18  Administrator
46
// replaced tab with space.
47
// passed 9.6k length frame test.
48
//
49
// Revision 1.1.1.1  2005/12/13 01:51:45  Administrator
50
// no message
51
//                                           
52
 
53
module MAC_tx_addr_add (
54
Reset               ,
55
Clk                 ,
56
MAC_tx_addr_init    ,
57
MAC_tx_addr_rd      ,
58
MAC_tx_addr_data    ,
59
//CPU               ,
60
MAC_add_prom_data   ,
61
MAC_add_prom_add    ,
62
MAC_add_prom_wr
63
);
64
 
65
input           Reset               ;
66
input           Clk                 ;
67
input           MAC_tx_addr_rd      ;
68
input           MAC_tx_addr_init    ;
69
output  [7:0]   MAC_tx_addr_data    ;
70
                //CPU               ;
71
input   [7:0]   MAC_add_prom_data   ;
72
input   [2:0]   MAC_add_prom_add    ;
73
input           MAC_add_prom_wr     ;
74
 
75
//******************************************************************************   
76
//internal signals                                                              
77
//******************************************************************************
78
reg [2:0]       add_rd;
79
wire[2:0]       add_wr;
80
wire[7:0]       din;
81
wire[7:0]       dout;
82
wire            wr_en;
83
reg             MAC_add_prom_wr_dl1;
84
reg             MAC_add_prom_wr_dl2;
85
//******************************************************************************   
86
//write data from cpu to prom                                                              
87
//******************************************************************************
88
always @ (posedge Clk or posedge Reset)
89
    if (Reset)
90
        begin
91
        MAC_add_prom_wr_dl1     <=0;
92
        MAC_add_prom_wr_dl2     <=0;
93
        end
94
    else
95
        begin
96
        MAC_add_prom_wr_dl1     <=MAC_add_prom_wr;
97
        MAC_add_prom_wr_dl2     <=MAC_add_prom_wr_dl1;
98
        end
99
assign # 2 wr_en   =MAC_add_prom_wr_dl1&!MAC_add_prom_wr_dl2;
100
assign # 2 add_wr  =MAC_add_prom_add;
101
assign # 2 din     =MAC_add_prom_data;
102
 
103
//******************************************************************************   
104
//read data from cpu to prom                                                              
105
//******************************************************************************
106
always @ (posedge Clk or posedge Reset)
107
    if (Reset)
108
        add_rd       <=0;
109
    else if (MAC_tx_addr_init)
110
        add_rd       <=0;
111
    else if (MAC_tx_addr_rd)
112
        add_rd       <=add_rd + 1;
113
assign MAC_tx_addr_data=dout;
114
//******************************************************************************   
115
//b port for read ,a port for write .
116
//******************************************************************************
117
duram #(8,3,"M512","DUAL_PORT") U_duram(
118
.data_a         (din            ),
119
.wren_a         (wr_en          ),
120
.address_a      (add_wr         ),
121
.address_b      (add_rd         ),
122
.clock_a        (Clk            ),
123
.clock_b        (Clk            ),
124
.q_b            (dout           ));
125
 
126
 
127
endmodule
128
 

powered by: WebSVN 2.1.0

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