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

Subversion Repositories xucpu

[/] [xucpu/] [trunk/] [VHDL/] [pipeline/] [processor-arch.vhdl] - Blame information for rev 25

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 lcdsgmtr
-- Copyright 2015, Jürgen Defurne
2
--
3
-- This file is part of the Experimental Unstable CPU System.
4
--
5
-- The Experimental Unstable CPU System Is free software: you can redistribute
6
-- it and/or modify it under the terms of the GNU Lesser General Public License
7
-- as published by the Free Software Foundation, either version 3 of the
8
-- License, or (at your option) any later version.
9
--
10
-- The Experimental Unstable CPU System is distributed in the hope that it will
11
-- be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
13
-- General Public License for more details.
14
--
15
-- You should have received a copy of the GNU Lesser General Public License
16
-- along with Experimental Unstable CPU System. If not, see
17
-- http://www.gnu.org/licenses/lgpl.txt.
18
 
19
 
20
ARCHITECTURE ROFSM OF processor IS
21
 
22
  TYPE processor_state IS (P0, P1, P2);
23
 
24
  SIGNAL current_state : processor_state := P0;
25
  SIGNAL next_state    : processor_state := P0;
26
 
27
BEGIN  -- ARCHITECTURE ROFSM
28
 
29
  next_state_logic : PROCESS (current_state, FULL) IS
30
  BEGIN  -- PROCESS next_state_logic
31
    CASE current_state IS
32
      WHEN P0 =>
33
        IF FULL = '0' THEN
34
          next_state <= P0;
35
        ELSE
36
          next_state <= P1;
37
        END IF;
38
      WHEN P1 =>
39
        next_state <= P2;
40
      WHEN P2 =>
41
        next_state <= P1;
42
    END CASE;
43
  END PROCESS next_state_logic;
44
 
45
  state_register : PROCESS (CLK, RST) IS
46
  BEGIN  -- PROCESS next_state_logic
47
    IF rising_edge(CLK) THEN
48
      IF RST = '1' THEN
49
        current_state <= P0;
50
      ELSE
51
        current_state <= next_state;
52
      END IF;
53
    END IF;
54
 
55
  END PROCESS state_register;
56
 
57
  output_logic : PROCESS (next_state) IS
58
  BEGIN  -- PROCESS next_state_logic
59
    CASE current_state IS
60
      WHEN P0 =>
61
        PULL <= '0';
62
      WHEN P1 =>
63
        PULL <= '1';
64
      WHEN P2 =>
65
        PULL <= '0';
66
    END CASE;
67
 
68
  END PROCESS output_logic;
69
 
70
END ARCHITECTURE ROFSM;

powered by: WebSVN 2.1.0

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