[116] | 1 | #ifdef VHDL |
---|
| 2 | /* |
---|
| 3 | * $Id: Multiplier_vhdl_xilinx_body.cpp 116 2009-04-30 13:51:41Z moulu $ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/Generic/Multiplier/include/Multiplier.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace generic { |
---|
| 14 | namespace multiplier { |
---|
| 15 | |
---|
| 16 | #undef FUNCTION |
---|
| 17 | #define FUNCTION "Multiplier::vhdl_xilinx_body" |
---|
| 18 | void Multiplier::vhdl_xilinx_body (Vhdl * & vhdl) |
---|
| 19 | { |
---|
| 20 | |
---|
| 21 | log_begin(Multiplier,FUNCTION); |
---|
| 22 | vhdl->set_body (0,"ins_mult_gen_v9_0 : mult_gen_v9_0"); |
---|
| 23 | vhdl->set_body (1,"generic map ("); |
---|
| 24 | vhdl->set_body (2," c_xdevicefamily => \"virtex4\", -- specifies target Xilinx FPGA name"); |
---|
| 25 | vhdl->set_body (2," c_a_width => "+toString(_param->_size_data)+", -- width of A port"); |
---|
| 26 | vhdl->set_body (2," c_a_type => "+toString(_param->_sign)+", -- datatype of A port"); |
---|
| 27 | vhdl->set_body (2," c_b_width => "+toString(_param->_size_data)+", -- width of B port"); |
---|
| 28 | vhdl->set_body (2," c_b_type => "+toString(_param->_sign)+", -- datatype of B port"); |
---|
| 29 | vhdl->set_body (2," c_out_high => "+toString((_param->_size_data*2)-1)+", -- MSB of P output port (N-1 downto 0 convention)"); |
---|
| 30 | vhdl->set_body (2," c_mult_type => 1, -- Type of multiplier to implement"); |
---|
| 31 | vhdl->set_body (2," c_opt_goal => 1, -- Optimization of multiplier"); |
---|
| 32 | vhdl->set_body (2," c_has_ce => 1, -- Use clock enable on all registers"); |
---|
| 33 | vhdl->set_body (2," c_pipe_stages => "+toString(_param->_latency)+") -- Number of register stages required"); |
---|
| 34 | |
---|
| 35 | vhdl->set_body (1,"port map ("); |
---|
| 36 | vhdl->set_body (2,"clk => in_CLOCK ,"); |
---|
| 37 | vhdl->set_body (2,"a => in_MULTIPLIER_DATA_IN_0,"); |
---|
| 38 | vhdl->set_body (2,"b => in_MULTIPLIER_DATA_IN_1,"); |
---|
| 39 | vhdl->set_body (2,"ce => in_MULTIPLIER_NSTALL ,"); |
---|
| 40 | vhdl->set_body (2,"p => sig_MULTIPLIER_DATA_OUT);"); |
---|
| 41 | |
---|
| 42 | vhdl->set_body (0,"out_MULTIPLIER_DATA_LSB_OUT <= sig_MULTIPLIER_DATA_OUT("+toString(_param->_size_data-1)+" downto 0);"); |
---|
| 43 | vhdl->set_body (0,"out_MULTIPLIER_DATA_MSB_OUT <= sig_MULTIPLIER_DATA_OUT("+toString((_param->_size_data*2)-1)+" downto "+toString(_param->_size_data)+");"); |
---|
| 44 | |
---|
| 45 | log_end(Multiplier,FUNCTION); |
---|
| 46 | }; |
---|
| 47 | |
---|
| 48 | }; // end namespace multiplier |
---|
| 49 | }; // end namespace generic |
---|
| 50 | |
---|
| 51 | }; // end namespace behavioural |
---|
| 52 | }; // end namespace morpheo |
---|
| 53 | #endif |
---|