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

Subversion Repositories amber

[/] [amber/] [trunk/] [hw/] [vlog/] [lib/] [xs6_sram_256x21_line_en.v] - Blame information for rev 2

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 21 bits with a single write enable              //
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_256x21_line_en
43
#(
44
parameter DATA_WIDTH    = 21,
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
output     [DATA_WIDTH-1:0]     o_read_data
54
);
55
 
56
 
57
wire [15:0] read_data_lo, read_data_hi;
58
 
59
assign o_read_data = { read_data_hi[12:8], read_data_hi[4:0],
60
                       read_data_lo[12:8], read_data_lo[5:0] };
61
 
62
RAMB8BWER #(
63
    .DATA_WIDTH_A        ( 36                   ),
64
    .DATA_WIDTH_B        ( 36                   ),
65
    .RAM_MODE            ( "SDP"                ),
66
    .SIM_COLLISION_CHECK ( "GENERATE_X_ONLY"    ),
67
    .WRITE_MODE_A        ( "READ_FIRST"         ),
68
    .WRITE_MODE_B        ( "READ_FIRST"         )
69
 )
70
u_ramb8bwer (
71
    .CLKAWRCLK      ( i_clk                                                   ),
72
    .CLKBRDCLK      ( i_clk                                                   ),
73
    .ADDRAWRADDR    ( {i_address, 5'd0}                                       ),
74
    .ADDRBRDADDR    ( {i_address, 5'd0}                                       ),
75
    .ENAWREN        ( i_write_enable                                          ),
76
    .ENBRDEN        ( ~i_write_enable                                         ),
77
    .WEAWEL         ( {2{i_write_enable}}                                     ),
78
    .WEBWEU         ( {2{i_write_enable}}                                     ),
79
    .DIADI          ( {3'd0, i_write_data[10: 6], 2'd0, i_write_data[ 5: 0] } ),
80
    .DOADO          ( read_data_lo                                            ),
81
    .DIBDI          ( {3'd0, i_write_data[20:16], 3'd0, i_write_data[15:11] } ),
82
    .DOBDO          ( read_data_hi                                            ),
83
 
84
    // These guys are not used, so they are just tied off
85
    // ----------------------------------------------------
86
    .DIPBDIP        ( 2'd0                                                    ),
87
    .DIPADIP        ( 2'd0                                                    ),
88
    .DOPADOP        (                                                         ),
89
    .DOPBDOP        (                                                         ),
90
 
91
    .REGCEA         ( 1'd0                                                    ),
92
    .REGCEBREGCE    ( 1'd0                                                    ),
93
    .RSTA           ( 1'd0                                                    ),
94
    .RSTBRST        ( 1'd0                                                    )
95
);
96
 
97
 
98
//synopsys translate_off
99
initial
100
    begin
101
    if ( DATA_WIDTH    != 21  ) $display("%M Warning: Incorrect parameter DATA_WIDTH");
102
    if ( ADDRESS_WIDTH != 8   ) $display("%M Warning: Incorrect parameter ADDRESS_WIDTH");
103
    end
104
//synopsys translate_on
105
 
106
endmodule
107
 
108
 

powered by: WebSVN 2.1.0

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