当前位置: 首页>>代码示例>>C++>>正文


C++ Timing::Run方法代码示例

本文整理汇总了C++中Timing::Run方法的典型用法代码示例。如果您正苦于以下问题:C++ Timing::Run方法的具体用法?C++ Timing::Run怎么用?C++ Timing::Run使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Timing的用法示例。


在下文中一共展示了Timing::Run方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: arch_run

void arch_run(int *num_emu_active_ptr, int *num_timing_active_ptr) {
  struct arch_t *arch;
  long long cycle;

  int run;
  int i;

  Emu *emu;
  Timing *timing;

  /* Reset active emulation and timing simulation counters */
  *num_emu_active_ptr = 0;
  *num_timing_active_ptr = 0;

  /* Run one iteration for all architectures */
  for (i = 0; i < arch_list_count; i++) {
    /* Get architecture */
    arch = arch_list[i];
    if (arch->sim_kind == arch_sim_kind_functional) {
      /* Emulation iteration */
      emu = arch->emu;
      assert(emu && emu->Run);
      arch->active = emu->Run(emu);

      /* Increase number of active emulations if the architecture
       * actually performed a useful emulation iteration. */
      *num_emu_active_ptr += arch->active;
    } else {
      /* Check whether the architecture should actually run an
       * iteration. If it is working at a slower frequency than
       * the main simulation loop, we must skip this call. */
      timing = arch->timing;
      assert(timing);
      assert(timing->frequency_domain);
      cycle = esim_domain_cycle(timing->frequency_domain);
      run = cycle != arch->last_timing_cycle;

      /* Timing simulation iteration */
      if (run) {
        /* Do it... */
        arch->active = timing->Run(timing);

        /* ... but only update the last timing
         * simulation cycle if there was an effective
         * execution of the iteration loop. Otherwise,
         * there is a deadlock: 'esim_time' will not
         * advance (no call to 'esim_process_events')
         * because no architecture ran, and no
         * architecture will run because 'esim_time'
         * did not advance. */
        if (arch->active) arch->last_timing_cycle = cycle;
      }

      /* Increase number of active timing simulations if the
       * architecture actually performance a useful iteration. */
      *num_timing_active_ptr += arch->active;
    }
  }
}
开发者ID:xianggong,项目名称:multi2sim42,代码行数:59,代码来源:arch.c


注:本文中的Timing::Run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。