adjust CLOCK_CYCLES and related macros to handle fpu/iu concurrency
add CLOCK_CYCLES_FPU, which does exactly what CLOCK_CYCLES already did. add CONCURRENCY_CYCLES, which sets fpu_cycles, which is the number of available concurrent execution cycles that the integer unit can do "free" work in while the fpu is executing. adjust CLOCK_CYCLES so that if there are fpu_cycles, the cycle count is subtracted from fpu_cycles instead of cycles, emulating the behavior of these concurrent cycles being "free" as on real hardware.
This commit is contained in:
@@ -89,11 +89,32 @@ static int refresh = 0, cycdiff;
|
||||
wait(val, 0); \
|
||||
}
|
||||
|
||||
#define CLOCK_CYCLES(val) \
|
||||
#define CLOCK_CYCLES_ALWAYS(val) \
|
||||
{ \
|
||||
wait(val, 0); \
|
||||
}
|
||||
|
||||
#define CLOCK_CYCLES_FPU(val) \
|
||||
{ \
|
||||
wait(val, 0); \
|
||||
}
|
||||
|
||||
|
||||
#define CLOCK_CYCLES(val) \
|
||||
{ \
|
||||
if (fpu_cycles > 0) { \
|
||||
fpu_cycles -= (val); \
|
||||
if (fpu_cycles < 0) { \
|
||||
wait(val, 0); \
|
||||
} \
|
||||
} else { \
|
||||
wait(val, 0); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define CONCURRENCY_CYCLES(c) fpu_cycles = (c)
|
||||
|
||||
|
||||
typedef int (*OpFn)(uint32_t fetchdat);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user