Commit f6a8ddff by chengshuyao

modify default paramters: set default searching times to 10

parent 0f90e982
......@@ -56,8 +56,6 @@ bool truth_table [1024*1024];
#include"print_circuit.h"
int tmp_BDD_depth;
int tmp_split_nodes [parameter_input_bit_width];
......@@ -71,6 +69,8 @@ public:
int accuracy_layers[parameter_input_bit_width];
//int nodes_for_each_start_node[parameter_max_BDD_width];
};
BSD_features BSD_features_0;
void search_order();
int search_reward(BSD_features BSD_features_0);
......@@ -111,7 +111,7 @@ int main(int argc,char* argv[]){
};
int BSD_execute(int variable_order_number,int* variable_order,BSD_features BSD_features_0){
int BSD_execute(int variable_order_number,int* variable_order){
BDD_class BDD_class_main;
BDD_class_main.which_demo_function = GLOBAL_which_demo_function;
......@@ -148,14 +148,9 @@ int BSD_execute(int variable_order_number,int* variable_order,BSD_features BSD_f
BSD_features_0.BSD_depth = BDD_class_main.total_BDD_depth+1;
BSD_features_0.BSD_area = BDD_class_main.total_split_nodes;
BSD_features_0.accuracy = BDD_class_main.circuit_accuracy;
int reward = search_reward(BSD_features_0);
//tmp_BDD_depth = BDD_class_main.total_BDD_depth+1;
//int reward = (1000000*(1-BDD_class_main.circuit_accuracy));
//if(BDD_class_main.circuit_accuracy <1)
// reward += 1000*(parameter_input_bit_width-BDD_class_main.total_BDD_depth);
//reward += BDD_class_main.total_split_nodes;
return reward;
};
......@@ -164,7 +159,7 @@ int search_reward(BSD_features BSD_features_0){
int reward = (1000000*(1-BSD_features_0.accuracy));
if(BSD_features_0.accuracy <1)
reward += 1000*(parameter_input_bit_width-BSD_features_0.BSD_depth);
reward += BSD_features_0.BSD_depth;
reward += BSD_features_0.BSD_area;
return reward;
};
......@@ -193,9 +188,7 @@ void search_order(){
int best_area_100;
int best_area_1000;
BSD_features BSD_features_0;
for (int i=0;i<10000;i++){
for (int i=0;i<10;i++){
if(i==1){
......@@ -221,15 +214,7 @@ void search_order(){
}
parameter_max_BDD_width=4000;
if (i<100){
mutation_depth = int(best_area_depth);}
else if (i<200){
mutation_depth = int(best_area_depth) ;}
else if (i<400){
mutation_depth = int(best_area_depth) ;}
else {
mutation_depth = int(best_area_depth);
}
mutation_depth = int(best_area_depth);
int min_feature = 9999999;
......@@ -287,39 +272,31 @@ void search_order(){
//}
if (i==0){
area = BSD_execute(0,variable_order,BSD_features_0);
area = BSD_execute(0,variable_order);
}
else{
area = BSD_execute(mutation_depth,variable_order);
}
else
area = BSD_execute(mutation_depth,variable_order,BSD_features_0);
if(area < best_area){
best_area = area;
best_area_depth = tmp_BDD_depth;
for(int vi=0;vi<tmp_BDD_depth;vi++){
best_area_depth = BSD_features_0.BSD_depth;
for(int vi=0;vi<BSD_features_0.BSD_depth;vi++){
best_variable_order[vi] = variable_order[vi];
best_BDD_split_nodes[vi] = BSD_features_0.BSD_area_layers[vi];
}
parameter_early_stop_split_nodes = best_area+10;
}
//else if((tmp_split_nodes[mutation_depth-1] < best_BDD_split_nodes[mutation_depth-1]) && (mutation_depth<tmp_BDD_depth)){
// best_area = best_area - best_BDD_split_nodes[mutation_depth] + tmp_split_nodes[mutation_depth];
// for(int vi=0;vi<mutation_depth;vi++){
// best_variable_order[vi] = variable_order[vi];
// best_BDD_split_nodes[vi] = tmp_split_nodes[vi];
// }
// parameter_early_stop_split_nodes = best_area;
//}
cout<<endl;
cout<<"Design Area: "<<area<<endl;
cout<<"Best Design Area: "<<best_area<<endl;
cout<<endl;
}
}
parameter_early_stop_split_nodes = 999999;
parameter_max_BDD_width=2000;
area = BSD_execute(parameter_input_bit_width,best_variable_order,BSD_features_0);
area = BSD_execute(parameter_input_bit_width,best_variable_order);
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment