Example #1
0
File: main.c Project: olivo/BP
void eval(void) 
{ int tmp ;
  int tmp___0 ;
//  int __VERIFIER_nondet_int(); 

  {
  {
  while (1) {
    while_11_continue: /* CIL Label */ ;
    if ((int )m_run_st == 0) {

    } else {
      if ((int )s_run_st == 0) {

      } else {
        goto while_11_break;
      }
    }
    if ((int )m_run_st == 0) {
      {
	tmp = __VERIFIER_nondet_int();
      }
      if (tmp) {
        {
        m_run_st = 1;
        m_run();
        }
      } else {

      }
    } else {

    }
    if ((int )s_run_st == 0) {
      {
	tmp___0 = __VERIFIER_nondet_int();
      }
      if (tmp___0) {
        {
        s_run_st = 1;
        s_run();
        }
      } else {

      }
    } else {

    }
  }
  while_11_break: /* CIL Label */ ;
  }

  return;
}
}
bool ExynosCameraPipeJpeg::m_mainThreadFunc(void)
{
    int ret = 0;

    ret = m_run();
    if (ret < 0) {
        if (ret == TIMED_OUT)
            return true;
        ALOGE("ERR(%s):m_run fail", __FUNCTION__);
        /* TODO: doing exception handling */
        return false;
    }

    /* one time */
    return m_checkThreadLoop();
}
Example #3
0
// build the network with the parameters given in param
Network::Network(void)
{
    success = true;
    n_of_rows = param.n_of_rows;
    n_of_cols = param.n_of_cols;
    n_of_ports = param.n_of_ports;
    n_of_extra_links = param.n_of_extra_links;
    topology = param.topology;
    n_of_switch_ports = param.n_of_switch_ports;
    n_of_vcs = param.n_of_vcs;

    Traffic_source::reset_id_base();
    Traffic_sink::reset_id_base();

    if (param.verbose)
        cout << "[I] Building network..." << endl;

    if (topology != mesh)
    {
        cerr << ERRO_ARCH_NOT_SUPPORTED;
        success = false;
        return;
    }

    if (param.verbose)
        cout << "[I] Creating routers..." << endl;

    Position pos;
    // Build all the routers and PEs in the network
    for (pos.x = 0; pos.x < param.n_of_cols; pos.x++)
    {
        for (pos.y = 0; pos.y < param.n_of_rows; pos.y++)
        {
            pRouter a_router = new Router(this, pos);
            routers.push_back(a_router);
        }
    }

    if (param.verbose)
        cout << "[I] Creating traffic sources/sinks..." << endl;

    // Build all the traffic sources/sinks in the network
    for (pos.x = 0; pos.x < param.n_of_cols; pos.x++)
    {
        for (pos.y = 0; pos.y < param.n_of_rows; pos.y++)
        {
            pTraffic_source a_source = new Traffic_source(pos,
                    param.source_buffer_size);
            pTraffic_sink a_sink =
                    new Traffic_sink(pos, param.sink_buffer_size);

            //CPU
            m_newnode(yyengine, "superH", 0, 0, 0, NULL, 0);
            //network interface 1 tx/rx queue,
            network_netnodenewifc(yyengine, yyengine->cp, 0, 0, 0, 0, 0, 0, 0,
                    0, (param.source_buffer_size * 8/sizeof(FlitPayload) - 1) * 8, 2, 2); //FIXME: how to set those parameters

            //set memory size
            m_sizemem(yyengine, yyengine->cp,0x9000000);
            //load the program
            load_srec(yyengine, yyengine->cp, "default.sr");
            m_run(yyengine, yyengine->cp, ""); //FIXME: add arguments to nodes


            a_source->state = yyengine->cp;
            a_sink->state = yyengine->cp;

            sources.push_back(a_source);
            sinks.push_back(a_sink);
        }
    }

    if (param.verbose)
        cout << "[I] Attaching traffic sources/sinks with routers..." << endl;
    // connect sources and sinks with the router
    for (pos.x = 0; pos.x < param.n_of_cols; pos.x++)
    {
        for (pos.y = 0; pos.y < param.n_of_rows; pos.y++)
        {
            pTraffic_source a_source = get_traffic_source(pos);
            pTraffic_sink a_sink = get_traffic_sink(pos);
            pRouter a_router = get_router(pos);
            pIn_port a_in_port = a_router->get_in_port(local);
            pOut_port a_out_port = a_router->get_out_port(local);
            connect(a_source, a_in_port);
            connect(a_out_port, a_sink);
        }
    }

    if (param.verbose)
        cout << "[I] Connecting routers with links..." << endl;
    // connect the port of each router to the corresponding output port
    // of its neighboring router
    for (pos.x = 0; pos.x < param.n_of_cols; pos.x++)
    {
        for (pos.y = 0; pos.y < param.n_of_rows; pos.y++)
        {
            pRouter src_router = get_router(pos);
            for (unsigned int i = 0; i < n_of_ports - n_of_extra_links; i++)
            {
                Direction dir = (Direction) i;
                if (dir == local) // no go for local router
                    continue;
                pRouter dst_router = src_router->get_router(dir);
                if (dst_router == 0)
                    continue;
                pOut_port a_out_port = src_router->get_out_port(dir);
                pIn_port a_in_port = dst_router->get_in_port(reverse(dir));
                connect(a_out_port, a_in_port);
            }
        }
    }

    if (param.verbose)
        cout << "[I] Network successfully built..." << endl;

    param.network = this;
}