Example #1
0
/**
 * Main routine of the mapping agent.
 */
void *agent_routine(void *data) {
    agent_t *agent = (agent_t*) data;
    assert(agent != NULL);

    while (1) {
        int i;

        // wait threads synchro
        for (i = 0; i < agent->nb_threads; i++) {
            orcc_semaphore_wait(agent->sync->sem_monitor);
        }

        print_orcc_trace(ORCC_VL_VERBOSE_1, "Remap the actors...");
        compute_workloads(agent->network);
        do_mapping(agent->network, agent->options, agent->mapping);
        apply_mapping(agent->mapping, agent->scheduler, agent->nb_threads);

        if(mapping_repetition == REMAP_ALWAYS) {
            reset_profiling(agent->network);
            resetMapping();
        } else {
            need_remap = FALSE;
            fpsPrintInit_mapping();
        }

        // wakeup all threads
        for (i = 0; i < agent->nb_threads; i++) {
            orcc_semaphore_set(agent->scheduler->schedulers[i]->sem_thread);
        }

    }

    return 0;
}
//--------------------------------------------------------------------------
static void idaapi add_mapping(TView *fields[], int)
{
  static const char form[] =
    "Add mapping\n"
    "\n"
    "<~F~rom:N:16:16::> (nonexisting address)\n"
    "<~T~o  :N:16:16::> (existing address)\n"
    "<~S~ize:N:16:16::>\n"
    "\n"
    "\n";
  static ea_t source;
  static ea_t target;
  asize_t size = default_mapping_size;
  while ( AskUsingForm_c(form, &source, &target, &size) )
  {
    if ( apply_mapping(source, source + size, target) )
    {
      close_form(fields, true);
      break;
    }
    else
    {
      warning("Can't add mapping!");
    }
  }
}
Example #3
0
void Nes_Mapper::load_state( mapper_state_t const& in )
{
	default_reset_state();
	read_state( in );
	apply_mapping();
}
Example #4
0
void Nes_Mapper::read_state( mapper_state_t const& in )
{
	memset( state, 0, state_size );
	in.read( state, state_size );
	apply_mapping();
}
Example #5
0
void Nes_Mapper::reset()
{
	default_reset_state();
	reset_state();
	apply_mapping();
}