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

Subversion Repositories uos_processor

[/] [vhdl/] [cpusequencer.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 droggen
-- Generates the CPU state sequence seq: ld1 (00), ld2 (01), exec (10)
2
-- Implementation with a D FF with synchronous reset and enable
3
 
4
library IEEE;
5
use IEEE.STD_LOGIC_1164.ALL;
6
use IEEE.STD_LOGIC_UNSIGNED.ALL;
7
 
8
entity cpusequencer is
9
        port(
10
                clk : in STD_LOGIC;
11
                rst : in STD_LOGIC;
12
                en : in STD_LOGIC;
13
                seq : out STD_LOGIC_VECTOR(1 downto 0)
14
                );
15
end cpusequencer;
16
 
17
architecture Behavioral of cpusequencer is
18
        signal s : STD_LOGIC_VECTOR(1 downto 0);
19
begin
20
 
21
        process(clk,rst)
22
        begin
23
                if rising_edge(clk) then
24
                        if rst='1' then
25
                                s<="00";
26
                        else
27
                                if en='1' then
28
                                        if s="10" then
29
                                                s <= "00";
30
                                        else
31
                                                s <= s+1;
32
                                        end if;
33
                                end if;
34
                        end if;
35
                end if;
36
        end process;
37
 
38
        seq <= s;
39
 
40
end Behavioral;
41
 

powered by: WebSVN 2.1.0

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