Archived
1
0
This repository has been archived on 2025-05-03. You can view files and clone it, but cannot push or open issues or pull requests.
Files
SEm-Labos/Libs/NanoBlaze/hdl/registerFile_RTL.vhd
github-classroom[bot] d212040c30 Initial commit
2024-02-23 13:01:05 +00:00

27 lines
959 B
VHDL

ARCHITECTURE RTL OF registerFile IS
subtype registerType is signed(registersIn'range);
type registerArrayType is array (0 to 2**registerAddressBitNb-1) of registerType;
signal registerArray : registerArrayType;
BEGIN
------------------------------------------------------------------------------
-- write to registers
updateRegister: process(reset, clock)
begin
if reset = '1' then
registerArray <= (others => (others => '0'));
elsif rising_edge(clock) then
if regWrite = '1' then
registerArray(to_integer(addrA)) <= registersIn;
end if;
end if;
end process updateRegister;
------------------------------------------------------------------------------
-- read from registers
opA <= registerArray(to_integer(addrA));
opB <= registerArray(to_integer(addrB));
END ARCHITECTURE RTL;