Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
BSD
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chengshuyao
BSD
Commits
f6a8ddff
Commit
f6a8ddff
authored
Apr 23, 2025
by
chengshuyao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify default paramters: set default searching times to 10
parent
0f90e982
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
38 deletions
+15
-38
src/BSD.cpp
+15
-38
No files found.
src/BSD.cpp
View file @
f6a8ddff
...
...
@@ -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_BD
D_depth
;
for
(
int
vi
=
0
;
vi
<
tmp_BD
D_depth
;
vi
++
){
best_area_depth
=
BSD_features_0
.
BS
D_depth
;
for
(
int
vi
=
0
;
vi
<
BSD_features_0
.
BS
D_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
);
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment