Line 29... |
Line 29... |
regFileReadAddrA : in generalRegisters; --! General register read address (PortA)
|
regFileReadAddrA : in generalRegisters; --! General register read address (PortA)
|
regFileReadAddrB : in generalRegisters; --! General register read address (PortB)
|
regFileReadAddrB : in generalRegisters; --! General register read address (PortB)
|
regFileEnA : in STD_LOGIC; --! Enable RegisterFile PortA
|
regFileEnA : in STD_LOGIC; --! Enable RegisterFile PortA
|
regFileEnB : in STD_LOGIC; --! Enable RegisterFile PortB
|
regFileEnB : in STD_LOGIC; --! Enable RegisterFile PortB
|
outputDp : out STD_LOGIC_VECTOR (n downto 0); --! DataPath Output
|
outputDp : out STD_LOGIC_VECTOR (n downto 0); --! DataPath Output
|
dpFlags : out STD_LOGIC_VECTOR (n downto 0)); --! Alu Flags
|
dpFlags : out STD_LOGIC_VECTOR (2 downto 0)); --! Alu Flags
|
end DataPath;
|
end DataPath;
|
|
|
--! @brief DataPath http://en.wikipedia.org/wiki/Datapath
|
--! @brief DataPath http://en.wikipedia.org/wiki/Datapath
|
--! @details This description will also show how to instantiate components(Alu, RegisterFile, Multiplexer) on your design
|
--! @details This description will also show how to instantiate components(Alu, RegisterFile, Multiplexer) on your design
|
architecture Behavioral of DataPath is
|
architecture Behavioral of DataPath is
|
Line 64... |
Line 64... |
COMPONENT Alu
|
COMPONENT Alu
|
generic (n : integer := nBits - 1); --! Generic value (Used to easily change the size of the Alu on the package)
|
generic (n : integer := nBits - 1); --! Generic value (Used to easily change the size of the Alu on the package)
|
Port ( A : in STD_LOGIC_VECTOR (n downto 0); --! Alu Operand 1
|
Port ( A : in STD_LOGIC_VECTOR (n downto 0); --! Alu Operand 1
|
B : in STD_LOGIC_VECTOR (n downto 0); --! Alu Operand 2
|
B : in STD_LOGIC_VECTOR (n downto 0); --! Alu Operand 2
|
S : out STD_LOGIC_VECTOR (n downto 0); --! Alu Output
|
S : out STD_LOGIC_VECTOR (n downto 0); --! Alu Output
|
|
flagsOut : out STD_LOGIC_VECTOR(2 downto 0); --! Flags from current operation
|
sel : in aluOps); --! Select operation
|
sel : in aluOps); --! Select operation
|
END COMPONENT;
|
END COMPONENT;
|
|
|
--! Component declaration to instantiate the testRegisterFile circuit
|
--! Component declaration to instantiate the testRegisterFile circuit
|
COMPONENT RegisterFile
|
COMPONENT RegisterFile
|
Line 123... |
Line 124... |
--! Instantiate the Unit Under Test (Alu) (Doxygen bug if it's not commented!)
|
--! Instantiate the Unit Under Test (Alu) (Doxygen bug if it's not commented!)
|
uAlu: Alu PORT MAP (
|
uAlu: Alu PORT MAP (
|
A => muxOutReg,
|
A => muxOutReg,
|
B => regFilePortB,
|
B => regFilePortB,
|
S => aluOut,
|
S => aluOut,
|
|
flagsOut => dpFlags,
|
sel => aluOp
|
sel => aluOp
|
);
|
);
|
|
|
--! Instantiate the Unit Under Test (RegisterFile) (Doxygen bug if it's not commented!)
|
--! Instantiate the Unit Under Test (RegisterFile) (Doxygen bug if it's not commented!)
|
uRegisterFile: RegisterFile PORT MAP (
|
uRegisterFile: RegisterFile PORT MAP (
|