Skip to content

Commit

Permalink
conversion errors fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
manan-garg1504 committed Oct 19, 2023
1 parent e58b050 commit cff2606
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 33 deletions.
20 changes: 10 additions & 10 deletions sims/CFU-Playground/train_EMUKIT_GP_CFUPlayground.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,16 @@ def main(_):
for suggestion in suggestions:
count += 1

action = {"Bypass": int(str(suggestion.parameters['Bypass'])),
"CFU_enable": int(str(suggestion.parameters['CFU_enable'])),
"Data_cache_size": int(str(suggestion.parameters['Data_cache_size'])),
"Hardware_Divider": int(str(suggestion.parameters['Hardware_Divider'])),
"Instruction_cache_size": int(str(suggestion.parameters['Instruction_cache_size'])),
"Hardware_Multiplier": int(str(suggestion.parameters['Hardware_Multiplier'])),
"Branch_predictor_type": int(str(suggestion.parameters['Branch_predictor_type'])),
"Safe_mode_enable": int(str(suggestion.parameters['Safe_mode_enable'])),
"Single_Cycle_Shifter": int(str(suggestion.parameters['Single_Cycle_Shifter'])),
"Single_Cycle_Multiplier": int(str(suggestion.parameters['Single_Cycle_Multiplier']))}
action = {"Bypass": int(float(str(suggestion.parameters['Bypass']))),
"CFU_enable": int(float(str(suggestion.parameters['CFU_enable']))),
"Data_cache_size": int(float(str(suggestion.parameters['Data_cache_size']))),
"Hardware_Divider": int(float(str(suggestion.parameters['Hardware_Divider']))),
"Instruction_cache_size": int(float(str(suggestion.parameters['Instruction_cache_size']))),
"Hardware_Multiplier": int(float(str(suggestion.parameters['Hardware_Multiplier']))),
"Branch_predictor_type": int(float(str(suggestion.parameters['Branch_predictor_type']))),
"Safe_mode_enable": int(float(str(suggestion.parameters['Safe_mode_enable']))),
"Single_Cycle_Shifter": int(float(str(suggestion.parameters['Single_Cycle_Shifter']))),
"Single_Cycle_Multiplier": int(float(str(suggestion.parameters['Single_Cycle_Multiplier'])))}

done, reward, info, obs = (env.step(action))
fitness_hist['reward'] = reward
Expand Down
20 changes: 10 additions & 10 deletions sims/CFU-Playground/train_NSGA2_CFUPlayground.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,16 @@ def main(_):
for suggestion in suggestions:
count += 1

action = {"Bypass": int(str(suggestion.parameters['Bypass'])),
"CFU_enable": int(str(suggestion.parameters['CFU_enable'])),
"Data_cache_size": int(str(suggestion.parameters['Data_cache_size'])),
"Hardware_Divider": int(str(suggestion.parameters['Hardware_Divider'])),
"Instruction_cache_size": int(str(suggestion.parameters['Instruction_cache_size'])),
"Hardware_Multiplier": int(str(suggestion.parameters['Hardware_Multiplier'])),
"Branch_predictor_type": int(str(suggestion.parameters['Branch_predictor_type'])),
"Safe_mode_enable": int(str(suggestion.parameters['Safe_mode_enable'])),
"Single_Cycle_Shifter": int(str(suggestion.parameters['Single_Cycle_Shifter'])),
"Single_Cycle_Multiplier": int(str(suggestion.parameters['Single_Cycle_Multiplier']))}
action = {"Bypass": int(float(str(suggestion.parameters['Bypass']))),
"CFU_enable": int(float(str(suggestion.parameters['CFU_enable']))),
"Data_cache_size": int(float(str(suggestion.parameters['Data_cache_size']))),
"Hardware_Divider": int(float(str(suggestion.parameters['Hardware_Divider']))),
"Instruction_cache_size": int(float(str(suggestion.parameters['Instruction_cache_size']))),
"Hardware_Multiplier": int(float(str(suggestion.parameters['Hardware_Multiplier']))),
"Branch_predictor_type": int(float(str(suggestion.parameters['Branch_predictor_type']))),
"Safe_mode_enable": int(float(str(suggestion.parameters['Safe_mode_enable']))),
"Single_Cycle_Shifter": int(float(str(suggestion.parameters['Single_Cycle_Shifter']))),
"Single_Cycle_Multiplier": int(float(str(suggestion.parameters['Single_Cycle_Multiplier'])))}

done, reward, info, obs = (env.step(action))
fitness_hist['reward'] = reward
Expand Down
25 changes: 12 additions & 13 deletions sims/CFU-Playground/train_quasirandom_CFUPlayground.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,19 +145,18 @@ def main(_):
count = 0
for suggestion in suggestions:
count += 1
action = {"Bypass": float(str(suggestion.parameters['Bypass'])),
"CFU_enable": float(str(suggestion.parameters['CFU_enable'])),
"Data_cache_size": float(str(suggestion.parameters['Data_cache_size'])),
"Hardware_Divider": float(str(suggestion.parameters['Hardware_Divider'])),
"Instruction_cache_size": float(str(suggestion.parameters['Instruction_cache_size'])),
"Hardware_Multiplier": float(str(suggestion.parameters['Hardware_Multiplier'])),
"Branch_predictor_type": float(str(suggestion.parameters['Branch_predictor_type'])),
"Safe_mode_enable": float(str(suggestion.parameters['Safe_mode_enable'])),
"Single_Cycle_Shifter": float(str(suggestion.parameters['Single_Cycle_Shifter'])),
"Single_Cycle_Multiplier": float(str(suggestion.parameters['Single_Cycle_Multiplier']))}

print('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA')


action = {"Bypass": int(float(str(suggestion.parameters['Bypass']))),
"CFU_enable": int(float(str(suggestion.parameters['CFU_enable']))),
"Data_cache_size": int(float(str(suggestion.parameters['Data_cache_size']))),
"Hardware_Divider": int(float(str(suggestion.parameters['Hardware_Divider']))),
"Instruction_cache_size": int(float(str(suggestion.parameters['Instruction_cache_size']))),
"Hardware_Multiplier": int(float(str(suggestion.parameters['Hardware_Multiplier']))),
"Branch_predictor_type": int(float(str(suggestion.parameters['Branch_predictor_type']))),
"Safe_mode_enable": int(float(str(suggestion.parameters['Safe_mode_enable']))),
"Single_Cycle_Shifter": int(float(str(suggestion.parameters['Single_Cycle_Shifter']))),
"Single_Cycle_Multiplier": int(float(str(suggestion.parameters['Single_Cycle_Multiplier'])))}

print(action)


Expand Down

0 comments on commit cff2606

Please sign in to comment.