1 | /* |
---|
2 | * $Id: Sort_allocation.cpp 112 2009-03-18 22:36:26Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Generic/Sort/include/Sort.h" |
---|
9 | #include "Behavioural/include/Allocation.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace generic { |
---|
14 | namespace sort { |
---|
15 | |
---|
16 | #undef FUNCTION |
---|
17 | #define FUNCTION "Sort::allocation" |
---|
18 | void Sort::allocation ( |
---|
19 | #ifdef STATISTICS |
---|
20 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
21 | #else |
---|
22 | void |
---|
23 | #endif |
---|
24 | ) |
---|
25 | { |
---|
26 | log_printf(FUNC,Sort,FUNCTION,"Begin"); |
---|
27 | |
---|
28 | _component = new Component (_usage); |
---|
29 | |
---|
30 | Entity * entity = _component->set_entity (_name |
---|
31 | ,"Sort" |
---|
32 | #ifdef POSITION |
---|
33 | ,COMBINATORY |
---|
34 | #endif |
---|
35 | ); |
---|
36 | |
---|
37 | _interfaces = entity->set_interfaces(); |
---|
38 | |
---|
39 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
40 | { |
---|
41 | Interface * interface = _interfaces->set_interface("" |
---|
42 | #ifdef POSITION |
---|
43 | ,IN |
---|
44 | ,SOUTH, |
---|
45 | "Generalist interface" |
---|
46 | #endif |
---|
47 | ); |
---|
48 | |
---|
49 | in_CLOCK = interface->set_signal_clk ("clock" ,1, CLOCK_VHDL_YES); |
---|
50 | in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1, RESET_VHDL_YES); |
---|
51 | } |
---|
52 | |
---|
53 | // ~~~~~[ Interface : "input" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
54 | { |
---|
55 | ALLOC1_INTERFACE_BEGIN("input", IN, WEST, "List of data unsort",_param->_nb_input); |
---|
56 | |
---|
57 | ALLOC1_SIGNAL_IN(in_INPUT_VAL ,"val" , Tcontrol_t, 1); |
---|
58 | ALLOC1_SIGNAL_IN(in_INPUT_DATA,"data", Tdata_t , _param->_size_data); |
---|
59 | |
---|
60 | ALLOC1_INTERFACE_END(_param->_nb_input); |
---|
61 | } |
---|
62 | |
---|
63 | // ~~~~~[ Interface : "output" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
64 | { |
---|
65 | ALLOC1_INTERFACE_BEGIN("output",OUT, EAST, "List of data sort",_param->_nb_output); |
---|
66 | |
---|
67 | ALLOC1_SIGNAL_OUT(out_OUTPUT_VAL ,"val" ,Tcontrol_t,1); |
---|
68 | if (_param->_have_port_index_out) |
---|
69 | ALLOC1_SIGNAL_OUT(out_OUTPUT_INDEX,"index",Taddress_t,_param->_size_address); |
---|
70 | if (_param->_have_port_data_out) |
---|
71 | ALLOC1_SIGNAL_OUT(out_OUTPUT_DATA ,"data" ,Tdata_t ,_param->_size_data ); |
---|
72 | |
---|
73 | ALLOC1_INTERFACE_END(_param->_nb_output); |
---|
74 | } |
---|
75 | |
---|
76 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
77 | |
---|
78 | #ifdef POSITION |
---|
79 | if (usage_is_set(_usage,USE_POSTION)) |
---|
80 | _component->generate_file(); |
---|
81 | #endif |
---|
82 | |
---|
83 | log_printf(FUNC,Sort,FUNCTION,"End"); |
---|
84 | }; |
---|
85 | |
---|
86 | }; // end namespace sort |
---|
87 | }; // end namespace generic |
---|
88 | |
---|
89 | }; // end namespace behavioural |
---|
90 | }; // end namespace morpheo |
---|