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 <log creation="2018-05-02">
\r
12 <library name="IEEE">
\r
13 <package name="std_logic_1164" use="all"/>
\r
14 <package name="numeric_std" use="all"/>
\r
21 signal a_s : signed(@eval{@val{in_width}-1} downto 0);
\r
22 signal b_s : signed(@eval{@val{in_width}-1} downto 0);
\r
23 signal c_s : signed(@eval{2*@val{in_width}-1} downto 0);
\r
24 signal result : signed(@eval{2*@val{in_width}-1} downto 0);
\r
28 a_s <= signed(@{a});
\r
29 b_s <= signed(@{b});
\r
30 c_s <= resize(signed(@{wb_c}),@eval{2*@val{in_width}});
\r
32 do_mult_process : process (@{clk}, @{rst})
\r
34 if @{rst} = '1' then
\r
36 result <= to_signed(0,@eval{2*@val{in_width});
\r
38 elsif (rising_edge(@{clk})) then
\r
40 if @{wb_do_op} = '1' then
\r
41 result <= a_s * b_s + c_s;
\r
45 end process do_mult_process;
\r
47 @{d} <= std_logic_vector(result);
\r
48 @{wb_d} <= std_logic_vector(resize(result,2*wb_data_width));
\r