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

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

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

File size: 1.6 KB
Line 
1#ifdef SYSTEMC
2#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
3/*
4 * $Id$
5 *
6 * [ Description ]
7 *
8 */
9
10#include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Select_Priority_Fixed.h"
11
12namespace morpheo                    {
13namespace behavioural {
14namespace generic {
15namespace select {
16namespace select_priority_fixed {
17
18
19  void Select_Priority_Fixed::genMealy_entity (void)
20  {
21    log_printf(FUNC,Select_Priority_Fixed,"genMealy_entity","Begin");
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
33    log_printf(TRACE,Select_Priority_Fixed,"genMealy_entity","Scearch...");
34    for (entity=0; entity<_param._nb_entity; entity++)
35      {
36        if (PORT_READ(in_VAL [entity]) == 1)
37          {
38            log_printf(TRACE,Select_Priority_Fixed,"genMealy_entity","Find! entity %d",entity);
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      }
56    log_printf(FUNC,Select_Priority_Fixed,"genMealy_entity","End");
57  };
58
59}; // end namespace select_priority_fixed
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.