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

Subversion Repositories minimips_superscalar

[/] [minimips_superscalar/] [trunk/] [sources/] [pps_ei_2.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 mcafruni
--------------------------------------------------------------------------
2
--                                                                      --
3
--                                                                      --
4
-- miniMIPS Superscalar Processor : Instruction extraction stage 2      --
5
-- based on miniMIPS Processor                                          --
6
--                                                                      --
7
--                                                                      --
8
-- Author : Miguel Cafruni                                              --
9
-- miguel_cafruni@hotmail.com                                           --
10
--                                                      December 2018   --
11
--------------------------------------------------------------------------
12
 
13
library IEEE;
14
use IEEE.std_logic_1164.all;
15
use IEEE.numeric_std.all;
16
 
17
library work;
18
use work.pack_mips.all;
19
 
20
entity pps_ei_2 is
21
port (
22
  clock : in std_logic;
23
  reset : in std_logic;
24
  clear : in std_logic;    -- Clear the pipeline stage
25
  stop_all2 : in std_logic; -- Evolution locking signal
26
 
27
  -- Asynchronous inputs
28
  stop_ei : in std_logic;  -- Lock the EI_adr and Ei_instr registers
29
  genop : in std_logic;    -- Send nops
30
 
31
  -- Bus controler interface
32
  CTE_instr : in bus32;    -- Instruction from the memory
33
  ETC_adr : out bus32;     -- Address to read in memory
34
 
35
  -- Synchronous inputs from PF stage
36
  PF_pc : in bus32;        -- Current value of the pc (desnecessario no EI2)
37
 
38
  -- Synchronous outputs to DI stage
39
  EI_instr : out bus32;    -- Read interface
40
  EI_adr : out bus32;      -- Address from the read instruction
41
  EI_it_ok : out std_logic -- Allow hardware interruptions
42
);
43
end pps_ei_2;
44
 
45
architecture rtl of pps_ei_2 is
46
begin
47
 
48
  ETC_adr <= PF_pc; -- Connexion of the PC to the memory address bus
49
 
50
  -- Set the results
51
  process (clock)
52
  begin
53
    if falling_edge(clock) then
54
      if reset='1' then
55
        EI_instr <= INS_NOP;
56
        EI_adr <= (others => '0');
57
        EI_it_ok <= '0';
58
      elsif stop_all2='0' then
59
        if clear='1' then
60
          -- Clear the stage
61
          EI_instr <= INS_NOP;
62
          EI_it_ok <= '0';
63
        elsif genop='1' and stop_ei='0' then
64
          -- Send a nop
65
          EI_instr <= INS_NOP;
66
          EI_it_ok <= '1';
67
        elsif stop_ei='0' then
68
          -- Normal evolution
69
          EI_adr <= PF_pc;
70
          EI_instr <= CTE_instr;
71
          EI_it_ok <= '1';
72
        end if;
73
      end if;
74
    end if;
75
  end process;
76
end rtl;

powered by: WebSVN 2.1.0

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