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

Subversion Repositories amber

[/] [amber/] [trunk/] [hw/] [vlog/] [lib/] [xs6_sram_256x32_byte_en.v] - Blame information for rev 35

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

Line No. Rev Author Line
1 2 csantifort
//////////////////////////////////////////////////////////////////
2
//                                                              //
3
//  Wrapper for Xilinx Spartan-6 RAM Block                      //
4
//                                                              //
5
//  This file is part of the Amber project                      //
6
//  http://www.opencores.org/project,amber                      //
7
//                                                              //
8
//  Description                                                 //
9
//  256 words x 32 bits with a write enable per byte            //
10
//                                                              //
11
//  Author(s):                                                  //
12
//      - Conor Santifort, csantifort.amber@gmail.com           //
13
//                                                              //
14
//////////////////////////////////////////////////////////////////
15
//                                                              //
16
// Copyright (C) 2010 Authors and OPENCORES.ORG                 //
17
//                                                              //
18
// This source file may be used and distributed without         //
19
// restriction provided that this copyright statement is not    //
20
// removed from the file and that any derivative work contains  //
21
// the original copyright notice and the associated disclaimer. //
22
//                                                              //
23
// This source file is free software; you can redistribute it   //
24
// and/or modify it under the terms of the GNU Lesser General   //
25
// Public License as published by the Free Software Foundation; //
26
// either version 2.1 of the License, or (at your option) any   //
27
// later version.                                               //
28
//                                                              //
29
// This source is distributed in the hope that it will be       //
30
// useful, but WITHOUT ANY WARRANTY; without even the implied   //
31
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      //
32
// PURPOSE.  See the GNU Lesser General Public License for more //
33
// details.                                                     //
34
//                                                              //
35
// You should have received a copy of the GNU Lesser General    //
36
// Public License along with this source; if not, download it   //
37
// from http://www.opencores.org/lgpl.shtml                     //
38
//                                                              //
39
//////////////////////////////////////////////////////////////////
40
 
41
 
42
module xs6_sram_256x32_byte_en
43
#(
44
parameter DATA_WIDTH    = 32,
45
parameter ADDRESS_WIDTH = 8
46
)
47
 
48
(
49
input                           i_clk,
50
input      [DATA_WIDTH-1:0]     i_write_data,
51
input                           i_write_enable,
52
input      [ADDRESS_WIDTH-1:0]  i_address,
53
input      [3:0]                i_byte_enable,
54
output     [DATA_WIDTH-1:0]     o_read_data
55
);
56
 
57
 
58
wire [2:0] nc31, nc32, nc33;
59
wire [1:0] nc22;
60
wire [3:0]  wea;
61
assign wea = {4{i_write_enable}} & i_byte_enable;
62
 
63
 
64
RAMB8BWER #(
65
    .DATA_WIDTH_A        ( 36                   ),
66
    .DATA_WIDTH_B        ( 36                   ),
67
    .RAM_MODE            ( "SDP"                ),
68
    .SIM_COLLISION_CHECK ( "GENERATE_X_ONLY"    ),
69
    .WRITE_MODE_A        ( "READ_FIRST"         ),
70
    .WRITE_MODE_B        ( "READ_FIRST"         )
71
 )
72
u_ramb8bwer (
73
    .CLKAWRCLK           ( i_clk                  ),
74
    .CLKBRDCLK           ( i_clk                  ),
75
    .ADDRAWRADDR         ( {i_address, 5'd0}      ),
76
    .ADDRBRDADDR         ( {i_address, 5'd0}      ),
77
    .ENAWREN             ( i_write_enable         ),
78
    .ENBRDEN             ( ~i_write_enable        ),
79
    .WEAWEL              ( wea[1:0]               ),
80
    .WEBWEU              ( wea[3:2]               ),
81
    .DIADI               ( i_write_data[15:0]     ),
82
    .DOADO               ( o_read_data [15:0]     ),
83
    .DIBDI               ( i_write_data[31:16]    ),
84
    .DOBDO               ( o_read_data [31:16]    ),
85
 
86
    // These guys are not used, so they are just tied off
87
    // ----------------------------------------------------
88
    .DIPBDIP        (2'd0),
89
    .DIPADIP        (2'd0),
90
    .DOPADOP        (),
91
    .DOPBDOP        (),
92
 
93
    .REGCEA         (1'd0),
94
    .REGCEBREGCE    (1'd0),
95
    .RSTA           (1'd0),
96
    .RSTBRST        (1'd0)
97
);
98
 
99
 
100
//synopsys translate_off
101
initial
102
    begin
103
    if ( DATA_WIDTH    != 32  )
104
        $display("%M (xx_sram_256x32_byte_en) Warning: Incorrect parameter DATA_WIDTH");
105
    if ( ADDRESS_WIDTH != 8   )
106
        $display("%M (xx_sram_256x32_byte_en) Warning: Incorrect parameter ADDRESS_WIDTH");
107
    end
108
//synopsys translate_on
109
 
110
endmodule
111
 
112
 

powered by: WebSVN 2.1.0

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