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

Subversion Repositories amber

[/] [amber/] [trunk/] [hw/] [vlog/] [ethmac/] [eth_spram_256x32.v] - Blame information for rev 39

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

Line No. Rev Author Line
1 2 csantifort
//////////////////////////////////////////////////////////////////
2
//                                                              //
3
//  Wrapper for SRAM buffer module                              //
4
//                                                              //
5
//  This file is part of the Amber project                      //
6
//  http://www.opencores.org/project,amber                      //
7
//                                                              //
8
//  Description                                                 //
9
//                                                              //
10
//  Author(s):                                                  //
11
//      - Conor Santifort, csantifort.amber@gmail.com           //
12
//                                                              //
13
//////////////////////////////////////////////////////////////////
14
//                                                              //
15
// Copyright (C) 2010 Authors and OPENCORES.ORG                 //
16
//                                                              //
17
// This source file may be used and distributed without         //
18
// restriction provided that this copyright statement is not    //
19
// removed from the file and that any derivative work contains  //
20
// the original copyright notice and the associated disclaimer. //
21
//                                                              //
22
// This source file is free software; you can redistribute it   //
23
// and/or modify it under the terms of the GNU Lesser General   //
24
// Public License as published by the Free Software Foundation; //
25
// either version 2.1 of the License, or (at your option) any   //
26
// later version.                                               //
27
//                                                              //
28
// This source is distributed in the hope that it will be       //
29
// useful, but WITHOUT ANY WARRANTY; without even the implied   //
30
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      //
31
// PURPOSE.  See the GNU Lesser General Public License for more //
32
// details.                                                     //
33
//                                                              //
34
// You should have received a copy of the GNU Lesser General    //
35
// Public License along with this source; if not, download it   //
36
// from http://www.opencores.org/lgpl.shtml                     //
37
//                                                              //
38
//////////////////////////////////////////////////////////////////
39
 
40
`include "timescale.v"
41
 
42
module eth_spram_256x32(
43
        //
44
        // Generic synchronous single-port RAM interface
45
        //
46
        input           clk,  // Clock, rising edge
47
        input           rst,  // Reset, active high
48
        input           ce,   // Chip enable input, active high
49
        input  [3:0]    we,   // Write enable input, active high
50
        input           oe,   // Output enable input, active high
51
        input  [7:0]    addr, // address bus inputs
52
        input  [31:0]   di,   // input data bus
53
        output [31:0]   do    // output data bus
54
 
55
);
56
 
57
wire write_enable;
58
assign write_enable = ce & (|we);
59
 
60
`ifdef XILINX_SPARTAN6_FPGA
61
    xs6_sram_256x32_byte_en
62
`endif
63
 
64
`ifdef XILINX_VIRTEX6_FPGA
65
    xv6_sram_256x32_byte_en
66
`endif
67
 
68
`ifndef XILINX_FPGA
69
    generic_sram_byte_en
70
`endif
71
 
72
    #(
73
    .DATA_WIDTH     ( 32            ) ,
74
    .ADDRESS_WIDTH  ( 8             )
75
) u_ram (
76
    .i_clk          ( clk           ),
77
    .i_write_data   ( di            ),
78
    .i_write_enable ( write_enable  ),
79
    .i_address      ( addr          ),
80
    .i_byte_enable  ( we            ),
81
    .o_read_data    ( do            )
82
);
83
 
84
 
85
endmodule

powered by: WebSVN 2.1.0

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