1 | /* |
---|
2 | * $Id: Counter_allocation.cpp 113 2009-04-14 18:39:12Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Generic/Counter/include/Counter.h" |
---|
9 | #include "Behavioural/include/Allocation.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace generic { |
---|
14 | namespace counter { |
---|
15 | |
---|
16 | void Counter::allocation (void) |
---|
17 | { |
---|
18 | log_printf(FUNC,Counter,"allocation","Begin"); |
---|
19 | |
---|
20 | _component = new Component (_usage); |
---|
21 | |
---|
22 | Entity * entity = _component->set_entity (_name |
---|
23 | ,_param->_type |
---|
24 | #ifdef POSITION |
---|
25 | ,COMBINATORY |
---|
26 | #endif |
---|
27 | ); |
---|
28 | |
---|
29 | _interfaces = entity->set_interfaces(); |
---|
30 | |
---|
31 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
32 | { |
---|
33 | Interface * interface = _interfaces->set_interface("" |
---|
34 | #ifdef POSITION |
---|
35 | , IN |
---|
36 | , SOUTH |
---|
37 | , _("Generalist interface") |
---|
38 | #endif |
---|
39 | ); |
---|
40 | |
---|
41 | in_CLOCK = interface->set_signal_clk ("clock" ,1,CLOCK_VHDL_NO); |
---|
42 | in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1,RESET_VHDL_NO); |
---|
43 | } |
---|
44 | |
---|
45 | // ~~~~~[ Interface : "counter" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
46 | { |
---|
47 | ALLOC1_INTERFACE_BEGIN("counter", IN, SOUTH, _("Counter interface"), _param->_nb_port); |
---|
48 | |
---|
49 | ALLOC1_SIGNAL_IN ( in_COUNTER_DATA ,"data" ,Tdata_t ,_param->_size_data); |
---|
50 | ALLOC1_SIGNAL_IN ( in_COUNTER_ADDSUB,"addsub",Tcontrol_t,1 ); |
---|
51 | ALLOC1_SIGNAL_OUT(out_COUNTER_DATA ,"data" ,Tdata_t ,_param->_size_data); |
---|
52 | |
---|
53 | ALLOC1_INTERFACE_END(_param->_nb_port); |
---|
54 | } |
---|
55 | |
---|
56 | #ifdef POSITION |
---|
57 | if (usage_is_set(_usage,USE_POSITION)) |
---|
58 | _component->generate_file(); |
---|
59 | #endif |
---|
60 | |
---|
61 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
62 | log_printf(FUNC,Counter,"allocation","End"); |
---|
63 | }; |
---|
64 | |
---|
65 | }; // end namespace counter |
---|
66 | }; // end namespace generic |
---|
67 | |
---|
68 | }; // end namespace behavioural |
---|
69 | }; // end namespace morpheo |
---|