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

Subversion Repositories theia_gpu

[/] [theia_gpu/] [branches/] [beta_1.2/] [rtl/] [MEM/] [Module_RAM.v] - Blame information for rev 87

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 20 diegovalve
`timescale 1ns / 1ps
2
`include "aDefinitions.v"
3
/**********************************************************************************
4
Theia, Ray Cast Programable graphic Processing Unit.
5
Copyright (C) 2010  Diego Valverde (diego.valverde.g@gmail.com)
6
 
7
This program is free software; you can redistribute it and/or
8
modify it under the terms of the GNU General Public License
9
as published by the Free Software Foundation; either version 2
10
of the License, or (at your option) any later version.
11
 
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
GNU General Public License for more details.
16
 
17
You should have received a copy of the GNU General Public License
18
along with this program; if not, write to the Free Software
19
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20
 
21
***********************************************************************************/
22
//--------------------------------------------------------
23
//Dual port RAM.
24
 
25 60 diegovalve
 
26 74 diegovalve
module RAM_DUAL_READ_PORT # ( parameter DATA_WIDTH=`DATA_ROW_WIDTH, parameter ADDR_WIDTH=`DATA_ADDRESS_WIDTH, parameter MEM_SIZE=128 )
27 20 diegovalve
(
28 60 diegovalve
        input wire                                              Clock,
29
        input wire                                              iWriteEnable,
30
        input wire[ADDR_WIDTH-1:0]       iReadAddress0,
31
        input wire[ADDR_WIDTH-1:0]       iReadAddress1,
32
        input wire[ADDR_WIDTH-1:0]       iWriteAddress,
33
        input wire[DATA_WIDTH-1:0]                       iDataIn,
34
        output reg [DATA_WIDTH-1:0]              oDataOut0,
35
        output reg [DATA_WIDTH-1:0]              oDataOut1
36 20 diegovalve
);
37
 
38 74 diegovalve
reg [DATA_WIDTH-1:0] Ram [MEM_SIZE:0];
39 20 diegovalve
 
40
always @(posedge Clock)
41
begin
42
 
43
                if (iWriteEnable)
44
                        Ram[iWriteAddress] <= iDataIn;
45
 
46
 
47
                        oDataOut0 <= Ram[iReadAddress0];
48
                        oDataOut1 <= Ram[iReadAddress1];
49
 
50
end
51
endmodule
52
//--------------------------------------------------------

powered by: WebSVN 2.1.0

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