source: XOpenSparcT1/trunk/Xilinx/cachedir.v @ 17

Revision 17, 1.1 KB checked in by pntsvt00, 13 years ago (diff)

la simulazione legge dalla flash

Line 
1`timescale 1ns / 1ps
2//////////////////////////////////////////////////////////////////////////////////
3// Company:
4// Engineer:
5//
6// Create Date:    12:52:07 03/14/2011
7// Design Name:
8// Module Name:    cachedir
9// Project Name:
10// Target Devices:
11// Tool versions:
12// Description:
13//
14// Dependencies:
15//
16// Revision:
17// Revision 0.01 - File Created
18// Additional Comments:
19//
20//////////////////////////////////////////////////////////////////////////////////
21module cachedir(
22    input clock,
23    input enable,
24    input wren_a,
25    input [ 8:0] address_a,
26    input [28:0] data_a,
27    output [ 28:0] q_a,
28    input wren_b,
29    input [ 8:0] address_b,
30    input [28:0] data_b,
31    output [28:0] q_b
32    );
33
34reg [28:0] mem1 [(2**8)-1:0];
35reg [28:0] mem2 [(2**8)-1:0];
36     
37always @(posedge clock)
38     begin
39                if (enable)
40         if (wren_a)
41            mem1[address_a] <= data_a;
42          end
43
44assign  q_a = mem1[address_a];   
45
46always @(posedge clock)
47     begin
48           if (enable)
49         if (wren_b)
50            mem2[address_b] <= data_b;
51     end
52assign  q_b = mem2[address_b];
53endmodule
Note: See TracBrowser for help on using the repository browser.