Цитата(enzaime @ Nov 15 2015, 19:38)

Приобрёл себе такую платку DE0 nano с ПЛИС на ней EP4CE22F17C6
В документации прочитал, что 1 18х18 умножитель может работать на частоте 287 МГц, а 9х9 умножитель на частоте 340 МГц
https://www.altera.com/content/dam/altera-w.../cyiv-53001.pdf стр 26.
А мне хочется использовать 32 битное умножение, но на частоте >10 МГц оно правильно не работает. Можно ли как-то ускорить это дело? А то 10 МГц как-то мало, я ожидал что-то вроде 150 МГц.
Использовал я это дело так (результат смотрел на компе. По сигналу ready считывается значение регистра mult, причём на умножение тратится 1 такт, так можно понять успевает оно выполниться на задаваемой частоте или нет) :
если быстро можно так
Код
library ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
entity pipelined_multiplier is
-- generic size is the width of multiplier/multiplicand;
-- generic level is the intended number of stages of the
-- pipelined multiplier;
-- generic level is typically the smallest integer greater
-- than or equal to base 2 logarithm of size, as returned by
-- function log, which you define.
generic (size : integer := 32; level : integer := 1); -- level : integer := log(size)
port (
a : in std_logic_vector (size-1 downto 0);
b : in std_logic_vector (size-1 downto 0);
clk : in std_logic;
pdt : out std_logic_vector (2*size-1 downto 0));
end pipelined_multiplier;
architecture exemplar of pipelined_multiplier is
type levels_of_registers is array (level-1 downto 0) of
unsigned (2*size-1 downto 0);
signal a_int, b_int : unsigned (size-1 downto 0);
signal pdt_int : levels_of_registers;
begin
pdt <= std_logic_vector (pdt_int (level-1));
process(clk)
begin
if clk'event and clk = '1' then
-- multiplier operand inputs are registered
a_int <= unsigned (a);
b_int <= unsigned (b);
-- 'level' levels of registers to be inferred at the
-- output of the multiplier
pdt_int(0) <= a_int * b_int;
for i in 1 to level-1 loop
pdt_int (i) <= pdt_int (i-1);
end loop;
end if;
end process;
end exemplar;
При level = 1 (минимально возможный pipeline) на StratixIV дает тактовую частоту 346,5 МГц, а на четвортом циклоне будет меньше...
If it doesn't work in simulation, it won't work on the board.
"Ты живешь в своих поступках, а не в теле. Ты — это твои действия, и нет другого тебя" Антуан де Сент-Экзюпери повесть "Маленький принц"