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

Subversion Repositories theia_gpu

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

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

Line No. Rev Author Line
1 74 diegovalve
`timescale 1ns / 1ps
2
`include "aDefinitions.v"
3
 
4
module SWAP_MEM # ( parameter DATA_WIDTH=`DATA_ROW_WIDTH, parameter ADDR_WIDTH=`DATA_ADDRESS_WIDTH, parameter MEM_SIZE=128 )
5
(
6
        input wire                                                              Clock,
7
        input wire                                                              iSelect,
8
        input wire                                                              iWriteEnableA,
9
        input wire[ADDR_WIDTH-1:0]                       iReadAddressA0,
10
        input wire[ADDR_WIDTH-1:0]                       iReadAddressA1,
11
        input wire[ADDR_WIDTH-1:0]                       iWriteAddressA,
12
        input wire[DATA_WIDTH-1:0]                       iDataInA,
13
        output wire [DATA_WIDTH-1:0]             oDataOutA0,
14
        output wire [DATA_WIDTH-1:0]             oDataOutA1,
15
 
16
 
17
        input wire                                                              iWriteEnableB,
18
        input wire[ADDR_WIDTH-1:0]                       iReadAddressB0,
19
        input wire[ADDR_WIDTH-1:0]                       iReadAddressB1,
20
        input wire[ADDR_WIDTH-1:0]                       iWriteAddressB,
21
        input wire[DATA_WIDTH-1:0]                       iDataInB,
22
        output wire [DATA_WIDTH-1:0]             oDataOutB0,
23
        output wire [DATA_WIDTH-1:0]             oDataOutB1
24
);
25
 
26
 
27
wire                                                            wWriteEnableA;
28
wire[ADDR_WIDTH-1:0]                     wReadAddressA0;
29
wire[ADDR_WIDTH-1:0]                     wReadAddressA1;
30
wire[ADDR_WIDTH-1:0]                     wWriteAddressA;
31
wire[DATA_WIDTH-1:0]                     wDataInA;
32
wire [DATA_WIDTH-1:0]            wDataOutA0;
33
wire [DATA_WIDTH-1:0]            wDataOutA1;
34
 
35
wire                                                            wWriteEnableB;
36
wire[ADDR_WIDTH-1:0]                     wReadAddressB0;
37
wire[ADDR_WIDTH-1:0]                     wReadAddressB1;
38
wire[ADDR_WIDTH-1:0]                     wWriteAddressB;
39
wire[DATA_WIDTH-1:0]                     wDataInB;
40
wire [DATA_WIDTH-1:0]            wDataOutB0;
41
wire [DATA_WIDTH-1:0]            wDataOutB1;
42
 
43
 
44
assign wWriteEnableA = ( iSelect ) ? iWriteEnableA : iWriteEnableB;
45
assign wWriteEnableB = ( ~iSelect ) ? iWriteEnableA : iWriteEnableB;
46
 
47
assign wReadAddressA0 = ( iSelect ) ? iReadAddressA0 : iReadAddressB0;
48
assign wReadAddressB0 = ( ~iSelect ) ? iReadAddressA0 : iReadAddressB0;
49
 
50
assign wReadAddressA1 = ( iSelect ) ? iReadAddressA1 : iReadAddressB1;
51
assign wReadAddressB1 = ( ~iSelect ) ? iReadAddressA1 : iReadAddressB1;
52
 
53
assign wWriteAddressA = ( iSelect ) ? iWriteAddressA : iWriteAddressB;
54
assign wWriteAddressB = ( ~iSelect ) ? iWriteAddressA : iWriteAddressB;
55
 
56
assign wDataInA = ( iSelect ) ? iDataInA : iDataInB;
57
assign wDataInB = ( ~iSelect ) ? iDataInA : iDataInB;
58
 
59
assign oDataOutA0 = ( iSelect ) ? wDataOutA0 : wDataOutB0;
60
assign oDataOutB0 = ( ~iSelect ) ? wDataOutA0 : wDataOutB0;
61
 
62
assign oDataOutA1 = ( iSelect ) ? wDataOutA1 : wDataOutB1;
63
assign oDataOutB1 = ( ~iSelect ) ? wDataOutA1 : wDataOutB1;
64
 
65
RAM_DUAL_READ_PORT  # (DATA_WIDTH,ADDR_WIDTH,MEM_SIZE) MEM_A
66
(
67
        .Clock( Clock ),
68
        .iWriteEnable( wWriteEnableA ),
69
        .iReadAddress0( wReadAddressA0  ),
70
        .iReadAddress1( wReadAddressA1 ),
71
        .iWriteAddress( wWriteAddressA ),
72
        .iDataIn( wDataInA ),
73
        .oDataOut0( wDataOutA0 ),
74
        .oDataOut1( wDataOutA1 )
75
);
76
 
77
 
78
RAM_DUAL_READ_PORT  # (DATA_WIDTH,ADDR_WIDTH,MEM_SIZE) MEM_B
79
(
80
        .Clock( Clock ),
81
        .iWriteEnable( wWriteEnableB ),
82
        .iReadAddress0( wReadAddressB0  ),
83
        .iReadAddress1( wReadAddressB1 ),
84
        .iWriteAddress( wWriteAddressB ),
85
        .iDataIn( wDataInB ),
86
        .oDataOut0( wDataOutB0 ),
87
        .oDataOut1( wDataOutB1 )
88
);
89
 
90
endmodule

powered by: WebSVN 2.1.0

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