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

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

Interface normalisé
Début du banc de registres multi niveaux

File size: 1.6 KB
RevLine 
[10]1#ifdef SYSTEMC
2#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
3/*
4 * $Id$
5 *
6 * [ Description ]
7 *
8 */
9
[15]10#include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Select_Priority_Fixed.h"
[10]11
12namespace morpheo                    {
13namespace behavioural {
14namespace generic {
15namespace select {
[15]16namespace select_priority_fixed {
[10]17
18
[15]19  void Select_Priority_Fixed::genMealy_entity (void)
[10]20  {
[15]21    log_printf(FUNC,Select_Priority_Fixed,"genMealy_entity","Begin");
[10]22
23    // init
24     
25    Tcontrol_t ack [_param._nb_entity];
26    bool       find  = false;
27    Tentity_t  entity;
28
29    if (_param._encoding_one_hot)
30    for (uint32_t i=0; i<_param._nb_entity; i++)
31      ack [i] = 0;
32
[15]33    log_printf(TRACE,Select_Priority_Fixed,"genMealy_entity","Scearch...");
[10]34    for (entity=0; entity<_param._nb_entity; entity++)
35      {
36        if (PORT_READ(in_VAL [entity]) == 1)
37          {
[15]38            log_printf(TRACE,Select_Priority_Fixed,"genMealy_entity","Find! entity %d",entity);
[10]39            if (_param._encoding_one_hot)
40              ack [entity] = 1;
41            find = true;
42            break;
43          }
44      }
45     
46    // Write port
47    if (_param._encoding_one_hot)
48      for (uint32_t i=0; i<_param._nb_entity; i++)
49        PORT_WRITE(out_ACK [i], ack [i]);
50
51    if (_param._encoding_compact)
52      {
53        PORT_WRITE(out_ENTITY    , (find==true)?entity:0); 
54        PORT_WRITE(out_ENTITY_ACK,  find                );
55      }
[15]56    log_printf(FUNC,Select_Priority_Fixed,"genMealy_entity","End");
[10]57  };
58
[15]59}; // end namespace select_priority_fixed
[10]60}; // end namespace select
61}; // end namespace generic
62
63}; // end namespace behavioural
64}; // end namespace morpheo             
65#endif
66#endif
Note: See TracBrowser for help on using the repository browser.