1 <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
\r
2 <block_impl ref_name="multadd.xml" ref_md5="">
\r
4 <author firstname="stephane" lastname="Domas" mail="sdomas@univ-fcomte.fr" />
\r
5 <date creation="2015/04/27" />
\r
6 <related_files list=""/>
\r
8 This component is a multadd
\r
16 <library name="IEEE">
\r
17 <package name="std_logic_1164" use="all"/>
\r
18 <package name="numeric_std" use="all"/>
\r
25 signal a_s : signed(@eval{@val{in_width}-1} downto 0);
\r
26 signal b_s : signed(@eval{@val{in_width}-1} downto 0);
\r
27 signal c_s : signed(@eval{2*@val{in_width}-1} downto 0);
\r
28 signal result : signed(@eval{2*@val{in_width}-1} downto 0);
\r
32 a_s <= signed(@{a});
\r
33 b_s <= signed(@{b});
\r
34 c_s <= resize(signed(@{wb_c}),@eval{2*@val{in_width}});
\r
36 do_mult_process : process (@{clk}, @{rst})
\r
38 if @{rst} = '1' then
\r
40 result <= to_signed(0,@eval{2*@val{in_width});
\r
42 elsif (rising_edge(@{clk})) then
\r
44 if @{wb_do_op} = '1' then
\r
45 result <= a_s * b_s + c_s;
\r
49 end process do_mult_process;
\r
51 @{d} <= std_logic_vector(result);
\r
52 @{wb_d} <= std_logic_vector(resize(result,2*wb_data_width));
\r
58 <parameter name="m" value="1" />
\r