URL
https://opencores.org/ocsvn/igor/igor/trunk
[/] [igor/] [trunk/] [processor/] [pl/] [mem.vhd] - Blame information for rev 4
Details |
Compare with Previous |
View Log
Line No. |
Rev |
Author |
Line |
1 |
4 |
atypic |
library ieee;
|
2 |
|
|
use ieee.std_logic_1164.all;
|
3 |
|
|
|
4 |
|
|
use work.whisk_constants.all;
|
5 |
|
|
|
6 |
|
|
entity mem is
|
7 |
|
|
port (
|
8 |
|
|
-- Pipeline control signals
|
9 |
|
|
clk : in std_logic;
|
10 |
|
|
exec_reg_write : in std_logic; -- Register write control signal
|
11 |
|
|
|
12 |
|
|
mem_reg_write : out std_logic; -- Register write enable signal feed forward
|
13 |
|
|
mem_mem_to_reg : out std_logic; -- Write result from memory (indiates a load, basically)
|
14 |
|
|
|
15 |
|
|
-- Pipeline data signals
|
16 |
|
|
address : in std_logic_vector(WORD_BITS - 1 downto 0); -- address to write to (also result from alu)
|
17 |
|
|
data : in std_logic_vector(WORD_BITS - 1 downto 0); -- data to be written
|
18 |
|
|
|
19 |
|
|
mem_loaded_data : out std_logic_vector(WORD_BITS - 1 downto 0); -- Data fetched from memory
|
20 |
|
|
mem_alu_result : out std_logic_vector(WORD_BITS - 1 downto 0); -- Result from ALU
|
21 |
|
|
|
22 |
|
|
-- To/From bidirectional bus interface
|
23 |
|
|
mem_read_data : in std_logic_vector(WORD_BITS - 1 downto 0);
|
24 |
|
|
mem_write_data : out std_logic_vector(WORD_BITS - 1 downto 0);
|
25 |
|
|
mem_address : out std_logic_vector(ADDR_BITS - 1 downto 0);
|
26 |
|
|
|
27 |
|
|
-- Control signals memory
|
28 |
|
|
write_mem : out std_logic; -- Indicates a memory write
|
29 |
|
|
read_mem : out std_logic; -- Indicates a memory read
|
30 |
|
|
memory_wait : in std_logic -- Stall for memory.
|
31 |
|
|
|
32 |
|
|
);
|
33 |
|
|
end entity;
|
34 |
|
|
|
35 |
|
|
architecture mixed of mem is
|
36 |
|
|
begin
|
37 |
|
|
-- cache
|
38 |
|
|
|
39 |
|
|
mem_stage : process
|
40 |
|
|
begin
|
41 |
|
|
if rising_edge(clk) then
|
42 |
|
|
-- Control signals feed forward.
|
43 |
|
|
--mem_reg_write <= exec_reg_write;
|
44 |
|
|
--mem_mem_to_reg <= read_mem; -- For write-back mux.
|
45 |
|
|
|
46 |
|
|
-- Data paths
|
47 |
|
|
--mem_alu_result <= address; -- Address is also result.
|
48 |
|
|
--mem_loaded_data <= mem_read_data; -- From bus interface.
|
49 |
|
|
end if;
|
50 |
|
|
end process;
|
51 |
|
|
end architecture;
|
52 |
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.