]> AND Private Git Repository - blast.git/blob - lib/implementations/multadd_impl.xml
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
started top group gen, added project subdirs
[blast.git] / lib / implementations / multadd_impl.xml
1 <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>\r
2 <block_impl ref_name="multadd.xml" ref_md5="">\r
3   <comments>\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
7     <description>\r
8       This component is a multadd\r
9     </description>\r
10     <notes>\r
11       No notes\r
12     </notes>\r
13   </comments>\r
14 \r
15   <libraries>\r
16     <library name="IEEE">\r
17       <package name="std_logic_1164" use="all"/>\r
18       <package name="numeric_std" use="all"/>\r
19     </library>\r
20   </libraries>\r
21 \r
22   <architecture>\r
23 \r
24    -- Signals\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
29 \r
30 begin\r
31 \r
32   a_s &lt;= signed(@{a});\r
33   b_s &lt;= signed(@{b});\r
34   c_s &lt;= resize(signed(@{wb_c}),@eval{2*@val{in_width}});\r
35   \r
36   do_mult_process : process (@{clk}, @{rst})\r
37   begin\r
38     if @{rst} = '1' then\r
39       \r
40       result &lt;= to_signed(0,@eval{2*@val{in_width});\r
41       \r
42     elsif (rising_edge(@{clk})) then\r
43 \r
44       if @{wb_do_op} = '1' then\r
45         result &lt;= a_s * b_s + c_s;\r
46       end if;\r
47       \r
48     end if;\r
49   end process do_mult_process;\r
50 \r
51   @{d} &lt;= std_logic_vector(result);\r
52   @{wb_d} &lt;= std_logic_vector(resize(result,2*wb_data_width));\r
53   \r
54   </architecture>\r
55   \r
56 </block_impl>\r