def getMaximumAndMinimumInformation():
global PLL0_info_Max
global PLL0_info_Min
global PLL1_info_Max
global PLL1_info_Min
global macro_info_PLL0
global macro_info_PLL1
global row_max_pll0
global row_min_pll0
global row_max_pll1
global row_min_pll1
# global PLL0_freq_Max
# global PLL0_freq_Min
# global PLL1_freq_Max
# global PLL1_freq_Min
global PLL0_freq_Max_fullMode # 用于clk_purity
global PLL0_freq_Min_fullMode # 用于clk_purity
global PLL1_freq_Max_fullMode # 用于clk_purity
global PLL1_freq_Min_fullMode # 用于clk_purity
PLL0_freq_Max_fullMode = ''
PLL0_freq_Min_fullMode = ''
PLL1_freq_Max_fullMode = ''
PLL1_freq_Min_fullMode = ''
PLL0_info_Max = ''
PLL0_info_Min = ''
PLL1_info_Max = ''
PLL1_info_Min = ''
# 判断文件PLL0 和PLL1 是否存在
pathPLL0 = os.path.join(OutputPath, 'MacroInfo_cared_PLL0_simple.xlsx')
pathPLL1 = os.path.join(OutputPath, 'MacroInfo_cared_PLL1_simple.xlsx')
if (os.path.exists(pathPLL0)):
macro_info_PLL0 = pd.read_excel(pathPLL0, sheet_name="frequency_plan", dtype=str, keep_default_na=False,
header=0)
x = pd.DataFrame(macro_info_PLL0.iloc[:, :])
if x.empty:
print('PLL0 is empty')
else:
print('The PLL0 Maximum :', x['VCO freq (GHz)'].astype(float).max(), 'row: ',
x['VCO freq (GHz)'].astype(float).idxmax())
print('The PLL0 Maximum :', x['VCO freq (GHz)'].astype(float).min(), 'row: ',
x['VCO freq (GHz)'].astype(float).idxmin())
row_max_pll0 = x['VCO freq (GHz)'].astype(float).idxmax()
row_min_pll0 = x['VCO freq (GHz)'].astype(float).idxmin()
for i in range(0, len(macro_info_PLL0.keys())):
PLL0_info_Max += macro_info_PLL0.keys()[i].__str__() + ' = ' + macro_info_PLL0.iat[row_max_pll0, i] + ';\n\t\t' + ' '
PLL0_info_Min += macro_info_PLL0.keys()[i].__str__() + ' = ' + macro_info_PLL0.iat[row_min_pll0, i] + ';\n\t\t' + ' '
# PLL0_freq_Max = x['VCO freq (GHz)'].astype(float).max() #??
# PLL0_freq_Min = x['VCO freq (GHz)'].astype(float).max()
if (re.search('Rate\s*Mode', macro_info_PLL0.keys()[i].__str__(), flags=re.I)):
PLL0_freq_Max_fullMode += macro_info_PLL0.keys()[i].__str__() + ' = ' + 'full' + ';\n\t\t' + ' '
PLL0_freq_Min_fullMode += macro_info_PLL0.keys()[i].__str__() + ' = ' + 'full' + ';\n\t\t' + ' '
continue
else:
PLL0_freq_Max_fullMode += macro_info_PLL0.keys()[i].__str__() + ' = ' + macro_info_PLL0.iat[row_max_pll0, i] + ';\n\t\t' + ' '
PLL0_freq_Min_fullMode += macro_info_PLL0.keys()[i].__str__() + ' = ' + macro_info_PLL0.iat[row_min_pll0, i] + ';\n\t\t' + ' '
# print(PLL0_freq_Max_fullMode)
if (os.path.exists(pathPLL1)):
macro_info_PLL1 = pd.read_excel(pathPLL1, sheet_name="frequency_plan", dtype=str, keep_default_na=False,
header=0)
x = pd.DataFrame(macro_info_PLL1.iloc[:, :])
if x.empty:
print('PLL1 is empty')
else:
print('The macro_info_PLL1 Maximum :', x['VCO freq (GHz)'].astype(float).max(), 'row: ',
x['VCO freq (GHz)'].astype(float).idxmax())
print('The macro_info_PLL1 Minimum :', x['VCO freq (GHz)'].astype(float).min(), 'row: ',
x['VCO freq (GHz)'].astype(float).idxmin())
row_max_pll1 = x['VCO freq (GHz)'].astype(float).idxmax()
row_min_pll1 = x['VCO freq (GHz)'].astype(float).idxmin()
for i in range(0, len(macro_info_PLL1.keys())):
PLL1_info_Max += macro_info_PLL1.keys()[i].__str__() + ' = ' + macro_info_PLL1.iat[row_max_pll1, i] + ';\n\t\t' + ' '
PLL1_info_Min += macro_info_PLL1.keys()[i].__str__() + ' = ' + macro_info_PLL1.iat[row_min_pll1, i] + ';\n\t\t' + ' '
# PLL1_freq_Max = x['VCO freq (GHz)'].astype(float).max()
# PLL1_freq_Min = x['VCO freq (GHz)'].astype(float).max()
if (re.search('Rate\s*Mode', macro_info_PLL0.keys()[i].__str__(), flags=re.I)):
PLL1_freq_Max_fullMode += macro_info_PLL0.keys()[i].__str__() + ' = ' + 'full' + ';\n\t\t' + ' '
PLL1_freq_Min_fullMode += macro_info_PLL0.keys()[i].__str__() + ' = ' + 'full' + ';\n\t\t' + ' '
continue
else:
PLL1_freq_Max_fullMode += macro_info_PLL1.keys()[i].__str__() + ' = ' + macro_info_PLL1.iat[row_max_pll1, i] + ';\n\t\t' + ' '
PLL1_freq_Min_fullMode += macro_info_PLL1.keys()[i].__str__() + ' = ' + macro_info_PLL1.iat[row_min_pll1, i] + ';\n\t\t' + ' '
获取指定列的数值最大值所在的行 python # row = x[‘VCO freq (GHz)‘].astype(float).idxmax()
最新推荐文章于 2022-09-27 14:39:31 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)