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

Last change on this file since 57 was 57, checked in by rosiere, 17 years ago
  • VHDL - RegisterFile_Multi_Banked (only partial_crossbar)
  • SystemC - modif Component, interface and co -> ajout du type Tusage_T pour instancier un coposant mais ne demander que le VHDL ou le systemC.
  • Séminaire interne
File size: 1.5 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Select_Priority_Fixed.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace generic {
14namespace select {
15namespace select_priority_fixed {
16
17
18  void Select_Priority_Fixed::genMealy_entity (void)
19  {
20    log_printf(FUNC,Select_Priority_Fixed,"genMealy_entity","Begin");
21
22    // init
23     
24    Tcontrol_t ack [_param->_nb_entity];
25    bool       find  = false;
26    Tentity_t  entity;
27
28    if (_param->_encoding_one_hot)
29    for (uint32_t i=0; i<_param->_nb_entity; i++)
30      ack [i] = 0;
31
32    log_printf(TRACE,Select_Priority_Fixed,"genMealy_entity","Scearch...");
33    for (entity=0; entity<_param->_nb_entity; entity++)
34      {
35        if (PORT_READ(in_VAL [entity]) == 1)
36          {
37            log_printf(TRACE,Select_Priority_Fixed,"genMealy_entity","Find! entity %d",entity);
38            if (_param->_encoding_one_hot)
39              ack [entity] = 1;
40            find = true;
41            break;
42          }
43      }
44     
45    // Write port
46    if (_param->_encoding_one_hot)
47      for (uint32_t i=0; i<_param->_nb_entity; i++)
48        PORT_WRITE(out_ACK [i], ack [i]);
49
50    if (_param->_encoding_compact)
51      {
52        PORT_WRITE(out_ENTITY    , (find==true)?entity:0); 
53        PORT_WRITE(out_ENTITY_ACK,  find                );
54      }
55    log_printf(FUNC,Select_Priority_Fixed,"genMealy_entity","End");
56  };
57
58}; // end namespace select_priority_fixed
59}; // end namespace select
60}; // end namespace generic
61
62}; // end namespace behavioural
63}; // end namespace morpheo             
64#endif
Note: See TracBrowser for help on using the repository browser.