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

Subversion Repositories igor

[/] [igor/] [trunk/] [processor/] [mc/] [pc_incer.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 atypic
library ieee;
2
use ieee.std_logic_1164.all;
3
use ieee.std_logic_unsigned.all;
4
use work.leval_package.all;
5
 
6
entity pc_incer is
7
  port(
8
    clk       : in std_logic;
9
    rst                            : in std_logic;
10
    pause                                : in std_logic;
11
    offset                       : in std_logic_vector(MC_ADDR_SIZE - 1 downto 0);
12
    branch      : in std_logic;
13
    pc_next              : out std_logic_vector(MC_ADDR_SIZE - 1 downto 0) );
14
end entity;
15
 
16
architecture behav of pc_incer is
17
  signal pc_reg : std_logic_vector(MC_ADDR_SIZE-1 downto 0) := (others => '0');
18
begin
19
  pc_next <= pc_reg;
20
  pc_inc : process(clk, rst)
21
  begin
22
    if rising_edge(clk) then
23
      if rst = '1' then
24
        pc_reg <= (others => '0');
25
      elsif pause = '1' then
26
        if branch = '1' then
27
          pc_reg <= offset;
28
        elsif pc_reg > "1010111111111" then
29
          pc_reg <= (others => '0');
30
        else
31
          pc_reg <= pc_reg + 1;
32
        end if;
33
      end if;
34
    end if;
35
  end process pc_inc;
36
end architecture behav;

powered by: WebSVN 2.1.0

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