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

Subversion Repositories potato

[/] [potato/] [trunk/] [src/] [pp_types.vhd] - Blame information for rev 45

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 skordal
-- The Potato Processor - A simple processor for FPGAs
2
-- (c) Kristian Klomsten Skordal 2014 - 2015 <kristian.skordal@wafflemail.net>
3 3 skordal
-- Report bugs and issues on <http://opencores.org/project,potato,bugtracker>
4 2 skordal
 
5
library ieee;
6
use ieee.std_logic_1164.all;
7
 
8
package pp_types is
9
 
10
        --! Type used for register addresses.
11
        subtype register_address is std_logic_vector(4 downto 0);
12
 
13
        --! The available ALU operations.
14
        type alu_operation is (
15
                        ALU_AND, ALU_OR, ALU_XOR,
16
                        ALU_SLT, ALU_SLTU,
17
                        ALU_ADD, ALU_SUB,
18
                        ALU_SRL, ALU_SLL, ALU_SRA,
19 14 skordal
                        ALU_NOP, ALU_INVALID
20 2 skordal
                );
21
 
22
        --! Types of branches.
23
        type branch_type is (
24
                        BRANCH_NONE, BRANCH_JUMP, BRANCH_JUMP_INDIRECT, BRANCH_CONDITIONAL, BRANCH_SRET
25
                );
26
 
27
        --! Source of an ALU operand.
28
        type alu_operand_source is (
29
                        ALU_SRC_REG, ALU_SRC_IMM, ALU_SRC_SHAMT, ALU_SRC_PC, ALU_SRC_PC_NEXT, ALU_SRC_NULL, ALU_SRC_CSR
30
                );
31
 
32
        --! Type of memory operation:
33
        type memory_operation_type is (
34
                        MEMOP_TYPE_NONE, MEMOP_TYPE_INVALID, MEMOP_TYPE_LOAD, MEMOP_TYPE_LOAD_UNSIGNED, MEMOP_TYPE_STORE
35
                );
36
 
37
        -- Determines if a memory operation is a load:
38
        function memop_is_load(input : in memory_operation_type) return boolean;
39
 
40
        --! Size of a memory operation:
41
        type memory_operation_size is (
42
                        MEMOP_SIZE_BYTE, MEMOP_SIZE_HALFWORD, MEMOP_SIZE_WORD
43
                );
44
 
45 45 skordal
        --! Wishbone master output signals:
46
        type wishbone_master_outputs is record
47
                        adr : std_logic_vector(31 downto 0);
48
                        sel : std_logic_vector( 3 downto 0);
49
                        cyc : std_logic;
50
                        stb : std_logic;
51
                        we  : std_logic;
52
                        dat : std_logic_vector(31 downto 0);
53
                end record;
54
 
55
        --! Wishbone master input signals:
56
        type wishbone_master_inputs is record
57
                        dat : std_logic_vector(31 downto 0);
58
                        ack : std_logic;
59
                end record;
60
 
61 2 skordal
end package pp_types;
62
 
63
package body pp_types is
64
 
65
        function memop_is_load(input : in memory_operation_type) return boolean is
66
        begin
67
                return (input = MEMOP_TYPE_LOAD or input = MEMOP_TYPE_LOAD_UNSIGNED);
68
        end function memop_is_load;
69
 
70
end package body pp_types;

powered by: WebSVN 2.1.0

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