From 4fd7305d1dcf6e2bce20506f30709c5263d2d016 Mon Sep 17 00:00:00 2001 From: SarahW Date: Thu, 25 Jun 2020 19:47:10 +0100 Subject: [PATCH] Limit P6 pipeline throughput to 3 uOPs/cycle --- src/codegen_timing_p6.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/codegen_timing_p6.c b/src/codegen_timing_p6.c index 49a90a1..7f9a8e0 100644 --- a/src/codegen_timing_p6.c +++ b/src/codegen_timing_p6.c @@ -1606,8 +1606,26 @@ static p6_unit_t units[] = }; const int nr_units = (sizeof(units) / sizeof(p6_unit_t)); +static int rat_timestamp = 0; +static int rat_uops = 0; + static int uop_run(const p6_uop_t *uop, int decode_time) { + /*Peak of 3 uOPs from decode to RAT per cycle*/ + if (decode_time < rat_timestamp) + decode_time = rat_timestamp; + else if (decode_time > rat_timestamp) + { + rat_timestamp = decode_time; + rat_uops = 0; + } + + rat_uops++; + if (rat_uops == 3) + { + rat_timestamp++; + rat_uops = 0; + } #if 0 int c; p6_unit_t *best_unit = NULL; @@ -1908,7 +1926,10 @@ void codegen_timing_p6_block_start() decode_timestamp = 0; last_complete_timestamp = 0; - + + rat_timestamp = 0; + rat_uops = 0; + for (c = 0; c < NR_REGS; c++) reg_available_timestamp[c] = 0; for (c = 0; c < 8; c++)