Line 24... |
Line 24... |
alu_xor, alu_not, alu_shfLt, alu_shfRt, alu_roLt, alu_roRt);
|
alu_xor, alu_not, alu_shfLt, alu_shfRt, alu_roLt, alu_roRt);
|
type typeEnDis is (enable, disable);
|
type typeEnDis is (enable, disable);
|
type generalRegisters is (r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15);
|
type generalRegisters is (r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15);
|
type dpMuxInputs is (fromMemory, fromImediate, fromRegFileA, fromRegFileB, fromAlu);
|
type dpMuxInputs is (fromMemory, fromImediate, fromRegFileA, fromRegFileB, fromAlu);
|
type controlUnitStates is (initial, fetch, decode, execute, executing);
|
type controlUnitStates is (initial, fetch, decode, execute, executing);
|
|
type executionStates is (s0, s1, s2, s3, s4);
|
|
|
function reg2Num (a: generalRegisters) return integer;
|
function reg2Num (a: generalRegisters) return integer;
|
function Num2reg (a: integer) return generalRegisters;
|
function Num2reg (a: integer) return generalRegisters;
|
function muxPos( a: dpMuxInputs) return std_logic_vector;
|
function muxPos( a: dpMuxInputs) return std_logic_vector;
|
|
|
-- Opcodes
|
-- Opcodes
|
subtype opcodes is std_logic_vector(5 downto 0);
|
subtype opcodes is std_logic_vector(5 downto 0); -- 6 Bits (64 instructions max)
|
|
|
-- Each instruction will take 32 bits
|
-- Each instruction will take 32 bits
|
-- Tutorial on using records.. (http://vhdlguru.blogspot.com.br/2010/02/arrays-and-records-in-vhdl.html)
|
-- Tutorial on using records.. (http://vhdlguru.blogspot.com.br/2010/02/arrays-and-records-in-vhdl.html)
|
type instructionType is record
|
type instructionType is record
|
opcode : std_logic_vector(5 downto 0);
|
opcode : std_logic_vector(5 downto 0);
|