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

Subversion Repositories igor

[/] [igor/] [trunk/] [processor/] [pl/] [hazard.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
library work;
5
use work.leval2_package.all;
6
 
7
 
8
entity Hazard is
9
        port (
10
                IFIDopc : in std_logic_vector(INSTR_OPCODE_BITS - 1 downto 0);
11
                IFIDR1 : in std_logic_vector(REGS_ADDR_BITS - 1 downto 0);
12
                IFIDR2 : in std_logic_vector(REGS_ADDR_BITS - 1 downto 0);
13
                IDEXopc : in std_logic_vector(INSTR_OPCODE_BITS - 1 downto 0);
14
                IDEXR1 : in std_logic_vector(REGS_ADDR_BITS - 1 downto 0);
15
                IDEXR2 : in std_logic_vector(REGS_ADDR_BITS - 1 downto 0);
16
                EXMEMopc : in std_logic_vector(INSTR_OPCODE_BITS - 1 downto 0);
17
                EXMEMR1 : in std_logic_vector(REGS_ADDR_BITS - 1 downto 0);
18
                EXMEMR2 : in std_logic_vector(REGS_ADDR_BITS - 1 downto 0);
19
                Hazard : out std_logic
20
        );
21
end entity;
22
 
23
architecture mixed of Hazard is
24
begin
25
        hazard_detection : process (IDEXopc,IDEXR1,IDEXR2,EXMEMopc,EXMEMR1,EXMEMR2)
26
        begin
27
        if IDEXopc = LOAD and (IFIDR1 = IDEXR2 or IFIDR2 = IDEXR2) then
28
                        Hazard <= '1';
29
        elsif EXMEMopc = LOAD and (IFIDR1 = EXMEMR2 or IFIDR2 = EXMEMR2) then
30
            Hazard <= '1';
31
                end if;
32
        end process;
33
end architecture;
34
 
35
 
36
 
37
 

powered by: WebSVN 2.1.0

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