1 | ---------------------------------------------------------------------------------- |
---|
2 | -- Company: |
---|
3 | -- Engineer: KIEGAING EMMANUEL GEL EN 5 |
---|
4 | -- |
---|
5 | -- Create Date: 18:54:08 04/19/2011 |
---|
6 | -- Design Name: |
---|
7 | -- Module Name: RAM_64 - Behavioral |
---|
8 | -- Project Name: |
---|
9 | -- Target Devices: |
---|
10 | -- Tool versions: |
---|
11 | -- Description: SYNTHESE d'une RAM 64 octet par inferation |
---|
12 | -- la ram possède un port d'écriture et un port de lecture |
---|
13 | -- le port primaire est à lecture et ecrite et le port secondaire à lecture seule |
---|
14 | -- |
---|
15 | -- Dependencies: |
---|
16 | -- |
---|
17 | -- Revision: |
---|
18 | -- Revision 0.01 - File Created |
---|
19 | -- Additional Comments: |
---|
20 | -- |
---|
21 | ---------------------------------------------------------------------------------- |
---|
22 | library IEEE; |
---|
23 | use IEEE.STD_LOGIC_1164.ALL; |
---|
24 | use IEEE.STD_LOGIC_ARITH.ALL; |
---|
25 | use IEEE.STD_LOGIC_UNSIGNED.ALL; |
---|
26 | Library NocLib; |
---|
27 | use NocLib.CoreTypes.all; |
---|
28 | ---- Uncomment the following library declaration if instantiating |
---|
29 | ---- any Xilinx primitives in this code. |
---|
30 | --library UNISIM; |
---|
31 | --use UNISIM.VComponents.all; |
---|
32 | |
---|
33 | entity RAM_64 is |
---|
34 | Port ( clka, clkb : in std_logic; |
---|
35 | wea : in std_logic; |
---|
36 | ena, enb : in std_logic; |
---|
37 | addra, addrb : in std_logic_vector(5 downto 0); |
---|
38 | dia : in std_logic_vector(Word-1 downto 0); |
---|
39 | dob : out std_logic_vector(Word-1 downto 0)); |
---|
40 | end RAM_64; |
---|
41 | |
---|
42 | architecture Behavioral of RAM_64 is |
---|
43 | type ram_type is array (63 downto 0) of std_logic_vector (Word-1 downto 0); |
---|
44 | signal RAM: ram_type; |
---|
45 | begin |
---|
46 | process (clka) |
---|
47 | begin |
---|
48 | if clka'event and clka = '1' then |
---|
49 | if ena = '1' then |
---|
50 | if wea = '1' then |
---|
51 | RAM(conv_integer(addra)) <= dia; |
---|
52 | end if; |
---|
53 | end if; |
---|
54 | end if; |
---|
55 | end process; |
---|
56 | |
---|
57 | process (clkb) |
---|
58 | begin |
---|
59 | if clkb'event and clkb = '1' then |
---|
60 | if enb = '1' then |
---|
61 | --dob <= RAM(conv_integer(addrb)) ; |
---|
62 | end if; |
---|
63 | end if; |
---|
64 | end process; |
---|
65 | dob <= RAM(conv_integer(addrb)) ; |
---|
66 | end Behavioral; |
---|
67 | |
---|