source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_allocation.cpp @ 40

Last change on this file since 40 was 40, checked in by rosiere, 17 years ago

Interface et Signal, c'est deux classes enregistres la valeurs des signaux à chaque cycle ... étape préparatoire avan le changement de la classe Vhdl_Testbench

File size: 2.1 KB
RevLine 
[10]1#ifdef SYSTEMC
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
[15]9#include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Select_Priority_Fixed.h"
[10]10
[31]11namespace morpheo{
[10]12namespace behavioural {
13namespace generic {
14namespace select {
[15]15namespace select_priority_fixed {
[10]16
[15]17  void Select_Priority_Fixed::allocation (void)
[10]18  {
19    string rename;
20
[15]21    log_printf(FUNC,Select_Priority_Fixed,"allocation","Begin");
[10]22
[31]23#ifdef POSITION
24    _position   = new Position ();
[15]25
[31]26    Entity * entity = _position->set_entity (_name                  ,
27                                             "Select_Priority_Fixed",
28                                             COMBINATORY            );
29
30    _interfaces = entity->set_interfaces();
31#else
32    _interfaces = new Interfaces();
33#endif
34
[29]35    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36
[40]37    Interface_fifo * interface_ = _interfaces->set_interface("", IN  ,WEST, "Generalist interface");
[31]38
39     in_CLOCK        = interface_->set_signal_clk              ("clock" ,1, PORT_VHDL_YES_TESTBENCH_NO);
40     in_NRESET       = interface_->set_signal_in  <Tcontrol_t> ("nreset",1);
[10]41     in_VAL          = new SC_IN (Tcontrol_t)           * [_param._nb_entity];
42    if (_param._encoding_one_hot)
43    out_ACK          = new SC_OUT(Tcontrol_t)           * [_param._nb_entity];
44
45    for (uint32_t i=0; i<_param._nb_entity; i++)
46      {
[31]47         in_VAL [i]    = interface_->set_signal_in  <Tcontrol_t> ("val_"+toString(i),1);
[10]48        if (_param._encoding_one_hot)
[31]49        out_ACK [i]    = interface_->set_signal_out <Tcontrol_t> ("ack_"+toString(i),1);
[10]50      }
51
52    if (_param._encoding_compact)
53      {
[31]54        out_ENTITY     = interface_->set_signal_out <Tentity_t > ("entity"    , _param._size_entity);
55        out_ENTITY_ACK = interface_->set_signal_out <Tcontrol_t> ("entity_ack", 1);
[10]56      }
[29]57
[10]58    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
59
[31]60#ifdef POSITION
61    _position->generate_file();
62#endif
63
[15]64    log_printf(FUNC,Select_Priority_Fixed,"allocation","End");
[10]65  };
66
[15]67}; // end namespace select_priority_fixed
[10]68}; // end namespace select
69}; // end namespace generic
70}; // end namespace behavioural
71}; // end namespace morpheo             
72#endif
Note: See TracBrowser for help on using the repository browser.