I am a beginner to VHDL, and I am trying to make a multiplier, but the code I have to use from the book is not compiling right with the xilinx software. The code is:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity testMult is
Port ( ISwitch : in STD_LOGIC_VECTOR (3 downto 0);
IPress : in STD_LOGIC;
IRegIn : in STD_LOGIC_VECTOR (31 downto 0);
IRegOut : out STD_LOGIC_VECTOR (31 downto 0);
Iclk : in STD_LOGIC);
end testMult;
architecture Beh of testMult is
component asMult
port(ISwitch : in STD_LOGIC_VECTOR (3 downto 0);
IRegA : in STD_LOGIC_VECTOR (7 downto 0);
IRegB : in STD_LOGIC_VECTOR (7 downto 0);
IRegProd : out STD_LOGIC_VECTOR (15 downto 0);
Iclk : in STD_LOGIC;
St : in STD_LOGIC;
Done : out STD_LOGIC);
end component;
constant aValue : std_logic_vector:= IRegIn(7 downto 0);
constant bValue : std_logic_vector:= IRegIn(15 downto 8);
signal Done : std_logic;
signal St : std_logic;
signal IRegA, IRegB : std_logic_vector(7 downto 0);
signal IRegProd : std_logic_vector(15 downto 0);
signal CLK : std_logic;
begin
CLK <= not CLK after 10 ns;
process
begin
if IPress = '1' then
IRegA <= aValue;
IRegB <= bValue;
St <= '0';
wait until CLK = '1' and CLK'event;
St <= '1';
wait until Done = '0' and Done'event;
IRegOut <= IRegProd & IRegIn(15 downto 8) & IRegin(7 downto 0);
end if;
end process;
asMult1 : asMult port map (ISwitch, aValue, bValue, IRegProd, Iclk, St, Done);
end Beh;
But I keep getting this error: line 36: Same wait conditions expected in all Multiple Waits.
Are you trying to synthesize that code, or you just want to simulate it? The code won't synthesize because:
CLK <= not CLK after 10 ns
is not a synthesizable statement, andIf you only want to simulate the code, there are still other problems with your example, but at least it compiles ok with Modelsim ASE 10.1b. My guess would be your compiler is trying to synthesize the code.