Changeset 62


Ignore:
Timestamp:
Dec 4, 2007, 2:31:54 PM (16 years ago)
Author:
rosiere
Message:

Modification en profondeur de Component-port_map.
Compilation ok pour Register_unit ... a tester (systemC et vhdl)

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural
Files:
11 added
3 deleted
65 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/src/test.cpp

    r59 r62  
    1010#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/include/test.h"
    1111#include "Common/include/Test.h"
     12#include "Common/include/BitManipulation.h"
    1213
    1314#define NB_ITERATION  1
     
    4344
    4445
     46//========================================================={MemoryRequest_t}
    4547class MemoryRequest_t
    4648{
     
    146148  return os << "<" << toString(x._cycle) << "> : "
    147149            << "{" << toString(static_cast<uint32_t>(x._packet_id)) << "}" << endl
    148             << "\t * " << toString(static_cast<uint32_t>(x._context_id)) << endl
    149             << "\t * " << toString(static_cast<uint32_t>(x._operation)) << " " << toString(static_cast<uint32_t>(x._type)) << " " << toString(static_cast<uint32_t>(x._write_spec_ko)) << endl
    150             << "\t * " << toString(static_cast<uint32_t>(x._store_queue_ptr_write)) << " " << toString(static_cast<uint32_t>(x._load_queue_ptr_write)) << endl
    151             << "\t * " << toString(static_cast<uint32_t>(x._immediat)) << " - " << toString(static_cast<uint32_t>(x._data_ra)) << " - " << toString(static_cast<uint32_t>(x._data_rb)) << endl
    152             << "\t * " << toString(static_cast<uint32_t>(x._write_rd)) << " " << toString(static_cast<uint32_t>(x._num_reg_rd)) << endl;
     150            << "\t * context_id                        : " << toString(static_cast<uint32_t>(x._context_id)) << endl
     151            << "\t * operation  / type / write_spec_ko : " << toString(static_cast<uint32_t>(x._operation)) << " " << toString(static_cast<uint32_t>(x._type)) << " " << toString(static_cast<uint32_t>(x._write_spec_ko)) << endl
     152            << "\t * ptr_write store/load              : " << toString(static_cast<uint32_t>(x._store_queue_ptr_write)) << " " << toString(static_cast<uint32_t>(x._load_queue_ptr_write)) << endl
     153            << "\t * immediat / data_ra / data_rb      : " << toString(static_cast<uint32_t>(x._immediat)) << " - " << toString(static_cast<uint32_t>(x._data_ra)) << " - " << toString(static_cast<uint32_t>(x._data_rb)) << endl
     154            << "\t * write_rd / num_reg_rd             : " << toString(static_cast<uint32_t>(x._write_rd)) << " " << toString(static_cast<uint32_t>(x._num_reg_rd)) << endl;
    153155}
    154156
     157//================================================================{Memory_t}
     158class Memory_t
     159{
     160private : const uint32_t    _nb_context;
     161private : const uint32_t    _nb_word   ;
     162private : const uint32_t    _size_data ;
     163private : const Tdcache_address_t _mask_addr ;
     164private : Tdcache_data_t ** _data;
     165 
     166public  : Memory_t (uint32_t nb_context,
     167                    uint32_t nb_word,
     168                    uint32_t size_data):
     169  _nb_context   (nb_context),
     170  _nb_word      (nb_word   ),
     171  _size_data    (size_data ),
     172  _mask_addr    (gen_mask<Tdcache_address_t>(static_cast<uint32_t>(log2(ceil(static_cast<double>(size_data))))))
     173  {
     174    _data = new Tdcache_data_t * [nb_context];
     175   
     176    for (uint32_t i=0; i<nb_context; i++)
     177      {
     178        _data [i] = new Tdcache_data_t [nb_word];
     179       
     180        for (uint32_t j=0; j<nb_word; j++)
     181          _data [i][j] = rand()%(size_data);
     182      }
     183  }
     184
     185public  : ~Memory_t (void)
     186  {
     187    delete [] _data;
     188  }
     189
     190public  : Tdcache_data_t access (uint32_t          context,
     191                                 Tdcache_address_t address,
     192                                 Tdcache_type_t    type,
     193                                 Tdcache_data_t    data)
     194  {
     195    return 0;
     196  }
     197
     198public  : Tdcache_data_t read (uint32_t          context,
     199                               Tdcache_address_t address,
     200                               Tdcache_type_t    type)
     201  {
     202    // Address's Read must be aligned
     203
     204    if ((address & _mask_addr) != 0)
     205      TEST_KO("<Memory_t::read> Address is not aligned");
     206
     207    if (context>_nb_context)
     208      TEST_KO("<Memory_t::read> nb context is too high");
     209
     210    if (address>_nb_word)
     211      TEST_KO("<Memory_t::read> address is too high");
     212   
     213    return _data [context][address];
     214  }
     215
     216public  : void write (uint32_t          context,
     217                      Tdcache_address_t address,
     218                      Tdcache_type_t    type,
     219                      Tdcache_data_t    data)
     220  {
     221    if (context>_nb_context)
     222      TEST_KO("<Memory_t::read> nb context is too high");
     223
     224    if (address>_nb_word)
     225      TEST_KO("<Memory_t::read> address is too high");
     226
     227    Tdcache_address_t LSB = address &  _mask;
     228    Tdcache_address_t MSB = address & ~_mask;
     229 
     230    Tdcache_data_t write_data = data;
     231    Tdcache_data_t read_data  = _data [context][MSB];
     232
     233    // exemple to size_data = 32b
     234    // LSB index_min
     235    // 0   0
     236    // 1   8
     237    // 2   16
     238    // 3   24
     239    uint32_t index_min = LSB<<3;
     240    uint32_t index_max = index_min;
     241    // index max, dependant of access's size
     242
     243    switch (type)
     244      {
     245
     246
     247      }
     248  }
     249};
     250
     251//===================================================================={test}
    155252void test (string name,
    156253           morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Parameters * _param)
     
    252349  (*(_Load_store_unit-> in_MEMORY_IN_PACKET_ID            ))(*( in_MEMORY_IN_PACKET_ID            ));
    253350  (*(_Load_store_unit-> in_MEMORY_IN_OPERATION            ))(*( in_MEMORY_IN_OPERATION            ));
    254   (*(_Load_store_unit-> in_MEMORY_IN_TYPE                 ))(*( in_MEMORY_IN_TYPE                 ));
    255351  (*(_Load_store_unit-> in_MEMORY_IN_STORE_QUEUE_PTR_WRITE))(*( in_MEMORY_IN_STORE_QUEUE_PTR_WRITE));
    256352  (*(_Load_store_unit-> in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE ))(*( in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE ));
     
    269365  (*(_Load_store_unit->out_MEMORY_OUT_CONTEXT_ID ))(*(out_MEMORY_OUT_CONTEXT_ID ));
    270366  (*(_Load_store_unit->out_MEMORY_OUT_PACKET_ID  ))(*(out_MEMORY_OUT_PACKET_ID  ));
    271   (*(_Load_store_unit->out_MEMORY_OUT_OPERATION  ))(*(out_MEMORY_OUT_OPERATION  ));
    272   (*(_Load_store_unit->out_MEMORY_OUT_TYPE       ))(*(out_MEMORY_OUT_TYPE       ));
    273367  (*(_Load_store_unit->out_MEMORY_OUT_WRITE_RD   ))(*(out_MEMORY_OUT_WRITE_RD   ));
    274368  (*(_Load_store_unit->out_MEMORY_OUT_NUM_REG_RD ))(*(out_MEMORY_OUT_NUM_REG_RD ));
     
    322416  const uint32_t     nb_word      = nb_request;
    323417
    324   const uint32_t     cst_max_cycle                  =   2;
    325 
    326   const int32_t      percent_transaction_memory_in  = 100;
     418//const int32_t      percent_transaction_memory_in  = 100;
    327419  const int32_t      percent_transaction_memory_out = 100;
    328420  const int32_t      percent_transaction_dcache     = 100;
     
    331423  const int32_t      percent_type_load              =   0;
    332424  const int32_t      percent_type_store             = 100;
    333   const int32_t      percent_miss_spec              = 100;
     425  const int32_t      percent_miss_spec              =   0;
    334426
    335427  if ((percent_type_load  +
     
    337429    TEST_KO("sum of percent_type > 100");
    338430
    339   const int32_t      seuil_type_load    = seuil_type_load;
    340   const int32_t      seuil_type_store   = seuil_type_store+percent_type_load;
     431  const int32_t      seuil_type_load    = percent_type_load;
     432  const int32_t      seuil_type_store   = percent_type_store+percent_type_load;
    341433
    342434  uint32_t           nb_request_memory_in ;
     
    347439  priority_queue<MemoryRequest_t> fifo_request;
    348440
     441  // emulation of cache
    349442  Tdcache_data_t     cache_data                [_param->_nb_context][nb_word];
    350443
     
    371464  for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
    372465    {
     466      LABEL("Iteration "+toString(iteration));
     467
     468      LABEL("Structure's initialisation");
     469
    373470      nb_request_memory_in  = 0;
    374471      nb_request_memory_out = 0;
    375472      nb_request_dcache     = 0;
    376473     
    377       LABEL("Iteration "+toString(iteration));
    378 
    379474      // Fill the request_queue
    380475     
     
    390485        load_queue_use  [i] = false;
    391486
    392       double             store_queue_cycle [_param->_size_store_queue];
    393       double             load_queue_cycle  [_param->_size_load_queue ];
    394487      double             current_cycle = sc_simulation_time();
    395 
    396       for (uint32_t i=0; i<_param->_size_store_queue; i++)
    397         store_queue_cycle [i] = current_cycle;
    398       for (uint32_t i=0; i<_param->_size_load_queue ; i++)
    399         load_queue_cycle  [i] = current_cycle;
    400 
     488      double             cycle_min     = current_cycle;
     489
     490      LABEL("Fifo request initialisation");
    401491      // Init fifo_request
    402492      for (uint32_t i=0; i<nb_request; i++)
    403493        {
    404           double             cycle                     = current_cycle+(rand()%(cst_max_cycle*nb_request));
     494          double             cycle;
    405495          Tcontext_t         context_id                = rand () % _param->_nb_context;
    406496          Tpacket_t          packet_id                 = i;
     
    411501          int32_t            percent = rand()%100;
    412502
    413           if (percent < seuil_type_load)
     503          uint32_t           size_queue;
     504         
     505          if (percent <= seuil_type_load)
    414506            {
    415               operation = OPERATION_MEMORY_LOAD_16_S;
    416               load_queue_ptr_write = (load_queue_ptr_write+1) % (_param->_size_load_queue);
    417             }
    418           else
    419             if (percent < seuil_type_store)
    420               {
    421                 operation = OPERATION_MEMORY_STORE_16;
    422                 store_queue_ptr_write = (store_queue_ptr_write+1) % (_param->_size_store_queue);
    423               }
    424             else
    425               {
    426                 operation = OPERATION_MEMORY_PREFETCH;
    427                 load_queue_ptr_write = (load_queue_ptr_write+1) % (_param->_size_load_queue);
    428               }
    429 
    430           // Valid nb cycle ?
    431           if (is_operation_memory_store(operation))
    432             {
    433               if (cycle <= store_queue_cycle[packet_id])
    434                 cycle = store_queue_cycle[packet_id]+1;
     507//            LABEL(" * LOAD");
     508              operation            = OPERATION_MEMORY_LOAD_16_S;
     509              size_queue           = _param->_size_load_queue;
     510              load_queue_ptr_write = (load_queue_ptr_write+1) % (size_queue);
    435511            }
    436512          else
    437513            {
    438               if (cycle <= load_queue_cycle[packet_id])
    439                 cycle = load_queue_cycle[packet_id]+1;
     514              if (percent <= seuil_type_store)
     515                {
     516//                LABEL(" * STORE");
     517                  operation             = OPERATION_MEMORY_STORE_16;
     518                  size_queue            = _param->_size_store_queue;
     519                  store_queue_ptr_write = (store_queue_ptr_write+1) % (size_queue);
     520                }
     521              else
     522                {
     523//                LABEL(" * OTHERS");
     524                  operation            = OPERATION_MEMORY_PREFETCH;
     525                  size_queue           = _param->_size_load_queue;
     526                  load_queue_ptr_write = (load_queue_ptr_write+1) % (size_queue);
     527                }
    440528            }
    441529
     530          cycle      = cycle_min;
     531          cycle_min ++;
     532
    442533          Ttype_t            type                  = TYPE_MEMORY;
    443 
    444           Tgeneral_data_t    address               = rand()%(1<<_param->_size_general_data);
    445           Tgeneral_data_t    offset                = rand()%(1<<_param->_size_general_data);
     534          Tgeneral_data_t    address               = rand()%(nb_word);
     535          Tgeneral_data_t    offset                = rand()%(nb_word);
    446536
    447537          percent = rand()%100;
     
    474564                                );
    475565
     566          cout << tab_request [i] << endl;
     567       
    476568          fifo_request.push(tab_request [i]);
    477          
     569
     570          double cycle_head = 0;
     571
    478572          if (is_operation_memory_store(operation))
    479573            {
    480               cycle = cycle+((rand()%(10))-4);
    481 
    482               if (cycle <= store_queue_cycle[packet_id])
    483                 cycle = store_queue_cycle[packet_id]+1;
    484                        
    485               fifo_request.push(MemoryRequest_t(cycle,
     574              cycle_head = cycle_min;
     575              cycle_min ++;
     576
     577              cout << "         * Write head : " << toString(cycle_head)
     578                   << endl
     579                   << endl;
     580             
     581              fifo_request.push(MemoryRequest_t(cycle_head,
    486582                                                context_id,
    487583                                                packet_id,
     
    497593                                                write_spec_ko));
    498594            }
    499 
    500           // update nb cycle ?
    501           if (is_operation_memory_store(operation))
    502             {
    503               store_queue_cycle[packet_id] = cycle;
    504             }
    505           else
    506             {
    507               load_queue_cycle [packet_id] = cycle;
    508             }
    509         }
    510            
     595        }
     596       
     597      LABEL("Simulation of this iteration ...");
     598   
    511599      while (nb_request_memory_out < nb_request)
    512600        {
     601          // ***** MEMORY_IN *****
     602
     603          // memory_in_val depends of three factors :
     604          //  1) request's fifo is not empty ?
     605          //  2) the slot destination is free ?
     606          //  3) The head of request's fifo can be issue : the number of cycle is more than current cycle
     607
    513608          bool can_execute = false;
    514609
     
    535630
    536631          in_MEMORY_OUT_ACK->write((rand()%100)<percent_transaction_memory_out);
    537          
     632
     633          // ***** DCACHE_REQ *****
     634          in_DCACHE_REQ_ACK->write((rand()%100)<percent_transaction_dcache);
     635
    538636          SC_START(0);
    539637 
     
    541639
    542640          LABEL("MEMORY_IN  : "+toString(in_MEMORY_IN_VAL ->read())+" - "+toString(out_MEMORY_IN_ACK ->read()));
     641          LABEL("  * fifo_request.empty                     : "+toString(fifo_request.empty()));
     642          LABEL("  * fifo_request.top.cycle                 : "+toString(fifo_request.top()._cycle));
     643          LABEL("  * fifo_request.top.store_queue_ptr_write : "+toString(static_cast<uint32_t>(fifo_request.top()._store_queue_ptr_write)));
     644          LABEL("  * fifo_request.top.load_queue_ptr_write  : "+toString(static_cast<uint32_t>(fifo_request.top()._load_queue_ptr_write)));
     645          LABEL("  * fifo_request.top.operation             : "+toString(static_cast<uint32_t>(fifo_request.top()._operation           )));
     646          LABEL("  * can_execute                            : "+toString(can_execute));
     647
    543648          if ( in_MEMORY_IN_VAL ->read() and out_MEMORY_IN_ACK ->read())
    544649            {
     
    562667          if (out_MEMORY_OUT_VAL->read() and  in_MEMORY_OUT_ACK->read())
    563668            {
    564               LABEL(" * Accepted MEMORY_OUT : " + toString(out_MEMORY_OUT_PACKET_ID->read()));
     669              LABEL(" * Accepted MEMORY_OUT : " + toString(static_cast<uint32_t>(out_MEMORY_OUT_PACKET_ID->read())));
    565670
    566671              if (is_operation_memory_store(tab_request[out_MEMORY_OUT_PACKET_ID->read()]._operation))
     
    571676              nb_request_memory_out ++;
    572677            }
     678
     679          LABEL("DCACHE_REQ : "+toString(out_DCACHE_REQ_VAL->read())+" - "+toString(in_DCACHE_REQ_ACK ->read()));
     680          if (out_DCACHE_REQ_VAL->read() and  in_DCACHE_REQ_ACK->read())
     681            {
     682              LABEL(" * Accepted DCACHE_REQ : " + toString(static_cast<uint32_t>(out_DCACHE_REQ_PACKET_ID->read())));
     683
     684              // test type : send or not a respons !
     685            }
     686
    573687        }
    574688    }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Load_store_unit.h

    r59 r62  
    77 * [ Description ]
    88 *
     9 * Ce composant peut être amélioré en placant deux ptr de lecture au lieu d'un : un pour l'accès au cache et un pour le commit
    910 */
    1011
     
    1213#include "systemc.h"
    1314#endif
    14 
    15 #define HAVE_MEMORY_OUT_OPERATION
    16 #define HAVE_MEMORY_OUT_TYPE
    1715
    1816#include <iostream>
     
    7977  public    : SC_IN (Tpacket_t         )    *  in_MEMORY_IN_PACKET_ID   ;
    8078  public    : SC_IN (Toperation_t      )    *  in_MEMORY_IN_OPERATION   ;
    81 #ifdef HAVE_MEMORY_OUT_TYPE
    82   public    : SC_IN (Ttype_t           )    *  in_MEMORY_IN_TYPE        ;
    83 #endif
    8479  public    : SC_IN (Tlsq_ptr_t        )    *  in_MEMORY_IN_STORE_QUEUE_PTR_WRITE;
    8580  public    : SC_IN (Tlsq_ptr_t        )    *  in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE;
     
    9994  public    : SC_OUT(Tcontext_t        )    * out_MEMORY_OUT_CONTEXT_ID;
    10095  public    : SC_OUT(Tpacket_t         )    * out_MEMORY_OUT_PACKET_ID ;
    101 #ifdef HAVE_MEMORY_OUT_OPERATION
    102   public    : SC_OUT(Toperation_t      )    * out_MEMORY_OUT_OPERATION ;
    103 #endif
    104 #ifdef HAVE_MEMORY_OUT_TYPE
    105   public    : SC_OUT(Ttype_t           )    * out_MEMORY_OUT_TYPE      ;
    106 #endif
    10796  public    : SC_OUT(Tcontrol_t        )    * out_MEMORY_OUT_WRITE_RD  ; // = (operation==load)
    10897  public    : SC_OUT(Tgeneral_address_t)    * out_MEMORY_OUT_NUM_REG_RD; // destination (load)
     
    154143    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    155144
     145    // Registers
    156146  public    : Tlsq_ptr_t                      internal_MEMORY_STORE_QUEUE_PTR_READ;
    157   public    : Tlsq_ptr_t                      internal_MEMORY_LOAD_QUEUE_PTR_READ;
    158 
     147  public    : Tlsq_ptr_t                      internal_MEMORY_LOAD_QUEUE_PTR_READ ;
     148
     149    // signal
    159150  private   : Tcontrol_t                      internal_MEMORY_IN_ACK;
    160151  private   : Tcontrol_t                      internal_MEMORY_OUT_VAL;
    161152  private   : Tselect_queue_t                 internal_MEMORY_OUT_SELECT_QUEUE;
     153
     154  private   : Tcontrol_t                      internal_DCACHE_REQ_VAL;
     155  private   : Tselect_queue_t                 internal_DCACHE_REQ_SELECT_QUEUE;
    162156#endif
    163157
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Parameters.h

    r59 r62  
    2626  {
    2727    //-----[ fields ]------------------------------------------------------------
    28   public : const uint32_t            _size_store_queue       ;
    29   public : const uint32_t            _size_load_queue        ;
     28  public : const uint32_t            _size_store_queue             ;
     29  public : const uint32_t            _size_load_queue              ;
    3030  public : const uint32_t            _size_speculative_access_queue;
    31   public : const uint32_t            _nb_port_check          ;
    32   public : const Tspeculative_load_t _speculative_load       ;
    33   public : const uint32_t            _nb_context             ;
    34   public : const uint32_t            _nb_packet              ;
    35   public : const uint32_t            _size_general_data      ;
    36   public : const uint32_t            _nb_general_register    ;
    37   public : const uint32_t            _nb_operation           ;
    38   public : const uint32_t            _nb_type                ;
     31  public : const uint32_t            _nb_port_check                ;
     32  public : const Tspeculative_load_t _speculative_load             ;
     33//public : const uint32_t            _nb_cache_port                ;
     34  public : const uint32_t            _nb_context                   ;
     35  public : const uint32_t            _nb_packet                    ;
     36  public : const uint32_t            _size_general_data            ;
     37  public : const uint32_t            _nb_general_register          ;
     38  public : const uint32_t            _nb_operation                 ;
     39  public : const uint32_t            _nb_type                      ;
    3940
    4041  public : const uint32_t            _size_address_store_queue             ;
    4142  public : const uint32_t            _size_address_load_queue              ;
    4243  public : const uint32_t            _size_address_speculative_access_queue;
    43   public : const uint32_t            _size_context_id        ;
    44   public : const uint32_t            _size_packet_id         ;
    45   public : const uint32_t            _size_general_register  ;
    46   public : const uint32_t            _size_operation         ;
    47   public : const uint32_t            _size_type              ;
     44  public : const uint32_t            _size_context_id                      ;
     45  public : const uint32_t            _size_packet_id                       ;
     46  public : const uint32_t            _size_general_register                ;
     47  public : const uint32_t            _size_operation                       ;
     48  public : const uint32_t            _size_type                            ;
    4849
    4950    //-----[ methods ]-----------------------------------------------------------
     
    6061                        uint32_t            nb_type               
    6162                        );
     63
    6264  public : Parameters  (Parameters & param) ;
    6365  public : ~Parameters () ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Types.h

    r59 r62  
    5656  public    : Tcontext_t           _context_id          ;
    5757  public    : Tpacket_t            _packet_id           ;
    58   public    : Taccess_t            _access              ;
     58  public    : Tdcache_type_t       _dcache_type         ;
    5959  public    : Tcontrol_t           _uncached            ;
    60 #ifdef HAVE_MEMORY_OUT_OPERATION
    61   public    : Toperation_t         _operation           ;
    62 #endif                             
    63 #ifdef HAVE_MEMORY_OUT_TYPE                           
    64   public    : Ttype_t              _type                ;
    65 #endif                             
    6660  public    : Tlsq_ptr_t           _load_queue_ptr_write;
    6761  public    : Tdcache_data_t       _address             ;
     
    7064//public    : Tgeneral_address_t   _num_reg_rd          ;
    7165  public    : Texception_t         _exception           ;
     66
     67    friend ostream & operator << (ostream& os, const Tstore_queue_entry_t & x)
     68    {
     69      return os << " * state                   : " << x._state << endl
     70                << "   * packet   - context_id : " << toString(static_cast<uint32_t>(x._packet_id           )) << " - " << toString(static_cast<uint32_t>(x._context_id)) << endl
     71                << "   * type     - uncached   : " << toString(static_cast<uint32_t>(x._dcache_type         )) << " - " << toString(static_cast<uint32_t>(x._uncached  )) << endl
     72                << "   * load_ptr - execption  : " << toString(static_cast<uint32_t>(x._load_queue_ptr_write)) << " - " << toString(static_cast<uint32_t>(x._exception )) << endl
     73                << "   * address  - wdata      : " << toString(static_cast<uint32_t>(x._address             )) << " - " << toString(static_cast<uint32_t>(x._wdata     )) << endl;
     74    }
    7275  };
     76 
     77 
    7378
    7479  // ----------------------------------------------------------
     
    9196  public    : Tcontrol_t                         _uncached             ;
    9297  public    : Tcontrol_t                         _sign_extension       ;
    93 #ifdef HAVE_MEMORY_OUT_OPERATION                                       
    94   public    : Toperation_t                       _operation            ;
    95 #endif                                                                 
    96 #ifdef HAVE_MEMORY_OUT_TYPE                                           
    97   public    : Ttype_t                            _type                 ;
    98 #endif                                                                 
    9998  public    : Tlsq_ptr_t                         _load_queue_ptr_write ;
    10099  public    : Tlsq_ptr_t                         _store_queue_ptr_write;
     
    128127  public    : Tcontrol_t           _uncached            ;
    129128  public    : Tcontrol_t           _sign_extension      ;
    130 #ifdef HAVE_MEMORY_OUT_OPERATION
    131   public    : Toperation_t         _operation           ;
    132 #endif                             
    133 #ifdef HAVE_MEMORY_OUT_TYPE                           
    134   public    : Ttype_t              _type                ;
    135 #endif                             
    136129  public    : Tlsq_ptr_t           _store_queue_ptr_write;
    137130  public    : Tdcache_address_t    _address             ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_allocation.cpp

    r59 r62  
    6767   in_MEMORY_IN_PACKET_ID             = interface->set_signal_in  <Tpacket_t         > ("packet_id"   ,_param->_size_packet_id       );
    6868   in_MEMORY_IN_OPERATION             = interface->set_signal_in  <Toperation_t      > ("operation"   ,_param->_size_operation        );
    69 #ifdef HAVE_MEMORY_OUT_TYPE
    70    in_MEMORY_IN_TYPE                  = interface->set_signal_in  <Ttype_t           > ("type"        ,_param->_size_type             );
    71 #endif
    7269   in_MEMORY_IN_STORE_QUEUE_PTR_WRITE = interface->set_signal_in  <Tlsq_ptr_t        > ("store_queue_ptr_write" ,_param->_size_address_store_queue);
    7370   in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE  = interface->set_signal_in  <Tlsq_ptr_t        > ("load_queue_ptr_write"  ,_param->_size_address_load_queue );
     
    9794      out_MEMORY_OUT_CONTEXT_ID  = interface->set_signal_out <Tcontext_t        > ("context_id"  ,_param->_size_context_id       );
    9895      out_MEMORY_OUT_PACKET_ID   = interface->set_signal_out <Tpacket_t         > ("packet_id"   ,_param->_size_packet_id        );
    99 #ifdef HAVE_MEMORY_OUT_OPERATION
    100       out_MEMORY_OUT_OPERATION   = interface->set_signal_out <Toperation_t      > ("operation"   ,_param->_size_operation        );
    101 #endif
    102 #ifdef HAVE_MEMORY_OUT_TYPE
    103       out_MEMORY_OUT_TYPE        = interface->set_signal_out <Ttype_t           > ("type"        ,_param->_size_type             );
    104 #endif
    10596      out_MEMORY_OUT_WRITE_RD    = interface->set_signal_out <Tcontrol_t        > ("write_rd"    ,1                              );
    10697      out_MEMORY_OUT_NUM_REG_RD  = interface->set_signal_out <Tgeneral_address_t> ("num_reg_rd"  ,_param->_size_general_register );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_deallocation.cpp

    r59 r62  
    3838    delete     in_MEMORY_IN_PACKET_ID   ;
    3939    delete     in_MEMORY_IN_OPERATION   ;
    40 #ifdef HAVE_MEMORY_OUT_TYPE
    41     delete     in_MEMORY_IN_TYPE        ;
    42 #endif
    4340    delete     in_MEMORY_IN_STORE_QUEUE_PTR_WRITE;
    4441    delete     in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE ;
     
    5754    delete    out_MEMORY_OUT_CONTEXT_ID;
    5855    delete    out_MEMORY_OUT_PACKET_ID ;
    59 #ifdef HAVE_MEMORY_OUT_OPERATION
    60     delete    out_MEMORY_OUT_OPERATION ;
    61 #endif
    62 #ifdef HAVE_MEMORY_OUT_TYPE
    63     delete    out_MEMORY_OUT_TYPE      ;
    64 #endif
    6556    delete    out_MEMORY_OUT_WRITE_RD  ;
    6657    delete    out_MEMORY_OUT_NUM_REG_RD;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_function_speculative_load_commit_genMoore.cpp

    r59 r62  
    2828    // ~~~~~[ Interface "memory_out" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    2929
    30     // Test store and load queue
    3130    Tcontext_t         memory_out_context_id = 0;
    3231    Tpacket_t          memory_out_packet_id  = 0;
    33 #ifdef HAVE_MEMORY_OUT_OPERATION
    34     Toperation_t       memory_out_operation  = 0;
    35 #endif
    36 #ifdef HAVE_MEMORY_OUT_TYPE
    37     Ttype_t            memory_out_type       = 0;
    38 #endif
    3932    Tcontrol_t         memory_out_write_rd   = 0;
    4033    Tgeneral_address_t memory_out_num_reg_rd = 0;
     
    4740    internal_MEMORY_OUT_VAL          = 0;
    4841
    49     // TODO : now only store queue
     42    // Test store and load queue
     43    // TODO : il faut d'abord tester si un elment de l'access queue n'est pas commitable !!!!!!!
    5044
    5145    // Test an store must be commited.
    52 
    53    
    5446    if (_store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._state == STORE_QUEUE_COMMIT)
    5547      {
     
    5951        memory_out_context_id= _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._context_id;
    6052        memory_out_packet_id = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._packet_id ;
    61 #ifdef HAVE_MEMORY_OUT_OPERATION
    62         memory_out_operation = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._operation;
    63 #endif
    64 #ifdef HAVE_MEMORY_OUT_TYPE
    65         memory_out_type      = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._type;
    66 #endif
    6753//      memory_out_write_rd 
    6854//      memory_out_num_reg_rd
     
    7157      }
    7258
     59    // write output
    7360    PORT_WRITE(out_MEMORY_OUT_VAL       , internal_MEMORY_OUT_VAL);
    7461
    7562    PORT_WRITE(out_MEMORY_OUT_CONTEXT_ID, memory_out_context_id);
    7663    PORT_WRITE(out_MEMORY_OUT_PACKET_ID , memory_out_packet_id );
    77 #ifdef HAVE_MEMORY_OUT_OPERATION
    78     PORT_WRITE(out_MEMORY_OUT_OPERATION , memory_out_operation );
    79 #endif
    80 #ifdef HAVE_MEMORY_OUT_TYPE
    81     PORT_WRITE(out_MEMORY_OUT_TYPE      , memory_out_type      );
    82 #endif
    8364    PORT_WRITE(out_MEMORY_OUT_WRITE_RD  , memory_out_write_rd  );
    8465    PORT_WRITE(out_MEMORY_OUT_NUM_REG_RD, memory_out_num_reg_rd);
     
    8970    PORT_WRITE(out_MEMORY_OUT_EXCEPTION , memory_out_exception );
    9071
     72    // ~~~~~[ Interface "dache_req" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    9173
     74    Tcontext_t        dcache_req_context_id;
     75    Tpacket_t         dcache_req_packet_id ;
     76    Tdcache_address_t dcache_req_address   ;
     77    Tdcache_type_t    dcache_req_type      ;
     78    Tcontrol_t        dcache_req_uncached  ;
     79    Tdcache_data_t    dcache_req_wdata     ;
     80
     81    internal_DCACHE_REQ_VAL          = 0;
     82
     83    // Test store and load queue
     84
     85    // TODO : il faut d'abord tester si un elment de l'access queue n'est pas commitable !!!!!!!
     86
     87    // Test an store must be commited.
     88    if (_store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._state == STORE_QUEUE_VALID_NO_SPECULATIVE)
     89      {
     90        internal_DCACHE_REQ_VAL          = 1;
     91        internal_DCACHE_REQ_SELECT_QUEUE = SELECT_STORE_QUEUE;
     92
     93        dcache_req_context_id = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._context_id;
     94        dcache_req_packet_id  = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._packet_id ;
     95        dcache_req_address    = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._address   ;
     96        dcache_req_type       = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._dcache_type;
     97        dcache_req_uncached   = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._uncached  ;
     98        dcache_req_wdata      = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._wdata     ;
     99      }
     100
     101    PORT_WRITE(out_DCACHE_REQ_VAL       , internal_DCACHE_REQ_VAL);
     102    PORT_WRITE(out_DCACHE_REQ_CONTEXT_ID, dcache_req_context_id);
     103    PORT_WRITE(out_DCACHE_REQ_PACKET_ID , dcache_req_packet_id );
     104    PORT_WRITE(out_DCACHE_REQ_ADDRESS   , dcache_req_address   );
     105    PORT_WRITE(out_DCACHE_REQ_TYPE      , dcache_req_type      );
     106    PORT_WRITE(out_DCACHE_REQ_UNCACHED  , dcache_req_uncached  );
     107    PORT_WRITE(out_DCACHE_REQ_WDATA     , dcache_req_wdata     );
     108   
    92109    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
    93110  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_function_speculative_load_commit_transition.cpp

    r59 r62  
    5757            //  others in speculation_access_queue
    5858
    59             Toperation_t    operation           = PORT_READ(in_MEMORY_IN_OPERATION);
    60             Tgeneral_data_t address             = (PORT_READ(in_MEMORY_IN_IMMEDIAT) +
    61                                                    PORT_READ(in_MEMORY_IN_DATA_RA ));
    62            
    63             bool            exception_alignement= (mask_memory_access(operation) & address) != 0;
     59            Toperation_t    operation            = PORT_READ(in_MEMORY_IN_OPERATION);
     60            Tgeneral_data_t address              = (PORT_READ(in_MEMORY_IN_IMMEDIAT) +
     61                                                    PORT_READ(in_MEMORY_IN_DATA_RA ));
     62            bool            exception_alignement = (mask_memory_access(operation) & address) != 0;
    6463                                                   
    6564            if (is_operation_memory_store(operation) == true)
     
    159158                    _store_queue [index]._context_id           = PORT_READ(in_MEMORY_IN_CONTEXT_ID  );
    160159                    _store_queue [index]._packet_id            = PORT_READ(in_MEMORY_IN_PACKET_ID   );
    161 #ifdef HAVE_MEMORY_OUT_OPERATION
    162                     _store_queue [index]._operation            = operation;
    163 #endif
    164 #ifdef HAVE_MEMORY_OUT_TYPE
    165                     _store_queue [index]._type                 = PORT_READ(in_MEMORY_IN_TYPE        );
    166 #endif
     160                    _store_queue [index]._dcache_type          = operation_to_dcache_type(operation);
     161                    _store_queue [index]._uncached             = 0; // is the MMU that have this info
    167162                    _store_queue [index]._load_queue_ptr_write = PORT_READ(in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE);
    168163                    _store_queue [index]._address              = address;
     
    217212              }
    218213          }
     214
     215        //================================================================
     216        // Interface "DCACHE_REQ"
     217        //================================================================
     218        if ((    internal_DCACHE_REQ_VAL  == 1) and
     219            (PORT_READ(in_DCACHE_REQ_ACK) == 1))
     220          {
     221            switch (internal_DCACHE_REQ_SELECT_QUEUE)
     222              {
     223              case SELECT_STORE_QUEUE :
     224                {
     225                  // =======================
     226                  // ===== STORE_QUEUE =====
     227                  // =======================
     228                 
     229                  // Entry flush and increase the read pointer
     230                 
     231                  _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._state = STORE_QUEUE_COMMIT;
     232
     233                  break;
     234                }
     235              case SELECT_LOAD_QUEUE :
     236              case SELECT_LOAD_QUEUE_SPECULATIVE :
     237                break;
     238              }
     239          }
     240
     241#if DEBUG>=DEBUG_TRACE
     242        // ***** dump store queue
     243        cout << "Dump store queue" << endl
     244             << "ptr_read : " << toString(static_cast<uint32_t>(internal_MEMORY_STORE_QUEUE_PTR_READ)) << endl;
     245       
     246        for (uint32_t i=0; i<_param->_size_store_queue; i++)
     247          {
     248            uint32_t j = (internal_MEMORY_STORE_QUEUE_PTR_READ+i)%_param->_size_store_queue;
     249            cout << "{" << j << "}" << endl
     250                 << _store_queue[j] << endl;
     251          }
     252#endif
    219253      }
    220254
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/SelfTest/src/test.cpp

    r60 r62  
    112112  sc_signal<Tspecial_address_t>  ***  in_RETIRE_ROB_RE_NEW_NUM_REG    ;
    113113
    114   string rename;
     114  string rename = "signal";
    115115
    116116  in_CLOCK                                = new sc_clock ("clock", 1.0, 0.5);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/src/Register_unit_allocation.cpp

    r60 r62  
    370370#endif
    371371       
    372         _component->port_map(name_component,"in_CLOCK" , _name, "in_CLOCK");
    373         _component->port_map(name_component,"in_NRESET", _name, "in_NRESET");
     372        _component->port_map(name_component,"in_CLOCK"   , _name, "in_CLOCK");
     373        _component->port_map(name_component,"in_NRESET"  , _name, "in_NRESET");
    374374
    375375        for (uint32_t j=0; j<_param->_nb_gpr_read; j++)
     
    733733      _component->port_map(name_component,"in_CLOCK" , _name, "in_CLOCK" );
    734734      _component->port_map(name_component,"in_NRESET", _name, "in_NRESET");
    735    
     735      _component->port_map(name_component,"out_CONST_0");
     736      _component->port_map(name_component,"out_CONST_1");
     737
    736738      for (uint32_t j=0; j<_param->_nb_gpr_read; j++)
    737739        {
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/src/test.cpp

    r57 r62  
    7979      (*(registerfile-> in_READ_VAL      [i]))        (READ_VAL      [i]);
    8080      (*(registerfile->out_READ_ACK      [i]))        (READ_ACK      [i]);
     81      if (_param->_have_port_address)
    8182      (*(registerfile-> in_READ_ADDRESS  [i]))        (READ_ADDRESS  [i]);
    8283      (*(registerfile->out_READ_DATA     [i]))        (READ_DATA     [i]);
     
    8687      (*(registerfile-> in_WRITE_VAL     [i]))        (WRITE_VAL     [i]);
    8788      (*(registerfile->out_WRITE_ACK     [i]))        (WRITE_ACK     [i]);
     89      if (_param->_have_port_address)
    8890      (*(registerfile-> in_WRITE_ADDRESS [i]))        (WRITE_ADDRESS [i]);
    8991      (*(registerfile-> in_WRITE_DATA    [i]))        (WRITE_DATA    [i]);
     
    9496      (*(registerfile->out_READ_WRITE_ACK     [i])) (READ_WRITE_ACK      [i]);
    9597      (*(registerfile-> in_READ_WRITE_RW      [i])) (READ_WRITE_RW       [i]);
     98      if (_param->_have_port_address)
    9699      (*(registerfile-> in_READ_WRITE_ADDRESS [i])) (READ_WRITE_ADDRESS  [i]);
    97100      (*(registerfile-> in_READ_WRITE_WDATA   [i])) (READ_WRITE_WDATA    [i]);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Parameters.h

    r55 r62  
    2727  public : const uint32_t _size_word    ;
    2828  public : const uint32_t _size_address ;
     29  public : const bool     _have_port_address;
    2930
    3031  public : Parameters (uint32_t nb_port_read ,
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/Parameters.cpp

    r55 r62  
    2525    _nb_word           (nb_word      ),
    2626    _size_word         (size_word    ),
    27     _size_address      (static_cast<uint32_t>(log2(_nb_word)))
     27    _size_address      (static_cast<uint32_t>(log2(_nb_word))),
     28    _have_port_address (_size_address != 0)
     29
    2830  {
    2931    test();
     
    3638    _nb_word           (param._nb_word      ),
    3739    _size_word         (param._size_word    ),
    38     _size_address      (param._size_address )
     40    _size_address      (param._size_address ),
     41    _have_port_address (param._have_port_address)
    3942  {
    4043    test();
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/Parameters_msg_error.cpp

    r55 r62  
    5050        msg += "    * nb_port_read_write              : " + toString(_nb_port_read_write) + "\n";
    5151      }
    52     if (_nb_word < 2)
    53       {
    54         msg += "  - nb_word must be >= 2\n";
    55         msg += "    * nb_word                         : " + toString(_nb_word)    + "\n";
    56       }
     52//     if (_nb_word < 2)
     53//       {
     54//         msg += "  - nb_word must be >= 2\n";
     55//         msg += "    * nb_word                         : " + toString(_nb_word)    + "\n";
     56//       }
    5757
    5858    return msg;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic.cpp

    r58 r62  
    5858        sensitive_neg << *(in_CLOCK);
    5959        for (uint32_t i=0; i<_param->_nb_port_read; i++)
    60           sensitive << *(in_READ_VAL     [i])
    61                     << *(in_READ_ADDRESS [i]);
     60          {
     61            sensitive << *(in_READ_VAL     [i]);
     62            if (_param->_have_port_address)
     63              sensitive << *(in_READ_ADDRESS [i]);
     64          }
    6265        for (uint32_t i=0; i<_param->_nb_port_read_write; i++)
    63           sensitive << *(in_READ_WRITE_VAL     [i])
    64                     << *(in_READ_WRITE_RW      [i])
    65                     << *(in_READ_WRITE_ADDRESS [i]);
     66          {
     67            sensitive << *(in_READ_WRITE_VAL     [i])
     68                      << *(in_READ_WRITE_RW      [i]);
     69            if (_param->_have_port_address)
     70              sensitive << *(in_READ_WRITE_ADDRESS [i]);
     71          }
    6672       
    6773#  ifdef SYSTEMCASS_SPECIFIC
     
    7076          {
    7177            (*(out_READ_DATA  [i])) (*( in_READ_VAL     [i]));
    72             (*(out_READ_DATA  [i])) (*( in_READ_ADDRESS [i]));
     78            if (_param->_have_port_address)
     79              (*(out_READ_DATA  [i])) (*( in_READ_ADDRESS [i]));
    7380          }
    7481        for (uint32_t i=0; i<_param->_nb_port_read_write; i++)
     
    7683            (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_VAL     [i]));
    7784            (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_RW      [i]));
    78             (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_ADDRESS [i]));
     85            if (_param->_have_port_address)
     86              (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_ADDRESS [i]));
    7987          }
    8088#  endif   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_allocation.cpp

    r57 r62  
    4444     in_READ_VAL         = new SC_IN (Tcontrol_t) * [_param->_nb_port_read];
    4545    out_READ_ACK         = new SC_OUT(Tcontrol_t) * [_param->_nb_port_read];
     46    if (_param->_have_port_address)
    4647     in_READ_ADDRESS     = new SC_IN (Taddress_t) * [_param->_nb_port_read];
    4748    out_READ_DATA        = new SC_OUT(Tdata_t   ) * [_param->_nb_port_read];
     
    5960         in_READ_VAL     [i]  = interface->set_signal_valack_in        ("val"    , VAL);
    6061        out_READ_ACK     [i]  = interface->set_signal_valack_out       ("ack"    , ACK);
     62        if (_param->_have_port_address)
    6163         in_READ_ADDRESS [i]  = interface->set_signal_in  <Taddress_t> ("address", _param->_size_address);
    6264        out_READ_DATA    [i]  = interface->set_signal_out <Tdata_t   > ("data"   , _param->_size_word);
     
    6769     in_WRITE_VAL        = new SC_IN (Tcontrol_t) * [_param->_nb_port_write];
    6870    out_WRITE_ACK        = new SC_OUT(Tcontrol_t) * [_param->_nb_port_write];
     71    if (_param->_have_port_address)
    6972     in_WRITE_ADDRESS    = new SC_IN (Taddress_t) * [_param->_nb_port_write];
    7073     in_WRITE_DATA       = new SC_IN (Tdata_t   ) * [_param->_nb_port_write];
     
    8285         in_WRITE_VAL     [i]  = interface->set_signal_valack_in        ("val"    , VAL);
    8386        out_WRITE_ACK     [i]  = interface->set_signal_valack_out       ("ack"    , ACK);
     87        if (_param->_have_port_address)
    8488         in_WRITE_ADDRESS [i]  = interface->set_signal_in  <Taddress_t> ("address", _param->_size_address);
    8589         in_WRITE_DATA    [i]  = interface->set_signal_in  <Tdata_t   > ("data"   , _param->_size_word);
     
    9195    out_READ_WRITE_ACK         = new SC_OUT(Tcontrol_t) * [_param->_nb_port_read_write];
    9296     in_READ_WRITE_RW          = new SC_IN (Tcontrol_t) * [_param->_nb_port_read_write];
     97    if (_param->_have_port_address)
    9398     in_READ_WRITE_ADDRESS     = new SC_IN (Taddress_t) * [_param->_nb_port_read_write];
    9499     in_READ_WRITE_WDATA       = new SC_IN (Tdata_t   ) * [_param->_nb_port_read_write];
     
    108113        out_READ_WRITE_ACK     [i]  = interface->set_signal_valack_out       ("ack"    , ACK);
    109114         in_READ_WRITE_RW      [i]  = interface->set_signal_valack_in        ("rw"     , VAL);
     115        if (_param->_have_port_address)
    110116         in_READ_WRITE_ADDRESS [i]  = interface->set_signal_in  <Taddress_t> ("address", _param->_size_address);
    111117         in_READ_WRITE_WDATA   [i]  = interface->set_signal_in  <Tdata_t   > ("wdata"  , _param->_size_word);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_deallocation.cpp

    r57 r62  
    2525        delete []  in_READ_VAL    ;
    2626        delete [] out_READ_ACK    ;
     27        if (_param->_have_port_address)
    2728        delete []  in_READ_ADDRESS;
    2829        delete [] out_READ_DATA   ;
     
    3132        delete []  in_WRITE_VAL    ;
    3233        delete [] out_WRITE_ACK    ;
     34        if (_param->_have_port_address)
    3335        delete []  in_WRITE_ADDRESS;
    3436        delete []  in_WRITE_DATA   ;
     
    3840        delete [] out_READ_WRITE_ACK    ;
    3941        delete []  in_READ_WRITE_RW     ;
     42        if (_param->_have_port_address)
    4043        delete []  in_READ_WRITE_ADDRESS;
    4144        delete []  in_READ_WRITE_WDATA  ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_genMealy_read.cpp

    r55 r62  
    2828        if ( PORT_READ(in_READ_VAL [i]) == 1)
    2929          {
    30             Taddress_t address = PORT_READ(in_READ_ADDRESS[i]);
     30            Taddress_t address;
     31            if (_param->_have_port_address)
     32              address = PORT_READ(in_READ_ADDRESS[i]);
     33            else
     34              address = 0;
    3135            Tdata_t    data    = REGISTER_READ(reg_DATA[address]);
    3236
     
    5559             )
    5660          {
    57             Taddress_t address = PORT_READ(in_READ_WRITE_ADDRESS[i]);
     61            Taddress_t address;
     62            if (_param->_have_port_address)
     63              address = PORT_READ(in_READ_WRITE_ADDRESS[i]);
     64            else
     65              address = 0;
    5866           
    5967            data = REGISTER_READ(reg_DATA[address]);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_transition.cpp

    r55 r62  
    3030#endif   
    3131
    32             Taddress_t address = PORT_READ(in_WRITE_ADDRESS[i]);
     32            Taddress_t address;
     33            if (_param->_have_port_address)
     34              address = PORT_READ(in_WRITE_ADDRESS[i]);
     35            else
     36              address = 0;
     37
    3338            Tdata_t    data    = PORT_READ(in_WRITE_DATA   [i]);
    3439           
     
    4954#endif   
    5055
    51             Taddress_t address = PORT_READ(in_READ_WRITE_ADDRESS[i]);
     56            Taddress_t address;
     57            if (_param->_have_port_address)
     58              address = PORT_READ(in_READ_WRITE_ADDRESS[i]);
     59            else
     60              address = 0;
    5261            Tdata_t    data    = PORT_READ(in_READ_WRITE_WDATA  [i]);
    5362           
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl_body.cpp

    r55 r62  
    3737   
    3838    for (uint32_t i = 0; i < _param->_nb_port_read; i++)
    39         vhdl->set_body ("out_READ_"+toString(i)+"_DATA <= reg_DATA (conv_integer(in_READ_"+toString(i)+"_ADDRESS)) when in_READ_"+toString(i)+"_VAL = '1' else "+std_logic_others(_param->_size_word,0)+";");
     39      {
     40        string str_address;
     41        if (_param->_have_port_address)
     42          str_address = "conv_integer(in_READ_"+toString(i)+"_ADDRESS)";
     43        else
     44          str_address = "0";
    4045
     46        vhdl->set_body ("out_READ_"+toString(i)+"_DATA <= reg_DATA ("+str_address+") when in_READ_"+toString(i)+"_VAL = '1' else "+std_logic_others(_param->_size_word,0)+";");
     47      }
    4148    for (uint32_t i = 0; i < _param->_nb_port_read_write; i++)
    42       vhdl->set_body ("out_READ_WRITE_"+toString(i)+"_RDATA <= reg_DATA (conv_integer(in_READ_WRITE_"+toString(i)+"_ADDRESS)) when in_READ_WRITE_"+toString(i)+"_VAL = '1' and in_READ_WRITE_"+toString(i)+"_RW = '"+toString(RW_READ)+"' else "+std_logic_others(_param->_size_word,0)+";");
     49      {
     50        string str_address;
     51        if (_param->_have_port_address)
     52          str_address = "conv_integer(in_READ_WRITE_"+toString(i)+"_ADDRESS)";
     53        else
     54          str_address = "0";
     55        vhdl->set_body ("out_READ_WRITE_"+toString(i)+"_RDATA <= reg_DATA ("+str_address+") when in_READ_WRITE_"+toString(i)+"_VAL = '1' and in_READ_WRITE_"+toString(i)+"_RW = '"+toString(RW_READ)+"' else "+std_logic_others(_param->_size_word,0)+";");
     56      }
    4357
    4458    vhdl->set_body ("");
     
    5468    for (uint32_t i = 0; i < _param->_nb_port_write; i++)
    5569      {
    56       vhdl->set_body ("\t\tif (in_WRITE_"+toString(i)+"_VAL = '1') then");
    57       vhdl->set_body ("\t\t\treg_DATA(conv_integer(in_WRITE_"+toString(i)+"_ADDRESS)) <= in_WRITE_"+toString(i)+"_DATA;");
    58       vhdl->set_body ("\t\tend if;");
     70        string str_address;
     71        if (_param->_have_port_address)
     72          str_address = "conv_integer(in_WRITE_"+toString(i)+"_ADDRESS)";
     73        else
     74          str_address = "0";
     75
     76        vhdl->set_body ("\t\tif (in_WRITE_"+toString(i)+"_VAL = '1') then");
     77        vhdl->set_body ("\t\t\treg_DATA("+str_address+") <= in_WRITE_"+toString(i)+"_DATA;");
     78        vhdl->set_body ("\t\tend if;");
    5979      }
    6080    for (uint32_t i = 0; i < _param->_nb_port_read_write; i++)
    6181      {
    62       vhdl->set_body ("\t\tif (in_READ_WRITE_"+toString(i)+"_VAL = '1' and in_READ_WRITE_"+toString(i)+"_RW = '"+toString(RW_WRITE)+"') then");
    63       vhdl->set_body ("\t\t\treg_DATA(conv_integer(in_READ_WRITE_"+toString(i)+"_ADDRESS)) <= in_READ_WRITE_"+toString(i)+"_WDATA;");
    64       vhdl->set_body ("\t\tend if;");
     82        string str_address;
     83        if (_param->_have_port_address)
     84          str_address = "conv_integer(in_READ_WRITE_"+toString(i)+"_ADDRESS)";
     85        else
     86          str_address = "0";
     87       
     88        vhdl->set_body ("\t\tif (in_READ_WRITE_"+toString(i)+"_VAL = '1' and in_READ_WRITE_"+toString(i)+"_RW = '"+toString(RW_WRITE)+"') then");
     89        vhdl->set_body ("\t\t\treg_DATA("+str_address+") <= in_READ_WRITE_"+toString(i)+"_WDATA;");
     90        vhdl->set_body ("\t\tend if;");
    6591      }
    6692
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest/src/test.cpp

    r58 r62  
    8080      (*(_RegisterFile_Multi_Banked-> in_READ_VAL      [i]))        (READ_VAL      [i]);
    8181      (*(_RegisterFile_Multi_Banked->out_READ_ACK      [i]))        (READ_ACK      [i]);
     82      if (_param->_have_port_address==true)
    8283      (*(_RegisterFile_Multi_Banked-> in_READ_ADDRESS  [i]))        (READ_ADDRESS  [i]);
    8384      (*(_RegisterFile_Multi_Banked->out_READ_DATA     [i]))        (READ_DATA     [i]);
     
    8889      (*(_RegisterFile_Multi_Banked-> in_WRITE_VAL     [i]))        (WRITE_VAL     [i]);
    8990      (*(_RegisterFile_Multi_Banked->out_WRITE_ACK     [i]))        (WRITE_ACK     [i]);
     91      if (_param->_have_port_address==true)
    9092      (*(_RegisterFile_Multi_Banked-> in_WRITE_ADDRESS [i]))        (WRITE_ADDRESS [i]);
    9193      (*(_RegisterFile_Multi_Banked-> in_WRITE_DATA    [i]))        (WRITE_DATA    [i]);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Parameters.h

    r57 r62  
    7171  public : const uint32_t    _nb_word_by_bank      ;
    7272
     73  public : const bool        _have_port_address     ;
     74  public : const bool        _have_bank_port_address;
     75
    7376    // A lot of table to the partial crossbar
    7477  public :       uint32_t  * _link_port_read_to_bank_read  ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/Parameters.cpp

    r57 r62  
    4242    _num_reg_shift         (0),
    4343    _num_reg_mask          (gen_mask<Taddress_t>(_size_address_by_bank)),
    44     _nb_word_by_bank       (_nb_word / _nb_bank)
     44    _nb_word_by_bank       (_nb_word / _nb_bank),
     45    _have_port_address     (_size_address         != 0),
     46    _have_bank_port_address(_size_address_by_bank != 0)
    4547  {
    4648    log_printf(FUNC,RegisterFile_Multi_Banked,"Parameters","Begin");
     
    4850    if (_crossbar == PARTIAL_CROSSBAR)
    4951      {
    50         log_printf(NONE,RegisterFile_Multi_Banked,"Parameters","Case : _crossbar == PARTIAL_CROSSBAR");
     52        log_printf(TRACE,RegisterFile_Multi_Banked,"Parameters","Case : _crossbar == PARTIAL_CROSSBAR");
    5153
    5254        // All port_src is connected with one port_dest on each bank
     
    6870
    6971
    70         log_printf(NONE,RegisterFile_Multi_Banked,"Parameters"," * _link_port_read_to_bank_read");
     72        log_printf(TRACE,RegisterFile_Multi_Banked,"Parameters"," * _link_port_read_to_bank_read");
    7173        for (uint32_t i=0; i<_nb_port_read         ;i++)
    7274          {
    73           log_printf(NONE,RegisterFile_Multi_Banked,"Parameters","   * Read  in  [%d] to out    [%d]",i,_link_port_read_to_bank_read          [i]);
    74           printf("   * Read  in  [%d] to out    [%d]\n",i,_link_port_read_to_bank_read          [i]);
     75            log_printf(TRACE,RegisterFile_Multi_Banked,"Parameters","   * Read  in  [%d] to out    [%d]",i,_link_port_read_to_bank_read          [i]);
    7576          }
    76         log_printf(NONE,RegisterFile_Multi_Banked,"Parameters"," * _link_port_write_to_bank_write");
     77        log_printf(TRACE,RegisterFile_Multi_Banked,"Parameters"," * _link_port_write_to_bank_write");
    7778        for (uint32_t i=0; i<_nb_port_write        ;i++)
    7879          {
    79             log_printf(NONE,RegisterFile_Multi_Banked,"Parameters","   * Write in  [%d] to out    [%d]",i,_link_port_write_to_bank_write          [i]);
    80             printf("   * Write in  [%d] to out    [%d]\n",i,_link_port_write_to_bank_write          [i]);
     80            log_printf(TRACE,RegisterFile_Multi_Banked,"Parameters","   * Write in  [%d] to out    [%d]",i,_link_port_write_to_bank_write          [i]);
    8181          }
    8282      }
     
    102102    _num_reg_shift         (param._num_reg_shift        ),
    103103    _num_reg_mask          (param._num_reg_mask         ),
    104     _nb_word_by_bank       (param._nb_word_by_bank      )
     104    _nb_word_by_bank       (param._nb_word_by_bank      ),
     105    _have_port_address     (param._have_port_address     ),
     106    _have_bank_port_address(param._have_bank_port_address)
    105107  {
    106108    log_printf(FUNC,RegisterFile_Multi_Banked,"Parameters (copy)","Begin");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked.cpp

    r57 r62  
    8585    sensitive_neg << *(in_CLOCK);
    8686    for (uint32_t i=0; i<_param->_nb_port_read; i++)
    87       sensitive << *( in_READ_VAL     [i])
    88                 << *( in_READ_ADDRESS [i]);
     87      {
     88        sensitive << *( in_READ_VAL     [i]);
     89        if (_param->_have_port_address == true)
     90          sensitive << *( in_READ_ADDRESS [i]);
     91      }
    8992
    9093#ifdef SYSTEMCASS_SPECIFIC
     
    9396      {
    9497        (*(out_READ_ACK  [i])) (*( in_READ_VAL     [i]));
     98        if (_param->_have_port_address == true)
    9599        (*(out_READ_ACK  [i])) (*( in_READ_ADDRESS [i]));
    96100        (*(out_READ_DATA [i])) (*( in_READ_VAL     [i]));
     101        if (_param->_have_port_address == true)
    97102        (*(out_READ_DATA [i])) (*( in_READ_ADDRESS [i]));
    98103      }
     
    109114    sensitive_neg << *(in_CLOCK);
    110115    for (uint32_t i=0; i<_param->_nb_port_write; i++)
    111       sensitive << *( in_WRITE_VAL     [i])
    112                 << *( in_WRITE_ADDRESS [i])
    113                 << *( in_WRITE_DATA    [i]);
     116      {
     117        sensitive << *( in_WRITE_VAL     [i])
     118                  << *( in_WRITE_DATA    [i]);
     119        if (_param->_have_port_address == true)
     120          sensitive << *( in_WRITE_ADDRESS [i]);
     121      }
    114122
    115123#ifdef SYSTEMCASS_SPECIFIC
     
    118126      {
    119127        (*(out_WRITE_ACK  [i])) (*( in_WRITE_VAL     [i]));
     128        if (_param->_have_port_address == true)
    120129        (*(out_WRITE_ACK  [i])) (*( in_WRITE_ADDRESS [i]));
    121130        (*(out_WRITE_ACK  [i])) (*( in_WRITE_DATA    [i]));
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_allocation.cpp

    r57 r62  
    5050     in_READ_VAL         = new SC_IN (Tcontrol_t) * [_param->_nb_port_read];
    5151    out_READ_ACK         = new SC_OUT(Tcontrol_t) * [_param->_nb_port_read];
     52    if (_param->_have_port_address == true)
    5253     in_READ_ADDRESS     = new SC_IN (Taddress_t) * [_param->_nb_port_read];
    5354    out_READ_DATA        = new SC_OUT(Tdata_t   ) * [_param->_nb_port_read];
     
    6566         in_READ_VAL     [i]  = interface->set_signal_valack_in        ("val"    , VAL);
    6667        out_READ_ACK     [i]  = interface->set_signal_valack_out       ("ack"    , ACK);
     68        if (_param->_have_port_address == true)
    6769         in_READ_ADDRESS [i]  = interface->set_signal_in  <Taddress_t> ("address", static_cast<uint32_t>(log2(_param->_nb_word)));
    6870        out_READ_DATA    [i]  = interface->set_signal_out <Tdata_t   > ("data"   , _param->_size_word);
     
    7375     in_WRITE_VAL        = new SC_IN (Tcontrol_t) * [_param->_nb_port_write];
    7476    out_WRITE_ACK        = new SC_OUT(Tcontrol_t) * [_param->_nb_port_write];
     77    if (_param->_have_port_address == true)
    7578     in_WRITE_ADDRESS    = new SC_IN (Taddress_t) * [_param->_nb_port_write];
    7679     in_WRITE_DATA       = new SC_IN (Tdata_t   ) * [_param->_nb_port_write];
     
    8891         in_WRITE_VAL     [i]  = interface->set_signal_valack_in        ("val"    , VAL);
    8992        out_WRITE_ACK     [i]  = interface->set_signal_valack_out       ("ack"    , ACK);
     93        if (_param->_have_port_address == true)
    9094         in_WRITE_ADDRESS [i]  = interface->set_signal_in  <Taddress_t> ("address", static_cast<uint32_t>(log2(_param->_nb_word)));
    9195         in_WRITE_DATA    [i]  = interface->set_signal_in  <Tdata_t   > ("data"   , _param->_size_word);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_deallocation.cpp

    r53 r62  
    2626    delete []  in_READ_VAL    ;
    2727    delete [] out_READ_ACK    ;
     28    if (_param->_have_port_address == true)
    2829    delete []  in_READ_ADDRESS;
    2930    delete [] out_READ_DATA   ;
     
    3233    delete []  in_WRITE_VAL    ;
    3334    delete [] out_WRITE_ACK    ;
     35    if (_param->_have_port_address == true)
    3436    delete []  in_WRITE_ADDRESS;
    3537    delete []  in_WRITE_DATA   ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_full_crossbar_genMealy_read.cpp

    r57 r62  
    3737          {
    3838            // Compute the adress of the bank
    39             Taddress_t address = PORT_READ(in_READ_ADDRESS[i]);
     39            Taddress_t address;
     40            if (_param->_have_port_address == true)
     41              address = PORT_READ(in_READ_ADDRESS[i]);
     42            else
     43              address = 0;
     44
    4045            log_printf(TRACE,RegisterFile_Multi_Banked,"full_crossbar_genMealy_read"," * address   : %d",address);
    4146            Taddress_t bank    = address_bank    (address);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_full_crossbar_genMealy_write.cpp

    r57 r62  
    3838            val                = false;
    3939            // Compute the adress of the bank
    40             Taddress_t address = PORT_READ(in_WRITE_ADDRESS[i]);
     40            Taddress_t address;
     41            if (_param->_have_port_address == true)
     42              address = PORT_READ(in_WRITE_ADDRESS[i]);
     43            else
     44              address = 0;
    4145            log_printf(TRACE,RegisterFile_Multi_Banked,"full_crossbar_genMealy_write"," * address   : %d",address);
    4246            Taddress_t bank    = address_bank    (address);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_partial_crossbar_genMealy_read.cpp

    r57 r62  
    3737          {
    3838            // Compute the adress of the bank
    39             Taddress_t address = PORT_READ(in_READ_ADDRESS[i]);
     39            Taddress_t address;
     40            if (_param->_have_port_address == true)
     41              address = PORT_READ(in_READ_ADDRESS[i]);
     42            else
     43              address = 0;
    4044            log_printf(TRACE,RegisterFile_Multi_Banked,"full_crossbar_genMealy_read"," * address   : %d",address);
    4145            Taddress_t bank    = address_bank    (address);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_partial_crossbar_genMealy_write.cpp

    r57 r62  
    3737            val                = false;
    3838            // Compute the adress of the bank
    39             Taddress_t address = PORT_READ(in_WRITE_ADDRESS[i]);
     39            Taddress_t address;
     40            if (_param->_have_port_address == true)
     41              address = PORT_READ(in_WRITE_ADDRESS[i]);
     42            else
     43              address = 0;
    4044            log_printf(TRACE,RegisterFile_Multi_Banked,"partial_crossbar_genMealy_write"," * address   : %d",address);
    4145            Taddress_t bank    = address_bank    (address);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_vhdl_body.cpp

    r58 r62  
    5151            vhdl->set_body("\t, in_READ_"+toString(j)+"_VAL     \t=>\tinternal_BANK_READ_"+toString(i)+"_"+toString(j)+"_VAL");
    5252            vhdl->set_body("\t,out_READ_"+toString(j)+"_ACK     \t=>\tinternal_BANK_READ_"+toString(i)+"_"+toString(j)+"_ACK");
     53            if (_param->_have_bank_port_address == true)
    5354            vhdl->set_body("\t, in_READ_"+toString(j)+"_ADDRESS \t=>\tinternal_BANK_READ_"+toString(i)+"_"+toString(j)+"_ADDRESS");
    5455            vhdl->set_body("\t,out_READ_"+toString(j)+"_DATA    \t=>\tinternal_BANK_READ_"+toString(i)+"_"+toString(j)+"_DATA");
     
    5859            vhdl->set_body("\t, in_WRITE_"+toString(j)+"_VAL     \t=>\tinternal_BANK_WRITE_"+toString(i)+"_"+toString(j)+"_VAL");
    5960            vhdl->set_body("\t,out_WRITE_"+toString(j)+"_ACK     \t=>\tinternal_BANK_WRITE_"+toString(i)+"_"+toString(j)+"_ACK");
     61            if (_param->_have_bank_port_address == true)
    6062            vhdl->set_body("\t, in_WRITE_"+toString(j)+"_ADDRESS \t=>\tinternal_BANK_WRITE_"+toString(i)+"_"+toString(j)+"_ADDRESS");
    6163            vhdl->set_body("\t, in_WRITE_"+toString(j)+"_DATA    \t=>\tinternal_BANK_WRITE_"+toString(i)+"_"+toString(j)+"_DATA");
     
    154156    vhdl->set_body("-----------------------------------");
    155157    vhdl->set_body("");
     158
     159    if (_param->_have_bank_port_address == true)
    156160    for (uint32_t i=0; i<_param->_nb_bank; i++)
    157161      {
     
    221225        for (uint32_t j=0; j<_param->_nb_port_read; j ++)
    222226          {
    223             string address = (_param->_nb_bank==1)?"":("and (in_READ_"+toString(j)+"_ADDRESS"+std_logic_range(_param->_size_address-1,_param->_size_address_by_bank)+"="+std_logic_conv( _param->_size_address-_param->_size_address_by_bank,i)+") ");
    224 
    225             vhdl->set_body("internal_READ_"+toString(i)+"_"+toString(j)+"_VAL  <= '1' when (in_READ_"+toString(j)+"_VAL ='1') "+address+"else '0';");
     227            string str_address;
     228
     229            if (_param->_have_bank_port_address == true)
     230              str_address = (_param->_nb_bank==1)?"":("and (in_READ_"+toString(j)+"_ADDRESS"+std_logic_range(_param->_size_address-1,_param->_size_address_by_bank)+"="+std_logic_conv( _param->_size_address-_param->_size_address_by_bank,i)+") ");
     231            else
     232              str_address = "";
     233
     234            vhdl->set_body("internal_READ_"+toString(i)+"_"+toString(j)+"_VAL  <= '1' when (in_READ_"+toString(j)+"_VAL ='1') "+str_address+"else '0';");
    226235          }
    227236        for (uint32_t j=0; j<_param->_nb_port_write; j ++)
    228237          {
    229             string address = (_param->_nb_bank==1)?"":("and (in_WRITE_"+toString(j)+"_ADDRESS"+std_logic_range(_param->_size_address-1,_param->_size_address_by_bank)+"="+std_logic_conv( _param->_size_address-_param->_size_address_by_bank,i)+") ");
    230             vhdl->set_body("internal_WRITE_"+toString(i)+"_"+toString(j)+"_VAL <= '1' when (in_WRITE_"+toString(j)+"_VAL='1') "+address+"else '0';");
     238            string str_address;
     239
     240            if (_param->_have_port_address == true)
     241              str_address = (_param->_nb_bank==1)?"":("and (in_WRITE_"+toString(j)+"_ADDRESS"+std_logic_range(_param->_size_address-1,_param->_size_address_by_bank)+"="+std_logic_conv( _param->_size_address-_param->_size_address_by_bank,i)+") ");
     242            else
     243              str_address = "";
     244
     245            vhdl->set_body("internal_WRITE_"+toString(i)+"_"+toString(j)+"_VAL <= '1' when (in_WRITE_"+toString(j)+"_VAL='1') "+str_address+"else '0';");
    231246          }
    232247      }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_vhdl_declaration.cpp

    r58 r62  
    4141            vhdl->set_signal ("internal_BANK_READ_"+toString(i)+"_"+toString(j)+"_VAL" ,1);
    4242            vhdl->set_signal ("internal_BANK_READ_"+toString(i)+"_"+toString(j)+"_ACK"    ,1);
     43            if (_param->_have_bank_port_address == true)
    4344            vhdl->set_signal ("internal_BANK_READ_"+toString(i)+"_"+toString(j)+"_ADDRESS",_param->_size_address_by_bank);
    4445            vhdl->set_signal ("internal_BANK_READ_"+toString(i)+"_"+toString(j)+"_DATA"   ,_param->_size_word);
     
    6465            vhdl->set_signal ("internal_BANK_WRITE_"+toString(i)+"_"+toString(j)+"_VAL"    ,1);
    6566            vhdl->set_signal ("internal_BANK_WRITE_"+toString(i)+"_"+toString(j)+"_ACK"    ,1);
     67            if (_param->_have_bank_port_address == true)
    6668            vhdl->set_signal ("internal_BANK_WRITE_"+toString(i)+"_"+toString(j)+"_ADDRESS",_param->_size_address_by_bank);
    6769            vhdl->set_signal ("internal_BANK_WRITE_"+toString(i)+"_"+toString(j)+"_DATA"   ,_param->_size_word);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/SelfTest/include/test.h

    r53 r62  
    2121using namespace morpheo::behavioural;
    2222using namespace morpheo::behavioural::generic;
    23 
    2423using namespace morpheo::behavioural::generic::registerfile;
    2524
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/SelfTest/src/main.cpp

    r53 r62  
    5050  const uint32_t    nb_port_write_by_bank = atoi(argv[8]);
    5151  const Tcrossbar_t crossbar              = fromString<Tcrossbar_t>(argv[9]);
    52   const Tinstance_t instance              = (strcmp(argv[10], "0") == 0)?instance_RegisterFile_Monolithic:instance_RegisterFile_Multi_Banked;
     52  const morpheo::behavioural::generic::registerfile::Tinstance_t instance              = (strcmp(argv[10], "0") == 0)?instance_RegisterFile_Monolithic:instance_RegisterFile_Multi_Banked;
    5353
    5454  try
     
    6060          morpheo::behavioural::generic::registerfile::registerfile_monolithic  ::Parameters * param1 = new morpheo::behavioural::generic::registerfile::registerfile_monolithic  ::Parameters (nb_port_read         ,
    6161                                                                                                                                                                                                nb_port_write        ,
     62                                                                                                                                                                                                0                    ,
    6263                                                                                                                                                                                                nb_word              ,
    6364                                                                                                                                                                                                size_word            );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/SelfTest/src/test.cpp

    r53 r62  
    3333  cout << "<" << name << "> : Simulation SystemC" << endl;
    3434
     35#ifdef STATISTICS
     36  morpheo::behavioural::Parameters_Statistics * _param_stat = new morpheo::behavioural::Parameters_Statistics(5,50);
     37#endif
     38 
    3539  RegisterFile * _RegisterFile = new RegisterFile (name.c_str(),
    36 #ifdef STATISTICS
    37                                              morpheo::behavioural::Parameters_Statistics(5,50),
     40#ifdef STATISTICS     
     41                                                   _param_stat,
    3842#endif
    39                                              *_param);
     43                                                   _param);
    4044 
    4145#ifdef SYSTEMC
     
    7478      (*(_RegisterFile-> in_READ_VAL      [i]))        (READ_VAL      [i]);
    7579      (*(_RegisterFile->out_READ_ACK      [i]))        (READ_ACK      [i]);
     80      if (_param->_have_port_address == true)
    7681      (*(_RegisterFile-> in_READ_ADDRESS  [i]))        (READ_ADDRESS  [i]);
    7782      (*(_RegisterFile->out_READ_DATA     [i]))        (READ_DATA     [i]);
     
    8287      (*(_RegisterFile-> in_WRITE_VAL     [i]))        (WRITE_VAL     [i]);
    8388      (*(_RegisterFile->out_WRITE_ACK     [i]))        (WRITE_ACK     [i]);
     89      if (_param->_have_port_address == true)
    8490      (*(_RegisterFile-> in_WRITE_ADDRESS [i]))        (WRITE_ADDRESS [i]);
    8591      (*(_RegisterFile-> in_WRITE_DATA    [i]))        (WRITE_DATA    [i]);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/include/Parameters.h

    r53 r62  
    2323                instance_RegisterFile_Multi_Banked} Tinstance_t;
    2424
    25 
    2625  class Parameters : public morpheo::behavioural::Parameters
    2726  {
     
    3332  public : const uint32_t    _size_word    ;
    3433  public : const uint32_t    _size_address ;
     34  public : const bool        _have_port_address;
     35
    3536  public : morpheo::behavioural::generic::registerfile::registerfile_monolithic  ::Parameters * _param_registerfile_monolithic;
    3637  public : morpheo::behavioural::generic::registerfile::registerfile_multi_banked::Parameters * _param_registerfile_multi_banked;
    37    
    3838
    3939    //-----[ methods ]-----------------------------------------------------------
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/include/RegisterFile.h

    r53 r62  
    4545    // -----[ fields ]----------------------------------------------------
    4646    // Parameters
    47   protected : const string     _name;
     47  protected : const string       _name;
    4848
    49   protected : const Parameters _param;
    50 //#ifdef STATISTICS
    51 //  protected : const morpheo::behavioural::Parameters_Statistics _param_statistics;
    52 //#endif
     49  protected : const Parameters * _param;
     50#ifdef STATISTICS
     51  protected : morpheo::behavioural::Parameters_Statistics * _param_statistics;
     52#endif
    5353
    5454  public    : Component                      * _component;
     
    9494#endif                                         
    9595#ifdef STATISTICS
    96                                               morpheo::behavioural::Parameters_Statistics param_statistics,
     96                                              morpheo::behavioural::Parameters_Statistics * param_statistics,
    9797#endif
    98                                               Parameters                                  param );
     98                                              Parameters                                  * param );
    9999                                               
    100   public  :          RegisterFile              (Parameters param );
    101100  public  :          ~RegisterFile             (void);
    102101                                               
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/Parameters.cpp

    r53 r62  
    2020    _nb_word           (param->_nb_word      ),
    2121    _size_word         (param->_size_word    ),
    22     _size_address      (param->_size_address )
     22    _size_address      (param->_size_address ),
     23    _have_port_address (param->_have_port_address)
    2324  {
    2425    log_printf(FUNC,RegisterFile,"Parameters","Begin");
     
    3738    _nb_word           (param->_nb_word      ),
    3839    _size_word         (param->_size_word    ),
    39     _size_address      (param->_size_address )
     40    _size_address      (param->_size_address ),
     41    _have_port_address (param->_have_port_address)
    4042  {
    4143    log_printf(FUNC,RegisterFile,"Parameters","Begin");
     
    5456    _nb_word           (param._nb_word      ),
    5557    _size_word         (param._size_word    ),
    56     _size_address      (param._size_address )
     58    _size_address      (param._size_address ),
     59    _have_port_address (param._have_port_address)
    5760  {
    5861    log_printf(FUNC,RegisterFile,"Parameters (copy)","Begin");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile.cpp

    r53 r62  
    2020#endif
    2121#ifdef STATISTICS
    22                               morpheo::behavioural::Parameters_Statistics             param_statistics,
     22                              morpheo::behavioural::Parameters_Statistics             * param_statistics,
    2323#endif
    24                               morpheo::behavioural::generic::registerfile::Parameters param ):
     24                              morpheo::behavioural::generic::registerfile::Parameters * param ):
    2525                              _name              (name)
    2626                              ,_param            (param)
    27 // #ifdef STATISTICS
    28 //                            ,_param_statistics (param_statistics)
    29 // #endif
     27#ifdef STATISTICS
     28                              ,_param_statistics (param_statistics)
     29#endif
    3030  {
    3131    log_printf(FUNC,RegisterFile,"RegisterFile","Begin");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_allocation.cpp

    r53 r62  
    2828    // ~~~~~[ Interface : "read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    2929
    30      in_READ_VAL         = new SC_IN (Tcontrol_t) * [_param._nb_port_read];
    31     out_READ_ACK         = new SC_OUT(Tcontrol_t) * [_param._nb_port_read];
    32      in_READ_ADDRESS     = new SC_IN (Taddress_t) * [_param._nb_port_read];
    33     out_READ_DATA        = new SC_OUT(Tdata_t   ) * [_param._nb_port_read];
     30     in_READ_VAL         = new SC_IN (Tcontrol_t) * [_param->_nb_port_read];
     31    out_READ_ACK         = new SC_OUT(Tcontrol_t) * [_param->_nb_port_read];
     32    if (_param->_have_port_address == true)
     33     in_READ_ADDRESS     = new SC_IN (Taddress_t) * [_param->_nb_port_read];
     34    out_READ_DATA        = new SC_OUT(Tdata_t   ) * [_param->_nb_port_read];
    3435
    35     for (uint32_t i=0; i<_param._nb_port_read; i++)
     36    for (uint32_t i=0; i<_param->_nb_port_read; i++)
    3637      {
    3738        rename =  "in_READ_"+toString(i)+"_VAL"    ;
     
    3940        rename = "out_READ_"+toString(i)+"_ACK"    ;
    4041        out_READ_ACK     [i]  = new SC_OUT(Tcontrol_t) (rename.c_str());
     42        if (_param->_have_port_address == true)
     43          {
    4144        rename =  "in_READ_"+toString(i)+"_ADDRESS";
    4245         in_READ_ADDRESS [i]  = new SC_IN (Taddress_t) (rename.c_str());
     46          }
    4347        rename = "out_READ_"+toString(i)+"_DATA"   ;
    4448        out_READ_DATA    [i]  = new SC_OUT(Tdata_t   ) (rename.c_str());
     
    4751    // ~~~~~[ Interface : "write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    4852
    49      in_WRITE_VAL        = new SC_IN (Tcontrol_t) * [_param._nb_port_write];
    50     out_WRITE_ACK        = new SC_OUT(Tcontrol_t) * [_param._nb_port_write];
    51      in_WRITE_ADDRESS    = new SC_IN (Taddress_t) * [_param._nb_port_write];
    52      in_WRITE_DATA       = new SC_IN (Tdata_t   ) * [_param._nb_port_write];
     53     in_WRITE_VAL        = new SC_IN (Tcontrol_t) * [_param->_nb_port_write];
     54    out_WRITE_ACK        = new SC_OUT(Tcontrol_t) * [_param->_nb_port_write];
     55    if (_param->_have_port_address == true)
     56     in_WRITE_ADDRESS    = new SC_IN (Taddress_t) * [_param->_nb_port_write];
     57     in_WRITE_DATA       = new SC_IN (Tdata_t   ) * [_param->_nb_port_write];
    5358   
    54     for (uint32_t i=0; i<_param._nb_port_write; i++)
     59    for (uint32_t i=0; i<_param->_nb_port_write; i++)
    5560      {
    5661        rename =  "in_WRITE_"+toString(i)+"_VAL"    ;
     
    5863        rename = "out_WRITE_"+toString(i)+"_ACK"    ;
    5964        out_WRITE_ACK     [i]  = new SC_OUT(Tcontrol_t) (rename.c_str());
     65        if (_param->_have_port_address == true)
     66          {
    6067        rename =  "in_WRITE_"+toString(i)+"_ADDRESS";
    6168         in_WRITE_ADDRESS [i]  = new SC_IN (Taddress_t) (rename.c_str());
     69          }
    6270        rename =  "in_WRITE_"+toString(i)+"_DATA"   ;
    6371         in_WRITE_DATA    [i]  = new SC_IN (Tdata_t   ) (rename.c_str());
     
    6573
    6674    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                               
    67     if (_param._instance == instance_RegisterFile_Monolithic)
     75    if (_param->_instance == instance_RegisterFile_Monolithic)
    6876    // =====[ component_RegisterFile_Monolithic ]=========================
    6977      {
     
    7280                                                                                                                                                                               ,_param_statistics
    7381#endif
    74                                                                                                                                                                                ,*(_param._param_registerfile_monolithic)
     82                                                                                                                                                                               ,_param->_param_registerfile_monolithic
    7583                                                                                                                                                                               );
    7684       
     
    8391                                                                                                                                                                                ,_param_statistics
    8492#endif
    85                                                                                                                                                                                 ,*(_param._param_registerfile_multi_banked)
     93                                                                                                                                                                                ,_param->_param_registerfile_multi_banked
    8694                                                                                                                                                                                );
    8795       
     
    8997    // ~~~~~[ Component - Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    9098
    91     if (_param._instance == instance_RegisterFile_Monolithic)
     99    if (_param->_instance == instance_RegisterFile_Monolithic)
    92100    // =====[ Component_RegisterFile_Monolithic - Instanciation ]=========
    93101      {
     
    95103        (*(component_RegisterFile_Monolithic  ->in_NRESET)) (*(in_NRESET));
    96104       
    97         for (uint32_t i=0; i<_param._nb_port_read; i++)
     105        for (uint32_t i=0; i<_param->_nb_port_read; i++)
    98106          {
    99107            (*(component_RegisterFile_Monolithic  -> in_READ_VAL     [i])) (*( in_READ_VAL     [i]));   
    100108            (*(component_RegisterFile_Monolithic  ->out_READ_ACK     [i])) (*(out_READ_ACK     [i]));
     109            if (_param->_have_port_address == true)
    101110            (*(component_RegisterFile_Monolithic  -> in_READ_ADDRESS [i])) (*( in_READ_ADDRESS [i]));
    102111            (*(component_RegisterFile_Monolithic  ->out_READ_DATA    [i])) (*(out_READ_DATA    [i]));
    103112          }
    104113       
    105         for (uint32_t i=0; i<_param._nb_port_write; i++)
     114        for (uint32_t i=0; i<_param->_nb_port_write; i++)
    106115          {
    107116            (*(component_RegisterFile_Monolithic  -> in_WRITE_VAL     [i])) (*( in_WRITE_VAL     [i]));
    108117            (*(component_RegisterFile_Monolithic  ->out_WRITE_ACK     [i])) (*(out_WRITE_ACK     [i]));
     118            if (_param->_have_port_address == true)
    109119            (*(component_RegisterFile_Monolithic  -> in_WRITE_ADDRESS [i])) (*( in_WRITE_ADDRESS [i]));
    110120            (*(component_RegisterFile_Monolithic  -> in_WRITE_DATA    [i])) (*( in_WRITE_DATA    [i]));
     
    117127        (*(component_RegisterFile_Multi_Banked->in_NRESET)) (*(in_NRESET));
    118128       
    119         for (uint32_t i=0; i<_param._nb_port_read; i++)
     129        for (uint32_t i=0; i<_param->_nb_port_read; i++)
    120130          {
    121131            (*(component_RegisterFile_Multi_Banked-> in_READ_VAL     [i])) (*( in_READ_VAL     [i]));   
    122132            (*(component_RegisterFile_Multi_Banked->out_READ_ACK     [i])) (*(out_READ_ACK     [i]));
     133            if (_param->_have_port_address == true)
    123134            (*(component_RegisterFile_Multi_Banked-> in_READ_ADDRESS [i])) (*( in_READ_ADDRESS [i]));
    124135            (*(component_RegisterFile_Multi_Banked->out_READ_DATA    [i])) (*(out_READ_DATA    [i]));
    125136          }
    126137       
    127         for (uint32_t i=0; i<_param._nb_port_write; i++)
     138        for (uint32_t i=0; i<_param->_nb_port_write; i++)
    128139          {
    129140            (*(component_RegisterFile_Multi_Banked-> in_WRITE_VAL     [i])) (*( in_WRITE_VAL     [i]));
    130141            (*(component_RegisterFile_Multi_Banked->out_WRITE_ACK     [i])) (*(out_WRITE_ACK     [i]));
     142            if (_param->_have_port_address == true)
    131143            (*(component_RegisterFile_Multi_Banked-> in_WRITE_ADDRESS [i])) (*( in_WRITE_ADDRESS [i]));
    132144            (*(component_RegisterFile_Multi_Banked-> in_WRITE_DATA    [i])) (*( in_WRITE_DATA    [i]));
     
    134146      }
    135147
    136     if (_param._instance == instance_RegisterFile_Monolithic)
     148    if (_param->_instance == instance_RegisterFile_Monolithic)
    137149      _component = component_RegisterFile_Monolithic  ->_component;
    138150    else
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_deallocation.cpp

    r53 r62  
    2424    delete []  in_READ_VAL    ;
    2525    delete [] out_READ_ACK    ;
     26    if (_param->_have_port_address == true)
    2627    delete []  in_READ_ADDRESS;
    2728    delete [] out_READ_DATA   ;
     
    3031    delete []  in_WRITE_VAL    ;
    3132    delete [] out_WRITE_ACK    ;
     33    if (_param->_have_port_address == true)
    3234    delete []  in_WRITE_ADDRESS;
    3335    delete []  in_WRITE_DATA   ;
     
    3739//   delete _component;
    3840
    39     if (_param._instance == instance_RegisterFile_Monolithic)
     41    if (_param->_instance == instance_RegisterFile_Monolithic)
    4042      delete component_RegisterFile_Monolithic  ;
    4143    else
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_statistics.cpp

    r53 r62  
    1919    log_printf(FUNC,RegisterFile,"statistics","Begin");
    2020   
    21     if (_param->_instance == instance_RegisterFile_Monilithic)
    22       component_RegisterFile_Monolithic  ->statistics(depth);
     21    string txt;
     22
     23    if (_param->_instance == instance_RegisterFile_Monolithic)
     24      txt = component_RegisterFile_Monolithic  ->statistics(depth);
    2325    else
    24       component_RegisterFile_Multi_Banked->statistics(depth);
    25 
    26     string txt = _stat->print(depth);
     26      txt = component_RegisterFile_Multi_Banked->statistics(depth);
    2727   
    2828    log_printf(FUNC,RegisterFile,"statistics","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/SelfTest/mkf.info

    r57 r62  
    33target_dep      all     Select_Priority_Fixed_0.ngc
    44target_dep      Select_Priority_Fixed_0.ngc     Select_Priority_Fixed_0.prj
    5 target_dep      Select_Priority_Fixed_0.prj     Select_Priority_Fixed_0_Pack.vhdl Select_Priority_Fixed_0.vhdl
     5target_dep      Select_Priority_Fixed_0.prj     Select_Priority_Fixed_0.vhdl Select_Priority_Fixed_0_Pack.vhdl
     6
     7# Select_Priority_Fixed_1
     8target_dep      all     Select_Priority_Fixed_1.ngc
     9target_dep      Select_Priority_Fixed_1.ngc     Select_Priority_Fixed_1.prj
     10target_dep      Select_Priority_Fixed_1.prj     Select_Priority_Fixed_1.vhdl Select_Priority_Fixed_10.vhdl Select_Priority_Fixed_10_Pack.vhdl Select_Priority_Fixed_11.vhdl Select_Priority_Fixed_11_Pack.vhdl Select_Priority_Fixed_1_Pack.vhdl
    611
    712# Select_Priority_Fixed_10
    813target_dep      all     Select_Priority_Fixed_10.ngc
    914target_dep      Select_Priority_Fixed_10.ngc    Select_Priority_Fixed_10.prj
    10 target_dep      Select_Priority_Fixed_10.prj    Select_Priority_Fixed_10_Pack.vhdl Select_Priority_Fixed_10.vhdl
     15target_dep      Select_Priority_Fixed_10.prj    Select_Priority_Fixed_10.vhdl Select_Priority_Fixed_10_Pack.vhdl
    1116
    1217# Select_Priority_Fixed_11
    1318target_dep      all     Select_Priority_Fixed_11.ngc
    1419target_dep      Select_Priority_Fixed_11.ngc    Select_Priority_Fixed_11.prj
    15 target_dep      Select_Priority_Fixed_11.prj    Select_Priority_Fixed_11_Pack.vhdl Select_Priority_Fixed_11.vhdl
    16 
    17 # Select_Priority_Fixed_1
    18 target_dep      all     Select_Priority_Fixed_1.ngc
    19 target_dep      Select_Priority_Fixed_1.ngc     Select_Priority_Fixed_1.prj
    20 target_dep      Select_Priority_Fixed_1.prj     Select_Priority_Fixed_10_Pack.vhdl Select_Priority_Fixed_10.vhdl Select_Priority_Fixed_11_Pack.vhdl Select_Priority_Fixed_11.vhdl Select_Priority_Fixed_1_Pack.vhdl Select_Priority_Fixed_1.vhdl
     20target_dep      Select_Priority_Fixed_11.prj    Select_Priority_Fixed_11.vhdl Select_Priority_Fixed_11_Pack.vhdl
    2121
    2222# Select_Priority_Fixed_2
    2323target_dep      all     Select_Priority_Fixed_2.ngc
    2424target_dep      Select_Priority_Fixed_2.ngc     Select_Priority_Fixed_2.prj
    25 target_dep      Select_Priority_Fixed_2.prj     Select_Priority_Fixed_2_Pack.vhdl Select_Priority_Fixed_2.vhdl
     25target_dep      Select_Priority_Fixed_2.prj     Select_Priority_Fixed_2.vhdl Select_Priority_Fixed_2_Pack.vhdl
    2626
    2727# Select_Priority_Fixed_3
    2828target_dep      all     Select_Priority_Fixed_3.ngc
    2929target_dep      Select_Priority_Fixed_3.ngc     Select_Priority_Fixed_3.prj
    30 target_dep      Select_Priority_Fixed_3.prj     Select_Priority_Fixed_3_Pack.vhdl Select_Priority_Fixed_3.vhdl
     30target_dep      Select_Priority_Fixed_3.prj     Select_Priority_Fixed_3.vhdl Select_Priority_Fixed_3_Pack.vhdl
    3131
    3232# Select_Priority_Fixed_4
    3333target_dep      all     Select_Priority_Fixed_4.ngc
    3434target_dep      Select_Priority_Fixed_4.ngc     Select_Priority_Fixed_4.prj
    35 target_dep      Select_Priority_Fixed_4.prj     Select_Priority_Fixed_4_Pack.vhdl Select_Priority_Fixed_4.vhdl
     35target_dep      Select_Priority_Fixed_4.prj     Select_Priority_Fixed_4.vhdl Select_Priority_Fixed_4_Pack.vhdl
    3636
    3737# Select_Priority_Fixed_5
    3838target_dep      all     Select_Priority_Fixed_5.ngc
    3939target_dep      Select_Priority_Fixed_5.ngc     Select_Priority_Fixed_5.prj
    40 target_dep      Select_Priority_Fixed_5.prj     Select_Priority_Fixed_5_Pack.vhdl Select_Priority_Fixed_5.vhdl
     40target_dep      Select_Priority_Fixed_5.prj     Select_Priority_Fixed_5.vhdl Select_Priority_Fixed_5_Pack.vhdl
    4141
    4242# Select_Priority_Fixed_6
    4343target_dep      all     Select_Priority_Fixed_6.ngc
    4444target_dep      Select_Priority_Fixed_6.ngc     Select_Priority_Fixed_6.prj
    45 target_dep      Select_Priority_Fixed_6.prj     Select_Priority_Fixed_6_Pack.vhdl Select_Priority_Fixed_6.vhdl
     45target_dep      Select_Priority_Fixed_6.prj     Select_Priority_Fixed_6.vhdl Select_Priority_Fixed_6_Pack.vhdl
    4646
    4747# Select_Priority_Fixed_7
    4848target_dep      all     Select_Priority_Fixed_7.ngc
    4949target_dep      Select_Priority_Fixed_7.ngc     Select_Priority_Fixed_7.prj
    50 target_dep      Select_Priority_Fixed_7.prj     Select_Priority_Fixed_7_Pack.vhdl Select_Priority_Fixed_7.vhdl
     50target_dep      Select_Priority_Fixed_7.prj     Select_Priority_Fixed_7.vhdl Select_Priority_Fixed_7_Pack.vhdl
    5151
    5252# Select_Priority_Fixed_8
    5353target_dep      all     Select_Priority_Fixed_8.ngc
    5454target_dep      Select_Priority_Fixed_8.ngc     Select_Priority_Fixed_8.prj
    55 target_dep      Select_Priority_Fixed_8.prj     Select_Priority_Fixed_8_Pack.vhdl Select_Priority_Fixed_8.vhdl
     55target_dep      Select_Priority_Fixed_8.prj     Select_Priority_Fixed_8.vhdl Select_Priority_Fixed_8_Pack.vhdl
    5656
    5757# Select_Priority_Fixed_9
    5858target_dep      all     Select_Priority_Fixed_9.ngc
    5959target_dep      Select_Priority_Fixed_9.ngc     Select_Priority_Fixed_9.prj
    60 target_dep      Select_Priority_Fixed_9.prj     Select_Priority_Fixed_9_Pack.vhdl Select_Priority_Fixed_9.vhdl
     60target_dep      Select_Priority_Fixed_9.prj     Select_Priority_Fixed_9.vhdl Select_Priority_Fixed_9_Pack.vhdl
    6161
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Common

    r55 r62  
    2020
    2121LIBDIR                          = $(DIR_LIBRARY)                        \
    22                                   $(SYSTEMC_LIBDIR_$(SIMULATOR))        \
    23                                   $(SOCLIB_LIBDIR)                      \
    24                                   $(OR1K_LIBDIR)                               
     22                                  $(SYSTEMC_LIBDIR_$(SIMULATOR))       
     23#                                 $(SOCLIB_LIBDIR)                      \
     24#                                 $(OR1K_LIBDIR)                               
    2525
    26 LIBS                            = $(LIBRARY) -lm $(SYSTEMC_LIBNAME_$(SIMULATOR)) $(SOCLIB_LIBNAME) $(OR1K_LIBNAME) -lbfd  -ldl
     26LIBS                            = $(LIBRARY) -lm $(SYSTEMC_LIBNAME_$(SIMULATOR)) -ldl
     27
     28#                                 $(SOCLIB_LIBNAME) $(OR1K_LIBNAME) -lbfd 
    2729
    2830FLAGS_COMMON                    = $(SYSTEMC_CFLAGS_$(SIMULATOR))        \
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Selftest

    r53 r62  
    4747config                          : $(DIR_CFG_GEN)
    4848                                @\
    49                                 $(ECHO) "Generate configuration";\
     49                                $(ECHO) "Generate configuration";                                                                       \
    5050                                declare -i  CPT=0;                                                                                      \
    5151                                declare     files;                                                                                      \
     
    160160                                        *.pos                   \
    161161                                        *.stat                  \
     162                                        *.dot                   \
     163                                        *.txt                   \
    162164                                        generated_by_systemcass \
    163165                                        core*;
     
    178180help                            :
    179181                                @\
    180                                 $(MAKE) common_help  ;\
     182                                $(MAKE) common_help  ; \
    181183                                $(MAKE) synthesis_help;\ 
    182184                                $(MAKE) selftest_help;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Synthesis

    r53 r62  
    2222                                  $(patsubst $(DIR_CFG_USER)/%.cfg,$(DIR_LOG)/%.fpga.log,$(wildcard $(DIR_CFG_USER)/*.cfg))
    2323#-----[ Rules ]--------------------------------------------
    24 .PRECIOUS                       : $(DIR_LOG)/%.vhdl.log $(DIR_LOG)/%.vhdl_sim.log
     24.PRECIOUS                       : $(DIR_LOG)/%.vhdl.log $(DIR_LOG)/%.sim.log
    2525
    2626vhdl                            : execute $(DIR_WORK)
     
    3636                                if $(TEST) $${#log_files[*]} -ne 0; then $(MAKE) $${log_files[*]/#$(DIR_VHDL)/$(DIR_LOG)}; fi;
    3737
    38 vhdl_sim                        : vhdl
     38sim                             : vhdl
    3939                                @\
    4040                                declare -a vhdl_files=($$($(LS) $(DIR_VHDL)/*_Testbench.vhdl));                                         \
    41                                 declare -a log_files=($${vhdl_files[*]/%.vhdl/.vhdl_sim.log});                                          \
     41                                declare -a log_files=($${vhdl_files[*]/%.vhdl/.sim.log});                                               \
    4242                                if $(TEST) $${#log_files[*]} -ne 0; then $(MAKE) $${log_files[*]/#$(DIR_VHDL)/$(DIR_LOG)}; fi;
    4343
    44 fpga                            : vhdl_sim
     44fpga                            : sim
    4545                                @\
    4646                                $(ECHO) -e "" > $(FPGA_CFG_FILE_LOCAL); \
     
    5454                                        $(ECHO) -e ""                                     >> $(FPGA_CFG_FILE_LOCAL);                    \
    5555                                done;                                   \
    56                                 ($(XILINX_ENV); $(CD) $(FPGA_CFG_FILE_GLOBAL_DIR); ./$(FPGA_CFG_FILE_GLOBAL));                          \
     56                                ($(XILINX_ENV); $(CD) $(FPGA_CFG_FILE_GLOBAL_DIR); $(FPGA_CFG_FILE_GLOBAL));                            \
    5757                                $(MAKE) $(FPGA_LOG_FILES);
    5858
     
    6767                                $(MODELTECH_VLIB) $@;
    6868
    69 $(DIR_LOG)/%.vhdl_sim.log       : $(DIR_VHDL)/%.vhdl $(DIR_LOG)/%.vhdl.log
     69$(DIR_LOG)/%.sim.log            : $(DIR_VHDL)/%.vhdl $(DIR_LOG)/%.vhdl.log
    7070                                @\
    7171                                $(ECHO) "VHDL's Simulation  : $*"; \
     
    9292                                $(ECHO) "";\
    9393                                $(ECHO) " * vhdl                 : compile all vhdl's file";\
    94                                 $(ECHO) " * vhdl_sim             : simulate all testbench's file";\
     94                                $(ECHO) " * sim                  : simulate all testbench's file";\
    9595                                $(ECHO) " * fpga                 : synthetis with fpga's tools";\
    9696                                $(ECHO) "";
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.flags

    r57 r62  
    22# $Id$
    33#
    4 # [ Description ]
     4# [ Description ]
    55#
    66
    7 #-----[ Simulator ]----------------------------------------
     7#-----[ Simulator ]----------------------------------------
    88SIMULATOR                       = systemcass_deps
    99
    10 # 3 simulators :
    11 # systemc                       - SystemC   
     10# 3 simulators :
     11# systemc                       - SystemC   
    1212# systemcass                    - SystemCASS
    1313# systemcass_deps               - Systemcass, and use port dependency information instead of sensitivity list
    1414
    15 #-----[ Flags ]--------------------------------------------
     15#-----[ Flags ]--------------------------------------------
    1616MORPHEO_FLAGS                   =       -DSYSTEMC               \
    17                                         -DVHDL                  \
    18                                         -DVHDL_TESTBENCH        \
    19                                         -DVHDL_TESTBENCH_ASSERT \
    20                                         -DSTATISTICS            \
    21                                         -DDEBUG=DEBUG_TRACE
     17                                        -DDEBUG=DEBUG_TRACE     
    2218
    23 
     19#                                       -DVHDL                  \
     20#                                       -DVHDL_TESTBENCH        \
     21#                                       -DVHDL_TESTBENCH_ASSERT \
     22#
     23#                                       -DSTATISTICS            \
    2424#                                       -DCONFIGURATION         \
    2525#                                       -DPOSITION              \
     
    2828# DEBUG={level}                        - Print Debug Message
    2929# SYSTEMC                              - To generate a systemc's model
    30 # VHDL                                 - To generate a vhdl's    models
     30# VHDL                                 - To generate a vhdl's    models
    3131# VHDL_TESTBENCH        (need SYSTEMC) - In the simulation, generate two testbench's file (input and ouput) to validate the vhdl's model
    3232# VHDL_TESTBENCH_ASSERT (need SYSTEMC) - In the simulation, generate in  testbench's file an serie of assert
    33 # STATISTICS            (need SYSTEMC) - In the simulation, generate a statistics's file
    34 # POSITION                             - To generate a position's files     (it's input of viewer)
     33# STATISTICS            (need SYSTEMC) - In the simulation, generate a statistics's file
     34# POSITION                             - To generate a position's files     (it's input of viewer)
    3535# CONFIGURATION                        - To generate a configuration's file (it's input of viewer and generator)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.mkf

    r57 r62  
    33#
    44
    5 all: _Generic/RegisterFile/RegisterFile_Monolithic/SelfTest _Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest _Generic/Select/Select_Priority_Fixed/SelfTest
     5all: _Generic/RegisterFile/RegisterFile_Monolithic/SelfTest _Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest _Generic/Select/Select_Priority_Fixed/SelfTest _Generic/RegisterFile/RegisterFile_Monolithic/SelfTest _Core/Multi_Execute_loop/Execute_loop/Register_unit/Register_unit_Glue/SelfTest
    66
    77_Generic/RegisterFile/RegisterFile_Monolithic/SelfTest:
    8         gmake all -C Generic/RegisterFile/RegisterFile_Monolithic/SelfTest
     8        make all -C Generic/RegisterFile/RegisterFile_Monolithic/SelfTest
    99
    1010_Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest:
    11         gmake all -C Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest
     11        make all -C Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest
    1212
    1313_Generic/Select/Select_Priority_Fixed/SelfTest:
    14         gmake all -C Generic/Select/Select_Priority_Fixed/SelfTest
     14        make all -C Generic/Select/Select_Priority_Fixed/SelfTest
     15
     16_Core/Multi_Execute_loop/Execute_loop/Register_unit/Register_unit_Glue/SelfTest:
     17        make all -C Core/Multi_Execute_loop/Execute_loop/Register_unit/Register_unit_Glue/SelfTest
    1518
    1619clean:
    17         gmake clean -C Generic/RegisterFile/RegisterFile_Monolithic/SelfTest
    18         gmake clean -C Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest
    19         gmake clean -C Generic/Select/Select_Priority_Fixed/SelfTest
     20        make clean -C Generic/RegisterFile/RegisterFile_Monolithic/SelfTest
     21        make clean -C Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest
     22        make clean -C Generic/Select/Select_Priority_Fixed/SelfTest
     23        make clean -C Core/Multi_Execute_loop/Execute_loop/Register_unit/Register_unit_Glue/SelfTest
    2024
    2125re: clean all
    2226
    2327install:
    24         gmake install -C Generic/RegisterFile/RegisterFile_Monolithic/SelfTest
    25         gmake install -C Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest
    26         gmake install -C Generic/Select/Select_Priority_Fixed/SelfTest
     28        make install -C Generic/RegisterFile/RegisterFile_Monolithic/SelfTest
     29        make install -C Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest
     30        make install -C Generic/Select/Select_Priority_Fixed/SelfTest
     31        make install -C Core/Multi_Execute_loop/Execute_loop/Register_unit/Register_unit_Glue/SelfTest
    2732
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/Makefile.deps

    r53 r62  
    2121                                        $(Behavioural_DIR_LIBRARY)
    2222
     23@COMPONENT_DEPENDENCIES         =       Behavioural_library
     24
     25@COMPONENT_CLEAN                =       Behavioural_library_clean
     26
    2327#-----[ Rules ]--------------------------------------------
    2428
    25 @COMPONENT_library              :
     29.NOTPARALLEL                    : @COMPONENT_library @COMPONENT_library_clean
     30
     31@COMPONENT_library              : $(@COMPONENT_DEPENDENCIES)
    2632                                @\
    27                                 $(MAKE) Behavioural_library; \
    2833                                $(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/@DIRECTORY --makefile=Makefile;
    29        
    30 @COMPONENT_library_clean        :
     34
     35@COMPONENT_library_clean        : $(@COMPONENT_CLEAN)
    3136                                @\
    32                                 $(MAKE) Behavioural_library_clean; \
    3337                                $(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/@DIRECTORY --makefile=Makefile clean;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/SelfTest/src/main.cpp

    r55 r62  
    3434    usage (argc, argv);
    3535
    36   const string   name      = argv[1];
    37 //const uint32_t size_data = atoi(argv[2]);
    38 //const uint32_t nb_port   = atoi(argv[3]);
     36  uint32_t       x = 1;
     37
     38  const string   name      =      argv[x++];
     39//const uint32_t size_data = atoi(argv[x++]);
     40//const uint32_t nb_port   = atoi(argv[x++]);
    3941
    4042  try
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Component.h

    r57 r62  
    3838  {
    3939    public : Tinstance_t _instance;
    40     public : Entity         * _entity  ;
     40    public : Entity    * _entity  ;
    4141  } Tcomponent_t;   
    4242 
     
    7474
    7575  private   : Entity *              find_entity       (string name);
    76   private   : Interface *           find_interface    (string   name  ,
    77                                                        Entity * entity);
     76//private   : Interface *           find_interface    (string   name  ,
     77//                                                     Entity * entity);
    7878
    7979#ifdef VHDL
     
    8181#endif
    8282
     83
     84  private   : Signal *              signal_internal   (Entity * entity_productor,
     85                                                       Signal * signal_productor);
     86
    8387  public    : void                  port_map          (string component_src ,
    8488                                                       string port_src      ,
    8589                                                       string component_dest,
    8690                                                       string port_dest    );
     91  public    : void                  port_map          (string component_src ,
     92                                                       string port_src      );
     93
     94  public    : bool                  test_map          (void);
    8795
    8896#ifdef POSITION
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Constants.h

    r59 r62  
    131131#define EXCEPTION_MEMORY_BUS_ERROR               0x4  // Access at a invalid physical address
    132132#define EXCEPTION_MEMORY_MISS_SPECULATION        0x5  // Load miss speculation
     133
     134  //==================================================[ dcache_type ]=====
     135#  define DCACHE_LOAD                    0x0      // 0000
     136#  define DCACHE_LOCK                    0x1      // 0001
     137#  define DCACHE_INVALIDATE              0x2      // 0010
     138#  define DCACHE_PREFETCH                0x3      // 0011
     139//#define DCACHE_                        0x4      // 0100
     140//#define DCACHE_                        0x5      // 0101
     141#  define DCACHE_FLUSH                   0x6      // 0110
     142#  define DCACHE_SYNCHRONIZATION         0x7      // 0111
     143
     144#  define DCACHE_STORE_8                 0x8      // 1000
     145#  define DCACHE_STORE_16                0x9      // 1001
     146#  define DCACHE_STORE_32                0xa      // 1010
     147#  define DCACHE_STORE_64                0xb      // 1011
     148//#define DCACHE_                        0xc      // 1100
     149//#define DCACHE_                        0xd      // 1101
     150//#define DCACHE_                        0xe      // 1110
     151//#define DCACHE_                        0xf      // 1111
     152
     153
     154// just take the 4 less significative bits.
     155#define operation_to_dcache_type(x) (x&0xf)
    133156
    134157  /*
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h

    r56 r62  
    2525#define             DEBUG_Read_queue                              false
    2626#define             DEBUG_Reservation_station                     false
     27#define         DEBUG_Register_unit                               true
     28#define           DEBUG_Register_unit_Glue                        false
    2729#define     DEBUG_Multi_Front_end                                 false
    2830#define       DEBUG_Front_end                                     false
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Entity.h

    r57 r62  
    8080#endif
    8181
     82  public    : bool                  test_map          (bool top_level);
     83
    8284#ifdef POSITION
    8385  public    : XML                   toXML             (void);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface.h

    r57 r62  
    2222#include "Behavioural/include/Vhdl.h"
    2323#endif
     24#include "Common/include/ChangeCase.h"
    2425#include "Common/include/ToString.h"
    2526#include "Common/include/ErrorMorpheo.h"
     
    230231#endif
    231232
     233  public    : bool                  test_map             (bool top_level);
     234
    232235#ifdef POSITION
    233236  public    : void                  interface_map        (void * entity,
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interfaces.h

    r57 r62  
    8080  public    : XML                   toXML_mapping         (void);
    8181#endif
     82
     83  public    : bool                  test_map              (bool top_level);
     84
    8285  public    : friend ostream&       operator<<            (ostream& output_stream,
    8386                                                           morpheo::behavioural::Interfaces & x);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters.h

    r59 r62  
    1515#include "Common/include/ErrorMorpheo.h"
    1616#include "Common/include/ToString.h"
     17#include "Common/include/Log2.h"
    1718#include "Common/include/Debug.h"
    1819
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h

    r59 r62  
    5353
    5454    // -----[ fields ]----------------------------------------------------
    55   private   : const string          _name         ;
    56   private   : const direction_t     _direction    ;
    57   private   : const uint32_t        _size         ;
    58   private   : const presence_port_t _presence_port;
     55  private   : const string          _name          ;
     56  private   : const direction_t     _direction     ;
     57  private   : const uint32_t        _size          ;
     58  private   : const presence_port_t _presence_port ;
    5959
    6060  private   : Signal *              _connect_to_signal;   // the actual implementaion, this signal link with one signal (but if signal is an output, it can be connect with many signal ...)
    6161  private   : Signal *              _connect_from_signal; // producter of signal. If NULL, then producteur is the current entity
    62   private   : bool                  _is_allocate  ; // Have allocate a sc_in or sc_out port
    63   private   : void *                _sc_signal    ; // sc_in or sc_out associated at this signal
    64   private   : bool                  _is_map       ;
    65   private   : void *                _sc_signal_map; // sc_out generated this signal
    66   private   : type_info_t           _type_info    ;
     62  private   : bool                  _is_allocate   ; // Have allocate a sc_in or sc_out port
     63  private   : void *                _sc_signal     ; // sc_in or sc_out associated at this signal
     64  private   : void *                _sc_signal_map ; // sc_out generated this signal
     65  private   : bool                  _is_map_as_src ;
     66  private   : bool                  _is_map_as_dest;
     67  private   : type_info_t           _type_info     ;
    6768
    6869#ifdef VHDL_TESTBENCH
    69   private   : list<string>        * _list_value   ;
     70  private   : list<string>        * _list_value    ;
    7071#endif
    7172
     
    7879  public    :                   ~Signal         ();
    7980
    80   public    : string            get_name        (void);
    81   public    : uint32_t          get_size        (void);
    82   public    : bool              get_is_map      (void);
    83   public    : Signal *          get_connect_to_signal (void);
     81  public    : string            get_name                (void);
     82  public    : uint32_t          get_size                (void);
     83  public    : Signal *          get_connect_to_signal   (void);
    8484  public    : Signal *          get_connect_from_signal (void);
    85   public    : direction_t       get_direction   (void);
    86 
    87   public    : bool              presence_vhdl      (void);
    88   public    : bool              presence_testbench (void);
    89 
    90 //   public    : void              mapping         (Signal * signal);
    91   public    : void              link            (Signal * signal  ,
    92                                                  bool     is_port_component);
     85  public    : direction_t       get_direction           (void);
     86  public    : type_info_t       get_type_info           (void);
     87
     88  public    : bool              presence_vhdl           (void);
     89  public    : bool              presence_testbench      (void);
     90
     91  public    : bool              test_map                (bool top_level);
     92
     93  public    : void              link                    (Signal * signal_dest,
     94                                                         bool     signal_dest_is_port);
     95
     96  public    : void              connect                 (Signal * signal_dest);
    9397
    9498#ifdef SYSTEMC         
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/mkf.info

    r57 r62  
    1818target_dep              all             Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest
    1919target_dep              all             Generic/Select/Select_Priority_Fixed/SelfTest
    20 
     20target_dep              all             Generic/RegisterFile/RegisterFile_Monolithic/SelfTest
     21target_dep              all             Core/Multi_Execute_loop/Execute_loop/Register_unit/Register_unit_Glue/SelfTest
    2122# mkf include path
    2223var_define              _mkf_path       include_mkf
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_port_map.cpp

    r44 r62  
    5151               ,signal_dest->get_name().c_str());
    5252
    53     signal_src ->link   (signal_dest, entity_dest == _entity);
    54     //signal_dest->mapping(signal_src );
     53    // need an internal signal ?
     54    bool src_is_port  = entity_src  == _entity;
     55    bool dest_is_port = entity_dest == _entity;
     56
     57    if (src_is_port == true)
     58      throw (ErrorMorpheo ("<Component::port_map> src can't be an interface's port of the top level."));
    5559   
     60    // 2 cases :
     61    //  a) dest is a top level port -> direct connection
     62    //  b) dest is a component port -> need internal signal
     63    if (dest_is_port == false)
     64      {
     65        // 1) find productor of signal
     66        //       
     67        // Interface      Component
     68        //    |          |         
     69        //  ----> (IN)     --X-> (IN)
     70        //    |          |         
     71        //  <-X-- (OUT)    <---- (OUT)
     72        //    |              |       
     73       
     74        Signal * signal_productor;
     75        Entity * entity_productor;
     76
     77        bool     src_is_productor = (signal_src->get_direction() == OUT);
     78
     79        if (src_is_productor == true)
     80          {
     81            signal_productor = signal_src;
     82            entity_productor = entity_src;
     83          }
     84        else
     85          {
     86            signal_productor = signal_dest;
     87            entity_productor = entity_dest;
     88          }
     89
     90        signal_dest  = signal_internal (entity_productor, signal_productor);
     91        dest_is_port = false;
     92      }
     93   
     94    try
     95      {
     96        signal_src->link(signal_dest,
     97                         dest_is_port);
     98      }
     99    catch (morpheo::ErrorMorpheo & error)
     100      {
     101        throw (ErrorMorpheo ("<Component::port_map> Error in mapping between "+entity_src ->get_name()+"."+signal_src ->get_name()+" and "+entity_dest->get_name()+"."+signal_dest->get_name()+" :\n"+error.what ()));
     102      }
     103    //catch (...)
     104    //  {
     105    //  }
     106
     107    log_printf(FUNC,Behavioural,FUNCTION,"End");
     108  };
     109
     110
     111  void Component::port_map (string component_src ,
     112                            string port_src      )
     113  {
     114    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
     115   
     116    Entity * entity_src = find_entity(component_src);
     117   
     118    if (entity_src == NULL)
     119      throw (ErrorMorpheo ("<Component::port_map> in component \""+_entity->get_name()+"\", port map with unknow component \""+component_src+"\"."));
     120   
     121    Signal * signal_src = entity_src->find_signal (port_src);
     122   
     123    if (signal_src == NULL)
     124      throw (ErrorMorpheo ("<Component::port_map> in component \""+_entity->get_name()+"\", port map with component \""+component_src+"\" and a unknow signal \""+port_src+"\"."));
     125   
     126    // need an internal signal ?
     127   
     128    if (entity_src == _entity)
     129      throw (ErrorMorpheo ("<Component::port_map> src can't be an interface's port of the top level."));
     130   
     131    if (signal_src->get_direction() != OUT)
     132      throw (ErrorMorpheo ("<Component::port_map> the direction of the signal '"+signal_src->get_name()+"' must be OUT."));
     133   
     134    try
     135      {
     136        signal_src->link(signal_internal (entity_src, signal_src),
     137                         false);
     138      }
     139    catch (morpheo::ErrorMorpheo & error)
     140      {
     141        throw (ErrorMorpheo ("<Component::port_map> Error in mapping "+entity_src ->get_name()+"."+signal_src ->get_name()+" :\n"+error.what ()));
     142      }
     143    //catch (...)
     144    //  {
     145    //  }
     146
    56147    log_printf(FUNC,Behavioural,FUNCTION,"End");
    57148  };
     
    59150}; // end namespace behavioural         
    60151}; // end namespace morpheo             
     152
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo_testbench_test.cpp

    r42 r62  
    6666            while (i != _list_cycle->end())
    6767              {
    68                 vhdl->set_body("assert not ( ("+counter_name+" = "+toString(*i)+")) report \"***** <"+_name+"> interface's test number "+toString(j)+" *****\" severity NOTE;");
     68                vhdl->set_body("assert not (("+counter_name+" = "+toString(*i)+" and "+test_name+" = '1')) report \"***** <"+_name+"> Test number "+toString(j)+" is OK     *****\" severity NOTE;");
     69                vhdl->set_body("assert not (("+counter_name+" = "+toString(*i)+" and "+test_name+" = '0')) report \"@@@@@ <"+_name+"> Test number "+toString(j)+" is KO !!! @@@@@\" severity NOTE;");
    6970                j++;
    7071                ++i;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_signal_name.cpp

    r44 r62  
    77
    88#include "Behavioural/include/Interface.h"
    9 #include "Common/include/ChangeCase.h"
    109
    1110namespace morpheo              {
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal.cpp

    r44 r62  
    2222    log_printf(FUNC,Behavioural,"Signal","Begin");
    2323    _is_allocate   = false;
    24     _is_map        = false;
     24    _is_map_as_src = false;
     25    _is_map_as_dest= false;
    2526    _connect_from_signal = NULL;
    2627    _connect_to_signal   = NULL;
     
    4142  {
    4243    log_printf(FUNC,Behavioural,"Signal (copy)","Begin");
    43     _is_allocate= signal._is_allocate;
    44     _is_map     = signal._is_map    ;
     44    _is_allocate    = signal._is_allocate;
     45    _is_map_as_src  = signal._is_map_as_src ;
     46    _is_map_as_dest = signal._is_map_as_dest;
    4547    _connect_from_signal = signal._connect_from_signal;
    4648    _connect_to_signal   = signal._connect_to_signal;
    47     _sc_signal     = signal._sc_signal    ;
    48     _sc_signal_map = signal._sc_signal_map;
    49     _type_info  = signal._type_info ;
     49    _sc_signal      = signal._sc_signal    ;
     50    _sc_signal_map  = signal._sc_signal_map;
     51    _type_info      = signal._type_info ;
    5052#ifdef VHDL_TESTBENCH
    51     _list_value = signal._list_value;
     53    _list_value     = signal._list_value;
    5254#endif
    5355    log_printf(FUNC,Behavioural,"Signal (copy)","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_link.cpp

    r44 r62  
    1414#undef  FUNCTION
    1515#define FUNCTION "Signal::link"
    16   void Signal::link (Signal * signal,
    17                      bool     is_port_component)
     16  void Signal::link (Signal * signal_dest,
     17                     bool     signal_dest_is_port)
    1818  {
    1919    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    2020
    21     if (        _is_allocate == false)
    22       throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\", can't map with signal \""+        get_name()+"\", because it's not already allocate."));
    23     if (signal->_is_allocate == false)
    24       throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\", can't map with signal \""+signal->get_name()+"\", because it's not already allocate."));
    25     if (_is_map == true)
    26       throw (ErrorMorpheo ("<Signal::mapping> Can't mapping signal \""+_name+"\" with \""+signal->get_name()+"\", because it's already map."));
    27    
     21    Signal * signal_src = this;
     22
     23    // Test
     24    if (signal_src ->_is_allocate == false)
     25      throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\", can't map with signal \""+        get_name()+"\", because the first signal is not already allocate."));
     26    if (signal_dest->_is_allocate == false)
     27      throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\", can't map with signal \""+signal_dest->get_name()+"\", because the second signal is not already allocate."));
     28    if (signal_src ->_is_map_as_src  == true)
     29      throw (ErrorMorpheo ("<Signal::mapping> Can't mapping signal \""+_name+"\" with \""+signal_dest->get_name()+"\", because the first signal is already mapped."));
     30
     31    //     log_printf(TRACE,Behavioural,FUNCTION, " * sc_signal (before) %.8x - %.8x", (uint32_t)(_sc_signal_map), (uint32_t)(signal_dest->_sc_signal_map));
    2832
    2933    // List of all case
    3034    //
    31     //       dest        src             dest        src
    32     // PORT {IN } ----- {SIG} COMBI
    33     // PORT {OUT} ----- {SIG} COMBI
     35    //            src         dest
     36    // COMPONENT {IN } ----- {SIG} SIGNAL
     37    // COMPONENT {OUT} ----- {SIG} SIGNAL
    3438    //
    35     // PORT {IN } --X-- {OUT} COMPONENT {IN } ----- {OUT} COMPONENT
    36     // PORT {IN } ----- {IN } COMPONENT {IN } --X-- {IN } COMPONENT
    37     // PORT {OUT} ----- {OUT} COMPONENT {OUT} --X-- {OUT} COMPONENT
    38     // PORT {OUT} --X-- {IN } COMPONENT {OUT} ----- {IN } COMPONENT
     39    // COMPONENT {IN } ----- {IN } PORT
     40    // COMPONENT {OUT} ----- {OUT} PORT
    3941
    40 //  log_printf(TRACE,Behavioural,FUNCTION, "Signal \"%s\"\tlink with \"%s\"", _name.c_str(), signal->get_name().c_str());
     42    // list valid case
     43    if (not (    signal_dest_is_port and (((signal_src->_direction == IN ) and (signal_dest->_direction == IN      )) or
     44                                          ((signal_src->_direction == OUT) and (signal_dest->_direction == OUT     )))) and
     45        not (not signal_dest_is_port and (((signal_src->_direction == IN ) and (signal_dest->_direction == INTERNAL)) or
     46                                          ((signal_src->_direction == OUT) and (signal_dest->_direction == INTERNAL)))))
     47      throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" can't been linked with signal \""+signal_dest->get_name()+"\" : illegal direction ("+toString(signal_src->_direction)+" with "+toString(signal_dest->_direction)+")."));
    4148
    42     log_printf(TRACE,Behavioural,FUNCTION, " * sc_signal (before) %.8x - %.8x", (uint32_t)(_sc_signal_map), (uint32_t)(signal->_sc_signal_map));
     49    // update info source
     50    signal_src ->_connect_to_signal   = signal_dest;
     51    signal_src ->_is_map_as_src       = true;
     52   
     53    // update info destination
     54    signal_dest->_connect_from_signal = signal_src;
     55    signal_dest->_is_map_as_dest      = true;
    4356
    44     _connect_to_signal = signal;
    45     signal->_connect_from_signal = this;
     57    // vhdl_testbench : to read an output producte by a internal component
     58    // TODO : à vérifier !!!!!!!!!!!!
     59    if ((signal_dest_is_port == true) and
     60        (signal_src ->_direction == OUT))
     61      signal_dest->_sc_signal_map = signal_src ->_sc_signal_map;
     62   
     63    connect (signal_dest);
    4664
    47     if (is_port_component == true)
    48       {
    49         if ((_direction == IN ) and (signal->_direction == IN ))
    50           {
    51             switch (_type_info)
    52               {
    53               case BOOL     : {(*(static_cast<sc_in  <bool    > *>(_sc_signal))) (*(static_cast<sc_in  <bool    > *>(signal->_sc_signal))); break;}
    54               case UINT8_T  : {(*(static_cast<sc_in  <uint8_t > *>(_sc_signal))) (*(static_cast<sc_in  <uint8_t > *>(signal->_sc_signal))); break;}
    55               case UINT16_T : {(*(static_cast<sc_in  <uint16_t> *>(_sc_signal))) (*(static_cast<sc_in  <uint16_t> *>(signal->_sc_signal))); break;}
    56               case UINT32_T : {(*(static_cast<sc_in  <uint32_t> *>(_sc_signal))) (*(static_cast<sc_in  <uint32_t> *>(signal->_sc_signal))); break;}
    57               case UINT64_T : {(*(static_cast<sc_in  <uint64_t> *>(_sc_signal))) (*(static_cast<sc_in  <uint64_t> *>(signal->_sc_signal))); break;}
    58               default       : {throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" : type unknow.")); break;}
    59               }
    60           }
    61         else
    62           {
    63             if ((_direction == OUT) and (signal->_direction == OUT))
    64               {
    65                 _is_map = true;
    66                 signal->_sc_signal_map = _sc_signal_map;
    67                
    68                 switch (_type_info)
    69                   {
    70                   case BOOL     : {(*(static_cast<sc_out <bool    > *>(_sc_signal))) (*(static_cast<sc_out <bool    > *>(signal->_sc_signal))); break;}
    71                   case UINT8_T  : {(*(static_cast<sc_out <uint8_t > *>(_sc_signal))) (*(static_cast<sc_out <uint8_t > *>(signal->_sc_signal))); break;}
    72                   case UINT16_T : {(*(static_cast<sc_out <uint16_t> *>(_sc_signal))) (*(static_cast<sc_out <uint16_t> *>(signal->_sc_signal))); break;}
    73                   case UINT32_T : {(*(static_cast<sc_out <uint32_t> *>(_sc_signal))) (*(static_cast<sc_out <uint32_t> *>(signal->_sc_signal))); break;}
    74                   case UINT64_T : {(*(static_cast<sc_out <uint64_t> *>(_sc_signal))) (*(static_cast<sc_out <uint64_t> *>(signal->_sc_signal))); break;}
    75                   default       : {throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" : type unknow.")); break;}
    76                   }
    77               }
    78             else
    79               {
    80                 throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" can't been linked with signal \""+signal->get_name()+"\" : between two components, illegal direction ("+toString(_direction)+" with "+toString(signal->_direction)+")."));
    81               }
    82           }
    83       }
    84     else
    85       {
    86         if ((_direction == IN ) and (signal->_direction == OUT))
    87           {
    88             switch (_type_info)
    89               {
    90               case BOOL     : {(*(static_cast<sc_in  <bool    > *>(_sc_signal))) (*(static_cast<sc_out <bool    > *>(signal->_sc_signal))); break;}
    91               case UINT8_T  : {(*(static_cast<sc_in  <uint8_t > *>(_sc_signal))) (*(static_cast<sc_out <uint8_t > *>(signal->_sc_signal))); break;}
    92               case UINT16_T : {(*(static_cast<sc_in  <uint16_t> *>(_sc_signal))) (*(static_cast<sc_out <uint16_t> *>(signal->_sc_signal))); break;}
    93               case UINT32_T : {(*(static_cast<sc_in  <uint32_t> *>(_sc_signal))) (*(static_cast<sc_out <uint32_t> *>(signal->_sc_signal))); break;}
    94               case UINT64_T : {(*(static_cast<sc_in  <uint64_t> *>(_sc_signal))) (*(static_cast<sc_out <uint64_t> *>(signal->_sc_signal))); break;}
    95               default       : {throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" : type unknow.")); break;}
    96               }
    97           }
    98         else
    99           {
    100             if ((_direction == OUT) and (signal->_direction == IN ))
    101               {
    102                 _is_map = true;
    103                 switch (_type_info)
    104                   {
    105                   case BOOL     : {(*(static_cast<sc_out <bool    > *>(_sc_signal))) (*(static_cast<sc_in  <bool    > *>(signal->_sc_signal))); break;}
    106                   case UINT8_T  : {(*(static_cast<sc_out <uint8_t > *>(_sc_signal))) (*(static_cast<sc_in  <uint8_t > *>(signal->_sc_signal))); break;}
    107                   case UINT16_T : {(*(static_cast<sc_out <uint16_t> *>(_sc_signal))) (*(static_cast<sc_in  <uint16_t> *>(signal->_sc_signal))); break;}
    108                   case UINT32_T : {(*(static_cast<sc_out <uint32_t> *>(_sc_signal))) (*(static_cast<sc_in  <uint32_t> *>(signal->_sc_signal))); break;}
    109                   case UINT64_T : {(*(static_cast<sc_out <uint64_t> *>(_sc_signal))) (*(static_cast<sc_in  <uint64_t> *>(signal->_sc_signal))); break;}
    110                   default       : {throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" : type unknow.")); break;}
    111                   }
    112               }
    113             else
    114               {
    115                 throw (ErrorMorpheo ("<Signal::link> Signal \""+_name+"\" can't been linked with signal \""+signal->get_name()+"\" : between a interface's port and one component, illegal direction ("+toString(_direction)+" with "+toString(signal->_direction)+")."));
    116               }
    117           }
    118       }
    119 
    120     log_printf(TRACE,Behavioural,FUNCTION, " * sc_signal (after ) %.8x - %.8x", (uint32_t)(_sc_signal_map), (uint32_t)(signal->_sc_signal_map));
     65    //  log_printf(TRACE,Behavioural,FUNCTION, " * sc_signal (after ) %.8x - %.8x", (uint32_t)(_sc_signal_map), (uint32_t)(signal_dest->_sc_signal_map));
     66   
    12167    log_printf(FUNC,Behavioural,FUNCTION,"End");
    12268  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_print.cpp

    r42 r62  
    1919    output_stream << "\t{" << x._size << "}\t"
    2020                  << toString(x._direction)    << "\t"
    21                   << toString(x._presence_port);
     21                  << toString(x._presence_port)
     22                  << "sc_signal : " << hex << x._sc_signal << " - " << x._sc_signal_map << dec;
    2223
    2324    log_printf(FUNC,Behavioural,"operator<<","End");
Note: See TracChangeset for help on using the changeset viewer.