Line 28... |
Line 28... |
type dpMuxAluIn is (fromMemory, fromImediate, fromRegFileA);
|
type dpMuxAluIn is (fromMemory, fromImediate, fromRegFileA);
|
type controlUnitStates is (initial, fetch, decode, execute, executing);
|
type controlUnitStates is (initial, fetch, decode, execute, executing);
|
type executionStates is (initInstructionExecution, writeRegister, releaseWriteRead, s3, s4);
|
type executionStates is (initInstructionExecution, writeRegister, releaseWriteRead, s3, s4);
|
|
|
--! Flags positions
|
--! Flags positions
|
-- Posicoes em bits dos flags (8 bits)
|
|
constant flag_sign : integer := 2;
|
constant flag_sign : integer := 2;
|
constant flag_zero : integer := 1;
|
constant flag_zero : integer := 1;
|
constant flag_carry : integer := 0;
|
constant flag_carry : integer := 0;
|
|
|
function reg2Num (a: generalRegisters) return integer;
|
function reg2Num (a: generalRegisters) return integer;
|
Line 94... |
Line 93... |
constant sub_val : opcodes := conv_std_logic_vector(30,6); -- Subtract register and a imediate value
|
constant sub_val : opcodes := conv_std_logic_vector(30,6); -- Subtract register and a imediate value
|
constant inc_reg : opcodes := conv_std_logic_vector(31,6); -- Increment register
|
constant inc_reg : opcodes := conv_std_logic_vector(31,6); -- Increment register
|
constant dec_reg : opcodes := conv_std_logic_vector(32,6); -- Decrement register
|
constant dec_reg : opcodes := conv_std_logic_vector(32,6); -- Decrement register
|
|
|
-- Control opcodes
|
-- Control opcodes
|
constant nop : opcodes := conv_std_logic_vector(31,6); -- Nop...
|
constant nop : opcodes := conv_std_logic_vector(33,6); -- Nop...
|
constant halt : opcodes := conv_std_logic_vector(32,6); -- Halt processor
|
constant halt : opcodes := conv_std_logic_vector(34,6); -- Halt processor
|
|
|
end pkgOpenCPU32;
|
end pkgOpenCPU32;
|
|
|
--! Define functions or procedures
|
--! Define functions or procedures
|
package body pkgOpenCPU32 is
|
package body pkgOpenCPU32 is
|