-set MASTER_CPU=${MASTER}.${cpu}
-set MASTER_CPU_PER_SOC=${MASTER}.${cpu}.${SOC_CONFIG}
-if (-f $MASTER_CPU_PER_SOC) set MASTER_CPU = ${MASTER_CPU_PER_SOC}
+
+foreach master_file (${MASTER}.${cpu}.${SOC_CONFIG}.${PLATFORM} ${MASTER}.${cpu}.${SOC_CONFIG} ${MASTER}.${cpu}.${PLATFORM} ${MASTER}.${cpu})
+ if (-f $master_file) then
+ set MASTER_CPU = $master_file
+ break
+ endif
+end
+
+if ($?beverbose) then
+ echo MASTER_CPU=$MASTER_CPU
+endif