本文整理汇总了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;
}
}
}