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

Subversion Repositories aor3000

[/] [aor3000/] [trunk/] [rtl/] [model/] [model_true_dual_ram.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 alfik
/*
2
 * This file is subject to the terms and conditions of the BSD License. See
3
 * the file "LICENSE" in the main directory of this archive for more details.
4
 *
5
 * Copyright (C) 2014 Aleksander Osman
6
 */
7
 
8
module model_true_dual_ram(
9
    input                       clk,
10
 
11
    input       [widthad-1:0]   address_a,
12
    input                       wren_a,
13
    input       [width-1:0]     data_a,
14
    output reg  [width-1:0]     q_a,
15
 
16
    input       [widthad-1:0]   address_b,
17
    input                       wren_b,
18
    input       [width-1:0]     data_b,
19
    output reg  [width-1:0]     q_b
20
); /* verilator public_module */
21
 
22
parameter width     = 1;
23
parameter widthad   = 1;
24
 
25
reg [width-1:0] mem [(2**widthad)-1:0];
26
 
27
always @(posedge clk) begin
28
    if(wren_a) mem[address_a] <= data_a;
29
 
30
    q_a <= mem[address_a];
31
end
32
 
33
always @(posedge clk) begin
34
    if(wren_b) mem[address_b] <= data_b;
35
 
36
    q_b <= mem[address_b];
37
end
38
 
39
endmodule

powered by: WebSVN 2.1.0

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