Skip to content

Commit 3c96ac0

Browse files
committed
Expand the comment on why we need different const when SPEC is enabled
1 parent 5f89441 commit 3c96ac0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libs/librrgraph/src/utils/alloc_and_load_rr_indexed_data.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,11 @@ static void load_rr_indexed_data_base_costs(const RRGraphView& rr_graph,
353353
rr_indexed_data[RRIndexedDataId(OPIN_COST_INDEX)].base_cost = delay_normalization_fac;
354354
// IF the SPEC_CPU flag is set, we need to make sure that all floating point numbers are perfectly representable in
355355
// binary format. Thus, we changed the IPIN_COST_INDEX base cost from 0.95 to 0.875.
356+
// This number is perfectly representable in a binary mantissa (without round-off) so we can get the same routing result on different platforms.
357+
// Since the router cost calculations and heap use floating point numbers, normally we get slightly different round off with different compiler settings,
358+
// leading to different heap sorts and hence different routings.
359+
// To make result validation for SPEC easier, we choose all router parameters to result in calculations that fit perfectly in a 24-bit binary mantissa.
360+
// .875 = 1/2 + 1/4 + 1/8 can be perfectly represented in a binary mantissa with only the first 3 bits set.
356361
#ifdef SPEC_CPU
357362
rr_indexed_data[RRIndexedDataId(IPIN_COST_INDEX)].base_cost = 0.875 * delay_normalization_fac;
358363
#else

0 commit comments

Comments
 (0)