Ignore:
Timestamp:
Dec 10, 2008, 7:31:39 PM (16 years ago)
Author:
rosiere
Message:

Almost complete design
with Test and test platform

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/Environment/src/Environment_transition.cpp

    r81 r88  
    11#include "../include/Environment.h"
     2
     3using namespace morpheo;
    24
    35namespace environment {
     
    4345                Ticache_context_t context   = ICACHE_REQ_CONTEXT_ID [i][j]->read();// TODO : test presence
    4446                Ticache_packet_t  packet    = ICACHE_REQ_PACKET_ID  [i][j]->read();// TODO : test presence
    45                 Ticache_address_t address   = ICACHE_REQ_ADDRESS    [i][j]->read();
     47                Ticache_address_t address   = ICACHE_REQ_ADDRESS    [i][j]->read()<<2;
    4648                Ticache_type_t    type      = ICACHE_REQ_TYPE       [i][j]->read();
    47                 uint32_t          size      = param->iaccess_size_address [i]/8;
     49                uint32_t          size      = (param->iaccess_size_address [i]+2)/8;
    4850
    4951                _cout(ENVIRONMENT," * information\n");
     
    6769                    (entity.segment->getType() == data::TYPE_TARGET_MEMORY))
    6870                  {
    69                     _cout(ENVIRONMENT, " * OK !\n");
     71                    _cout(ENVIRONMENT," * OK !\n");
    7072                    bus_error = false;
    7173                    uncached  = entity.segment->getUncached();
     
    7375                    if (must_read == true) // Test if must read the ram
    7476                      {
    75                         _cout(ENVIRONMENT, "   * must read\n");
     77                        _cout(ENVIRONMENT,"   * must read\n");
    7678                        // Read all instruction
    7779                        for (unsigned int k=0; k<param->iaccess_nb_instruction[i]; k++)
    7880                          {
    7981                            uint32_t addr = address+k*(size);
    80                             _cout(ENVIRONMENT, "   * addr : %.8x\n",addr);
     82                            _cout(ENVIRONMENT,"   * addr    : %.8x\n",addr);
    8183
    8284                            bus_error |= !component_data->read(addr,size,read_iram[k]);
     
    8486                            // Swap if endienness is different
    8587                            if (endianness::isSameEndianness(context) == false)
    86                               read_iram[k] = endianness::swapBytes(read_iram[k],size,size);
     88                              {
     89                                read_iram[k] = endianness::swapBytes(read_iram[k],size,size);
     90                              }
     91
     92                            _cout(ENVIRONMENT,"   * inst    :");
     93                            for (int32_t cpt=(param->iaccess_size_instruction[context]/8)-1; cpt>=0; --cpt)
     94                              _cout(ENVIRONMENT, "%.2x",0xff&static_cast<uint32_t>(read_iram[k][cpt]));
     95                            _cout(ENVIRONMENT, "\n");
    8796                          }
    8897                      }
     
    241250                                       ,static_cast<uint32_t>((wdata>> 0)&0xff)
    242251                                       );
     252
     253                                stop (context);
    243254                           
    244 //                              if (context_stop [context] == false)
    245 //                                {
    246 //                                  context_stop [context] = true;
    247 //                                  nb_context_stop ++;
    248                                    
    249 //                                  if (nb_context_stop >= nb_context)
    250 //                                    sc_stop();
    251 //                                }
    252 
    253255                                break;
    254256                              }
     
    387389                                  {
    388390                                    // Decomposition en groupe octect
    389                                     Tdcache_data_t result = (Tdcache_data_t)(component_sim2os->result);
     391                                    Tdcache_data_t result = static_cast<Tdcache_data_t>(reinterpret_cast<uint64_t>(component_sim2os->result));
    390392                                    _cout(ENVIRONMENT,"<sim2os> result      : %x\n",result);
    391393                                   
     
    494496                    component_buffer_drsp [i]->push(latence,rsp);
    495497                  }
    496 
    497498              }
    498499        //=============================================================================
Note: See TracChangeset for help on using the changeset viewer.