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

Subversion Repositories potato

[/] [potato/] [trunk/] [src/] [pp_control_unit.vhd] - Diff between revs 14 and 58

Show entire file | Details | Blame | View Log

Rev 14 Rev 58
Line 23... Line 23...
                rd_write            : out std_logic;
                rd_write            : out std_logic;
                branch              : out branch_type;
                branch              : out branch_type;
 
 
                -- Exception signals:
                -- Exception signals:
                decode_exception       : out std_logic;
                decode_exception       : out std_logic;
                decode_exception_cause : out std_logic_vector(4 downto 0);
                decode_exception_cause : out csr_exception_cause;
 
 
                -- Control register signals:
                -- Control register signals:
                csr_write : out csr_write_mode;
                csr_write : out csr_write_mode;
                csr_imm   : out std_logic; --! Indicating an immediate variant of the csrr* instructions.
                csr_imm   : out std_logic; --! Indicating an immediate variant of the csrr* instructions.
 
 
Line 43... Line 43...
        );
        );
end entity pp_control_unit;
end entity pp_control_unit;
 
 
architecture behaviour of pp_control_unit is
architecture behaviour of pp_control_unit is
        signal exception       : std_logic;
        signal exception       : std_logic;
        signal exception_cause : std_logic_vector(4 downto 0);
        signal exception_cause : csr_exception_cause;
        signal alu_op_temp     : alu_operation;
        signal alu_op_temp     : alu_operation;
begin
begin
 
 
        csr_imm <= funct3(2);
        csr_imm <= funct3(2);
        alu_op <= alu_op_temp;
        alu_op <= alu_op_temp;
Line 123... Line 123...
                                if funct3 = b"000" then
                                if funct3 = b"000" then
                                        rd_write <= '0';
                                        rd_write <= '0';
 
 
                                        if funct12 = x"000" then
                                        if funct12 = x"000" then
                                                exception <= '1';
                                                exception <= '1';
                                                exception_cause <= CSR_CAUSE_SYSCALL;
                                                exception_cause <= CSR_CAUSE_ECALL;
                                                branch <= BRANCH_NONE;
                                                branch <= BRANCH_NONE;
                                        elsif funct12 = x"001" then
                                        elsif funct12 = x"001" then
                                                exception <= '1';
                                                exception <= '1';
                                                exception_cause <= CSR_CAUSE_BREAKPOINT;
                                                exception_cause <= CSR_CAUSE_BREAKPOINT;
                                                branch <= BRANCH_NONE;
                                                branch <= BRANCH_NONE;
                                        elsif funct12 = x"800" then
                                        elsif funct12 = CSR_EPC_ERET then
                                                exception <= '0';
                                                exception <= '0';
                                                exception_cause <= CSR_CAUSE_NONE;
                                                exception_cause <= CSR_CAUSE_NONE;
                                                branch <= BRANCH_SRET;
                                                branch <= BRANCH_SRET;
                                        else
                                        else
                                                exception <= '1';
                                                exception <= '1';

powered by: WebSVN 2.1.0

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