1 | /* |
---|
2 | * $Id: Multiplier_allocation.cpp 116 2009-04-30 13:51:41Z moulu $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Generic/Multiplier/include/Multiplier.h" |
---|
9 | #include "Behavioural/include/Allocation.h" |
---|
10 | #include "Common/include/Max.h" |
---|
11 | |
---|
12 | namespace morpheo { |
---|
13 | namespace behavioural { |
---|
14 | namespace generic { |
---|
15 | namespace multiplier { |
---|
16 | |
---|
17 | |
---|
18 | |
---|
19 | #undef FUNCTION |
---|
20 | #define FUNCTION "Multiplier::allocation" |
---|
21 | void Multiplier::allocation ( |
---|
22 | #ifdef STATISTICS |
---|
23 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
24 | #else |
---|
25 | void |
---|
26 | #endif |
---|
27 | ) |
---|
28 | { |
---|
29 | log_begin(Multiplier,FUNCTION); |
---|
30 | |
---|
31 | _component = new Component (_usage); |
---|
32 | |
---|
33 | Entity * entity = _component->set_entity (_name |
---|
34 | ,"Multiplier" |
---|
35 | #ifdef POSITION |
---|
36 | ,COMBINATORY |
---|
37 | #endif |
---|
38 | ); |
---|
39 | |
---|
40 | _interfaces = entity->set_interfaces(); |
---|
41 | |
---|
42 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
43 | { |
---|
44 | Interface * interface = _interfaces->set_interface("" |
---|
45 | #ifdef POSITION |
---|
46 | ,IN |
---|
47 | ,SOUTH, |
---|
48 | _("Generalist interface") |
---|
49 | #endif |
---|
50 | ); |
---|
51 | |
---|
52 | in_CLOCK = interface->set_signal_clk ("clock" ,1, CLOCK_VHDL_YES); |
---|
53 | in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1, RESET_VHDL_YES); |
---|
54 | } |
---|
55 | |
---|
56 | // ~~~~~[ Interface "multiplier" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
57 | { |
---|
58 | ALLOC0_INTERFACE_BEGIN("multiplier", IN, WEST, _("Multiplier's interface.")); |
---|
59 | |
---|
60 | ALLOC0_SIGNAL_IN ( in_MULTIPLIER_DATA_IN_0,"data_in_0",Tdata_t ,_param->_size_data); |
---|
61 | ALLOC0_SIGNAL_IN ( in_MULTIPLIER_DATA_IN_1,"data_in_1",Tdata_t ,_param->_size_data); |
---|
62 | ALLOC0_SIGNAL_IN ( in_MULTIPLIER_NSTALL ,"nstall" ,Tcontrol_t,1); |
---|
63 | ALLOC0_SIGNAL_OUT(out_MULTIPLIER_DATA_LSB_OUT ,"data_lsb_out" ,Tdata_t ,_param->_size_data); |
---|
64 | ALLOC0_SIGNAL_OUT(out_MULTIPLIER_DATA_MSB_OUT ,"data_msb_out" ,Tdata_t ,_param->_size_data); |
---|
65 | |
---|
66 | ALLOC0_INTERFACE_END(); |
---|
67 | } |
---|
68 | |
---|
69 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
70 | #ifdef SYSTEMC |
---|
71 | if (usage_is_set(_usage,USE_SYSTEMC_BODY)) |
---|
72 | { |
---|
73 | _pipeline = new std::vector<result_t>(_param->_latency+1); |
---|
74 | } |
---|
75 | #endif |
---|
76 | |
---|
77 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
78 | |
---|
79 | #ifdef POSITION |
---|
80 | if (usage_is_set(_usage,USE_POSITION)) |
---|
81 | _component->generate_file(); |
---|
82 | #endif |
---|
83 | |
---|
84 | log_end(Multiplier,FUNCTION); |
---|
85 | }; |
---|
86 | |
---|
87 | }; // end namespace multiplier |
---|
88 | }; // end namespace generic |
---|
89 | |
---|
90 | }; // end namespace behavioural |
---|
91 | }; // end namespace morpheo |
---|