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

Subversion Repositories hicovec

[/] [hicovec/] [trunk/] [cpu/] [units/] [instructioncounter.vhd] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 hmanske
------------------------------------------------------------------
2 4 hmanske
-- PROJECT:      HiCoVec (highly configurable vector processor)
3 2 hmanske
--
4
-- ENTITY:      instructioncounter
5
--
6
-- PURPOSE:     instruction counter
7
--              basically a 32 bit register with increment
8
--
9
-- AUTHOR:      harald manske, haraldmanske@gmx.de
10
--
11
-- VERSION:     1.0
12
-----------------------------------------------------------------
13
library ieee;
14
use ieee.std_logic_1164.all;
15
use ieee.std_logic_arith.all;
16
use ieee.numeric_std.all;
17
 
18
entity instructioncounter is
19
    port(   clk:        in std_logic;
20
            load:       in std_logic;
21
            inc:        in std_logic;
22
            reset:      in std_logic;
23
            data_in:    in std_logic_vector(31 downto 0);
24
            data_out:   out std_logic_vector(31 downto 0)
25
         );
26
end instructioncounter;
27
 
28
architecture rtl of instructioncounter is
29
    signal data_out_buffer:  unsigned(31 downto 0);
30
begin
31
    process
32
    begin
33
        wait until clk='1' and clk'event;
34
        if reset = '1' then
35
            data_out_buffer <= "00000000000000000000000000000000";
36
        else
37
            if load = '1' and inc = '0' then
38
                data_out_buffer <= unsigned(data_in);
39
            end if;
40
 
41
            if load = '0' and inc = '1' then
42
                data_out_buffer <= data_out_buffer + inc;
43
            end if;
44
 
45
            if (load = inc) then
46
                data_out_buffer <= data_out_buffer;
47
            end if;
48
        end if;
49
        end process;
50
 
51
    data_out <= std_logic_vector(data_out_buffer);
52
 
53
end rtl;
54
 

powered by: WebSVN 2.1.0

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