SharpWeapon
Member level 5
- Joined
- Mar 18, 2014
- Messages
- 89
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 6
- Activity points
- 705
Hi,
I want to INFER the DSP48 slice as a multiplier for large numbers, more than 25x18( I did this by instantiating), specifically 35x35. In UG193 page 71, it is described that to have 35x35 it needs 4 slices with 6 clock cycles latency(to achieve this I used a shift register, so that the synthesizer will understand to use the DSP slice's registers ). I was basically trying to do this in the following code, but I keep on getting zero definition of * error. What did I do wrong.
I want to INFER the DSP48 slice as a multiplier for large numbers, more than 25x18( I did this by instantiating), specifically 35x35. In UG193 page 71, it is described that to have 35x35 it needs 4 slices with 6 clock cycles latency(to achieve this I used a shift register, so that the synthesizer will understand to use the DSP slice's registers ). I was basically trying to do this in the following code, but I keep on getting zero definition of * error. What did I do wrong.
Code:
entity InferingTest is
generic(dataWidth: integer:=35);
port(
en: in STD_LOGIC;
CLK: in STD_LOGIC;
A: in STD_LOGIC_VECTOR(dataWidth-1 downto 0);
B: in STD_LOGIC_VECTOR(dataWidth-1 downto 0);
P: out STD_LOGIC_VECTOR(2*dataWidth-1 downto 0)
);
end InferingTest;
architecture Behavioral of InferingTest is
constant latencyForDSP: integer:=5;
type arr is array(latencyForDSP downto 0) of STD_LOGIC_VECTOR(2*dataWidth-1 downto 0);
signal shiftReg: arr;
signal PP: STD_LOGIC_VECTOR(2*dataWidth-1 downto 0);
begin
P<=shiftReg(latencyForDSP);
process(CLK)
begin
if(CLK'event and CLK='1') then
if(en='1') then
PP<=A * B;
shiftReg(0)<=PP;
shiftReg(1 to latencyForDSP)<=shiftReg(0 to latencyForDSP-1);
end if;
end if;
end process;
end Behavioral;