source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_allocation.cpp @ 112

Last change on this file since 112 was 112, checked in by rosiere, 15 years ago

1) Stat_list : fix retire old and new register bug
2) Stat_list : remove read_counter and valid flag, because validation of destination is in retire step (not in commit step)
3) Model : add class Model (cf Morpheo.sim)
4) Allocation : alloc_interface_begin and alloc_interface_end to delete temporary array.
5) Script : add distexe.sh
6) Add Comparator, Multiplier, Divider. But this component are not implemented
7) Software : add Dhrystone

  • Property svn:keywords set to Id
File size: 1.8 KB
RevLine 
[2]1/*
2 * $Id: Counter_allocation.cpp 112 2009-03-18 22:36:26Z rosiere $
3 *
[88]4 * [ Description ]
[2]5 *
6 */
7
8#include "Behavioural/Generic/Counter/include/Counter.h"
[112]9#include "Behavioural/include/Allocation.h"
[2]10
11namespace morpheo                    {
12namespace behavioural {
13namespace generic {
14namespace counter {
15
16  void Counter::allocation (void)
17  {
18    log_printf(FUNC,Counter,"allocation","Begin");
19
[82]20    _component   = new Component (_usage);
[42]21
22    Entity * entity = _component->set_entity (_name     
23                                             ,"Counter" 
24#ifdef POSITION
25                                             ,COMBINATORY
[2]26#endif
[42]27                                              );
[2]28   
[42]29    _interfaces = entity->set_interfaces();
[2]30
[88]31    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[42]32    {
33      Interface * interface = _interfaces->set_interface(""
34#ifdef POSITION
35                                                         , IN 
36                                                         , SOUTH
[112]37                                                         , _("Generalist interface")
[42]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    }
[2]44
[88]45    // ~~~~~[ Interface : "counter" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[112]46    {
47      ALLOC1_INTERFACE_BEGIN("counter", IN, SOUTH, _("Counter interface"), _param._nb_port);
[42]48           
[112]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);
[88]52
[112]53      ALLOC1_INTERFACE_END(_param._nb_port);
54    }
55   
[42]56#ifdef POSITION
[88]57     if (usage_is_set(_usage,USE_POSITION))
58       _component->generate_file();
[42]59#endif
[2]60
[88]61    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
[2]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             
Note: See TracBrowser for help on using the repository browser.