So here is what I am trying to do:
Build an 8x4-bit wide array of delay registers. Three multiplexors select three of the registers, based on the opcode driven by selectlines SR1, SR2, and DR, and pass them out of the component. It's Pretty basic. Here is the code that is breaking: (Why doesn't HT have the 'attach code' feature?')
The source of the problem is the array instantiation. It works fine in simulation but below I past the problems I get in synthesis.
---------------RegisterFile---------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity RegisterFile is
port(SR1, SR2, DR: in std_logic_vector(2 downto 0);
DR_data: in std_logic_vector(3 downto 0);
WE: std_logic_vector(7 downto 0);
CLK, RegSet, RegReset: in std_logic;
RegOutDr, RegOut1, RegOut2: out std_logic_vector(3 downto 0));
end RegisterFile;
architecture MixedDescription of RegisterFile is
component Register4
port(D: in std_logic_vector(3 downto 0);
WE, clk, RegSet, RegReset: in std_logic;
Q: inout std_logic_vector(3 downto 0));
end component;
type atex4BITARRAY is array (7 downto 0) of std_logic_vector(3 downto 0);
signal Q_array: atex4BITARRAY;
begin
RegFile8: for i in 0 to 7 generate
begin
Regx: Register4 port map (DR_DATA, WE(i), clk, RegSet, RegReset, Q_array(i));
end generate RegFile8;
process(SR1, Q_array)
begin
case SR1 is
when "000" =>
RegOut1 <= Q_array(0);
when "001" =>
RegOut1 <= Q_array(1);
when "010" =>
RegOut1 <= Q_array(2);
when "011" =>
RegOut1 <= Q_array(3);
when "100" =>
RegOut1 <= Q_array(4);
when "101" =>
RegOut1 <= Q_array(5);
when "110" =>
RegOut1 <= Q_array(6);
when "111" =>
RegOut1 <= Q_array(7);
when others => null;
end case;
end process;
process(SR2,Q_array)
begin
case SR2 is
when "000" =>
RegOut2 <= Q_array(0);
when "001" =>
RegOut2 <= Q_array(1);
when "010" =>
RegOut2 <= Q_array(2);
when "011" =>
RegOut2 <= Q_array(3);
when "100" =>
RegOut2 <= Q_array(4);
when "101" =>
RegOut2 <= Q_array(5);
when "110" =>
RegOut2 <= Q_array(6);
when "111" =>
RegOut2 <= Q_array(7);
when others => null;
end case;
end process;
-- Process to output the destination register contents to RegOutDR
process(DR, Q_array)
begin
case DR is
when "000" =>
RegOutDR <= Q_array(0);
when "001" =>
RegOutDR <= Q_array(1);
when "010" =>
RegOutDR <= Q_array(2);
when "011" =>
RegOutDR <= Q_array(3);
when "100" =>
RegOutDR <= Q_array(4);
when "101" =>
RegOutDR <= Q_array(5);
when "110" =>
RegOutDR <= Q_array(6);
when "111" =>
RegOutDR <= Q_array(7);
when others => null;
end case;
end process;
--Process to write data into the register file
process(CLK)
begin
if clk'event and clk = '1' then
for i in 0 to 7 loop
Q_array(i) <= DR_Data;
end loop;
end if;
end process;
end MixedDescription;
Now, in synthesis, I get the following error:
Synthesizing Unit <registerfile>.
Related source file is c:/engineering/xilinx/bin/mips_core/../../../SOURCE/PRegisterFile.vhd.
Register <Q_array<1>> equivalent to <Q_array<0>> has been removed
Register <Q_array<2>> equivalent to <Q_array<0>> has been removed
Register <Q_array<3>> equivalent to <Q_array<0>> has been removed
Register <Q_array<4>> equivalent to <Q_array<0>> has been removed
Register <Q_array<5>> equivalent to <Q_array<0>> has been removed
Register <Q_array<6>> equivalent to <Q_array<0>> has been removed
Register <Q_array<7>> equivalent to <Q_array<0>> has been removed
Found 4-bit 8-to-1 multiplexer for signal <RegOutDr>.
Found 4-bit 8-to-1 multiplexer for signal <RegOut1>.
Found 4-bit 8-to-1 multiplexer for signal <RegOut2>.
Found 4-bit register for signal <Q_array<0>>.
Summary:
inferred 4 D-type flip-flop(s).
inferred 12 Multiplexer(s).
Unit <registerfile> synthesized.
It's removing those signals. It shouldn't be. Is there another way to achieve the same ends? Appreciate any advice!
Build an 8x4-bit wide array of delay registers. Three multiplexors select three of the registers, based on the opcode driven by selectlines SR1, SR2, and DR, and pass them out of the component. It's Pretty basic. Here is the code that is breaking: (Why doesn't HT have the 'attach code' feature?')
The source of the problem is the array instantiation. It works fine in simulation but below I past the problems I get in synthesis.
---------------RegisterFile---------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity RegisterFile is
port(SR1, SR2, DR: in std_logic_vector(2 downto 0);
DR_data: in std_logic_vector(3 downto 0);
WE: std_logic_vector(7 downto 0);
CLK, RegSet, RegReset: in std_logic;
RegOutDr, RegOut1, RegOut2: out std_logic_vector(3 downto 0));
end RegisterFile;
architecture MixedDescription of RegisterFile is
component Register4
port(D: in std_logic_vector(3 downto 0);
WE, clk, RegSet, RegReset: in std_logic;
Q: inout std_logic_vector(3 downto 0));
end component;
type atex4BITARRAY is array (7 downto 0) of std_logic_vector(3 downto 0);
signal Q_array: atex4BITARRAY;
begin
RegFile8: for i in 0 to 7 generate
begin
Regx: Register4 port map (DR_DATA, WE(i), clk, RegSet, RegReset, Q_array(i));
end generate RegFile8;
process(SR1, Q_array)
begin
case SR1 is
when "000" =>
RegOut1 <= Q_array(0);
when "001" =>
RegOut1 <= Q_array(1);
when "010" =>
RegOut1 <= Q_array(2);
when "011" =>
RegOut1 <= Q_array(3);
when "100" =>
RegOut1 <= Q_array(4);
when "101" =>
RegOut1 <= Q_array(5);
when "110" =>
RegOut1 <= Q_array(6);
when "111" =>
RegOut1 <= Q_array(7);
when others => null;
end case;
end process;
process(SR2,Q_array)
begin
case SR2 is
when "000" =>
RegOut2 <= Q_array(0);
when "001" =>
RegOut2 <= Q_array(1);
when "010" =>
RegOut2 <= Q_array(2);
when "011" =>
RegOut2 <= Q_array(3);
when "100" =>
RegOut2 <= Q_array(4);
when "101" =>
RegOut2 <= Q_array(5);
when "110" =>
RegOut2 <= Q_array(6);
when "111" =>
RegOut2 <= Q_array(7);
when others => null;
end case;
end process;
-- Process to output the destination register contents to RegOutDR
process(DR, Q_array)
begin
case DR is
when "000" =>
RegOutDR <= Q_array(0);
when "001" =>
RegOutDR <= Q_array(1);
when "010" =>
RegOutDR <= Q_array(2);
when "011" =>
RegOutDR <= Q_array(3);
when "100" =>
RegOutDR <= Q_array(4);
when "101" =>
RegOutDR <= Q_array(5);
when "110" =>
RegOutDR <= Q_array(6);
when "111" =>
RegOutDR <= Q_array(7);
when others => null;
end case;
end process;
--Process to write data into the register file
process(CLK)
begin
if clk'event and clk = '1' then
for i in 0 to 7 loop
Q_array(i) <= DR_Data;
end loop;
end if;
end process;
end MixedDescription;
Now, in synthesis, I get the following error:
Synthesizing Unit <registerfile>.
Related source file is c:/engineering/xilinx/bin/mips_core/../../../SOURCE/PRegisterFile.vhd.
Register <Q_array<1>> equivalent to <Q_array<0>> has been removed
Register <Q_array<2>> equivalent to <Q_array<0>> has been removed
Register <Q_array<3>> equivalent to <Q_array<0>> has been removed
Register <Q_array<4>> equivalent to <Q_array<0>> has been removed
Register <Q_array<5>> equivalent to <Q_array<0>> has been removed
Register <Q_array<6>> equivalent to <Q_array<0>> has been removed
Register <Q_array<7>> equivalent to <Q_array<0>> has been removed
Found 4-bit 8-to-1 multiplexer for signal <RegOutDr>.
Found 4-bit 8-to-1 multiplexer for signal <RegOut1>.
Found 4-bit 8-to-1 multiplexer for signal <RegOut2>.
Found 4-bit register for signal <Q_array<0>>.
Summary:
inferred 4 D-type flip-flop(s).
inferred 12 Multiplexer(s).
Unit <registerfile> synthesized.
It's removing those signals. It shouldn't be. Is there another way to achieve the same ends? Appreciate any advice!