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
SunMaple
BSD
Commits
3c636707
Commit
3c636707
authored
Dec 11, 2025
by
chengshuyao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
default setting, and debug some delete problems
parent
e307a20b
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
89 additions
and
97 deletions
+89
-97
src/BSD.h
+56
-55
src/BSD_top.h
+19
-28
src/next_layer_bit.h
+5
-5
src/print_circuit.h
+1
-1
src/tool_function.h
+1
-1
src/top.h
+7
-7
No files found.
src/BSD.h
View file @
3c636707
...
@@ -26,8 +26,8 @@ public:
...
@@ -26,8 +26,8 @@ public:
mask
=
new
bool
[
parameter_input_bit_width
];
mask
=
new
bool
[
parameter_input_bit_width
];
};
};
~
BDD_node
(){
~
BDD_node
(){
//delete [] which_root_node_all
;
arr_delete
(
which_root_node_all
)
;
//delete [] mask
;
arr_delete
(
mask
)
;
};
};
};
};
...
@@ -38,7 +38,7 @@ public:
...
@@ -38,7 +38,7 @@ public:
mask
=
new
bool
[
parameter_input_bit_width
];
mask
=
new
bool
[
parameter_input_bit_width
];
}
}
~
BDD_node_mask
(){
~
BDD_node_mask
(){
//delete [] mask
;
arr_delete
(
mask
)
;
}
}
};
};
class
BDD_class
{
class
BDD_class
{
...
@@ -91,7 +91,7 @@ public:
...
@@ -91,7 +91,7 @@ public:
bool
io_generator_single
(
bool
*
input_data
,
int
which_bit_output
);
bool
io_generator_single
(
bool
*
input_data
,
int
which_bit_output
);
uint64_t
io_generator_single_vec
(
uint64_t
*
input_data
,
int
which_bit_output
);
uint64_t
io_generator_single_vec
(
uint64_t
*
input_data
,
int
which_bit_output
);
int
set_random_input_data
(
bool
**
mask_input_data
);
int
set_random_input_data
(
bool
**
mask_input_data
);
int
mask_random_input_data
(
int
depth
,
bool
*
mask
,
int
amount
,
int
*
most_influence
,
bool
**
mask_input_data
);
int
mask_random_input_data
(
int
depth
,
bool
*
mask
,
int
amount
,
bool
**
mask_input_data
);
int
next_bit_layer
(
int
depth
);
int
next_bit_layer
(
int
depth
);
int
next_bit_layer_0
(
int
depth
);
int
next_bit_layer_0
(
int
depth
);
int
next_bit_layer_1
(
int
depth
);
int
next_bit_layer_1
(
int
depth
);
...
@@ -113,7 +113,7 @@ public:
...
@@ -113,7 +113,7 @@ public:
int
start_depth
=
0
;
int
start_depth
=
0
;
int
how_many_start_nodes
=
32
;
int
how_many_start_nodes
=
32
;
BDD_node
*
start_nodes
;
BDD_node
*
start_nodes
;
int
train_BDD
(
BDD_node
**
BDD
,
int
*
most_influence
,
int
start_depth
,
int
how_many_start_nodes
,
BDD_node
*
start_nodes
);
int
train_BDD
(
int
start_depth
,
int
how_many_start_nodes
,
BDD_node
*
start_nodes
);
double
circuit_accuracy
;
double
circuit_accuracy
;
double
*
circuit_accuracy_all_bits
;
double
*
circuit_accuracy_all_bits
;
...
@@ -127,8 +127,8 @@ public:
...
@@ -127,8 +127,8 @@ public:
bool
infer_output_data
;
bool
infer_output_data
;
int
BDD_infer
(
BDD_node
**
BDD
,
int
*
most_influence
);
int
BDD_infer
();
int
print_circuit
(
BDD_node
**
BDD
,
int
*
most_influence
,
int
node_depth
,
char
*
start_node_index_string
);
int
print_circuit
(
int
node_depth
,
char
*
start_node_index_string
);
int
BDD_FULL_PROCESS
();
int
BDD_FULL_PROCESS
();
bool
*
left_son_mask
;
bool
*
left_son_mask
;
...
@@ -204,32 +204,40 @@ public:
...
@@ -204,32 +204,40 @@ public:
start_node_index_string
=
new
char
[
parameter_output_bit_width
+
1
];
start_node_index_string
=
new
char
[
parameter_output_bit_width
+
1
];
};
};
//~BDD_class(){
~
BDD_class
(){
// delete [] most_influence ;
// delete [] BDD_width_each_layer ;
// delete [] mask_input_data ;
// delete [] mask_output_data ;
// delete [] simplify_list ;
// delete [] BDD ;
// delete [] BDD_mask_this ;
// delete [] BDD_mask_next ;
// delete [] has_been_unfold ;
// delete [] amount_turn_output_data ;
// delete [] amount_turn ;
// delete [] test_input_data ;
// delete [] left_son_mask ;
// delete [] right_son_mask ;
// delete [] left_mask_output_data ;
// delete [] right_mask_output_data ;
// delete [] left_mask_output_data_all ;
// delete [] right_mask_output_data_all ;
//delete [] split_nodes_each_layer ;
//delete [] split_nodes_each_layer ;
//delete [] accuracy_each_layer ;
//delete [] accuracy_each_layer ;
//delete [] BSD_variable_order ;
//delete [] BSD_variable_order ;
//delete [] BDD_split_nodes_each_layer ;
//delete [] BDD_split_nodes_each_layer ;
//delete [] output_partition_set ;
//delete [] output_partition_set ;
//};
//delete [] start_node_index ;
//delete [] start_node_index_string ;
//arr_delete (most_influence) ;
//delete [] BDD_width_each_layer ;
//delete [] mask_input_data ;
//delete [] mask_output_data ;
//delete [] simplify_list ;
//delete [] hash_simplify_list ;
//delete [] BDD ;
//delete [] BDD_mask_this ;
//delete [] BDD_mask_next ;
//delete [] has_been_unfold ;
//delete [] amount_turn_output_data ;
//delete [] amount_turn ;
//delete [] test_input_data ;
//delete [] left_son_mask ;
//delete [] right_son_mask ;
//delete [] left_mask_output_data ;
//delete [] right_mask_output_data ;
//delete [] left_mask_output_data_all ;
//delete [] right_mask_output_data_all ;
//delete [] all_one_left_list ;
//delete [] all_zero_left_list ;
//delete [] all_one_right_list ;
//delete [] all_zero_right_list ;
};
};
};
...
@@ -273,7 +281,7 @@ bool BDD_class::io_generator_single(bool* input_data,int which_bit_output){
...
@@ -273,7 +281,7 @@ bool BDD_class::io_generator_single(bool* input_data,int which_bit_output){
//}
//}
//else
//else
// output_bit = 0;
// output_bit = 0;
delete
[]
output_bits
;
arr_delete
(
output_bits
)
;
return
output_bit
;
return
output_bit
;
#endif
#endif
};
};
...
@@ -303,7 +311,7 @@ uint64_t BDD_class::io_generator_single_vec(uint64_t* input_data,int which_bit_o
...
@@ -303,7 +311,7 @@ uint64_t BDD_class::io_generator_single_vec(uint64_t* input_data,int which_bit_o
//}
//}
//else
//else
// output_bit = 0;
// output_bit = 0;
delete
[]
output_bits
;
arr_delete
(
output_bits
)
;
return
output_bit
;
return
output_bit
;
#endif
#endif
};
};
...
@@ -311,7 +319,7 @@ uint64_t BDD_class::io_generator_single_vec(uint64_t* input_data,int which_bit_o
...
@@ -311,7 +319,7 @@ uint64_t BDD_class::io_generator_single_vec(uint64_t* input_data,int which_bit_o
int
BDD_class
::
train_BDD
(
BDD_node
**
BDD
,
int
*
most_influence
,
int
start_depth
,
int
how_many_start_nodes
,
BDD_node
*
start_nodes
){
int
BDD_class
::
train_BDD
(
int
start_depth
,
int
how_many_start_nodes
,
BDD_node
*
start_nodes
){
int
i
,
j
;
int
i
,
j
;
int
zi
;
int
zi
;
...
@@ -604,16 +612,12 @@ int BDD_class::train_BDD(BDD_node** BDD,int* most_influence,int start_depth, int
...
@@ -604,16 +612,12 @@ int BDD_class::train_BDD(BDD_node** BDD,int* most_influence,int start_depth, int
right_mask_output_data_all
[
zj
]
=
vec_output_right
[(
zj
-
start_zj
)];
right_mask_output_data_all
[
zj
]
=
vec_output_right
[(
zj
-
start_zj
)];
left_mask_output_data_all
[
zj
]
=
vec_output_left
[(
zj
-
start_zj
)];
left_mask_output_data_all
[
zj
]
=
vec_output_left
[(
zj
-
start_zj
)];
}
}
for
(
int
kk
=
0
;
kk
<
parameter_input_bit_width
;
kk
++
){
arr2d_delete
(
vec_input_left
,
parameter_input_bit_width
)
;
delete
[]
vec_input_left
[
kk
]
;
arr2d_delete
(
vec_input_right
,
parameter_input_bit_width
)
;
delete
[]
vec_input_right
[
kk
]
;
arr_delete
(
vec_output_left
);
}
arr_delete
(
vec_output_right
);
delete
[]
vec_input_left
;
arr_delete
(
vec_input_left_int
)
;
delete
[]
vec_input_right
;
arr_delete
(
vec_input_right_int
)
;
delete
[]
vec_output_left
;
delete
[]
vec_output_right
;
delete
[]
vec_input_left_int
;
delete
[]
vec_input_right_int
;
}
}
#else
#else
...
@@ -819,8 +823,8 @@ int BDD_class::train_BDD(BDD_node** BDD,int* most_influence,int start_depth, int
...
@@ -819,8 +823,8 @@ int BDD_class::train_BDD(BDD_node** BDD,int* most_influence,int start_depth, int
//cout<<"all zero right"<<all_zero_right_list[j] <<endl;
//cout<<"all zero right"<<all_zero_right_list[j] <<endl;
//cout<<"all one right"<<all_one_right_list[j] <<endl;
//cout<<"all one right"<<all_one_right_list[j] <<endl;
}
}
delete
[]
left_mask_output_data_tmp
;
arr_delete
(
left_mask_output_data_tmp
)
;
delete
[]
right_mask_output_data_tmp
;
arr_delete
(
right_mask_output_data_tmp
)
;
}
}
cout
<<
"Finish all one all zero compare "
<<
endl
;
cout
<<
"Finish all one all zero compare "
<<
endl
;
...
@@ -1102,13 +1106,13 @@ int BDD_class::train_BDD(BDD_node** BDD,int* most_influence,int start_depth, int
...
@@ -1102,13 +1106,13 @@ int BDD_class::train_BDD(BDD_node** BDD,int* most_influence,int start_depth, int
cout
<<
"######################################################################"
<<
endl
;
cout
<<
"######################################################################"
<<
endl
;
}
}
//delete [] root_nodes_leafs
;
arr_delete
(
root_nodes_leafs
)
;
//delete [] leaf_nodes_roots
;
arr_delete
(
leaf_nodes_roots
)
;
return
0
;
return
0
;
};
};
int
BDD_class
::
BDD_infer
(
BDD_node
**
BDD
,
int
*
most_influence
){
int
BDD_class
::
BDD_infer
(){
long
i
,
j
;
long
i
,
j
;
gettimeofday
(
&
start_time
,
NULL
);
gettimeofday
(
&
start_time
,
NULL
);
random_device
rd
;
random_device
rd
;
...
@@ -1146,7 +1150,7 @@ int BDD_class::BDD_infer(BDD_node** BDD,int* most_influence){
...
@@ -1146,7 +1150,7 @@ int BDD_class::BDD_infer(BDD_node** BDD,int* most_influence){
///// cout<<" "<<infer_output_data<<endl;
///// cout<<" "<<infer_output_data<<endl;
///// cout<<" "<<test_output_data<<endl;
///// cout<<" "<<test_output_data<<endl;
/////}
/////}
delete
[]
test_input_data
;
arr_delete
(
test_input_data
)
;
}
}
cout
<<
endl
;
cout
<<
endl
;
circuit_accuracy_all_bits
=
new
double
[
how_many_start_nodes
];
circuit_accuracy_all_bits
=
new
double
[
how_many_start_nodes
];
...
@@ -1165,7 +1169,7 @@ int BDD_class::BDD_infer(BDD_node** BDD,int* most_influence){
...
@@ -1165,7 +1169,7 @@ int BDD_class::BDD_infer(BDD_node** BDD,int* most_influence){
for
(
i
=
0
;
i
<
how_many_start_nodes
;
i
++
){
for
(
i
=
0
;
i
<
how_many_start_nodes
;
i
++
){
circuit_accuracy
+=
circuit_accuracy_all_bits
[
i
];
circuit_accuracy
+=
circuit_accuracy_all_bits
[
i
];
}
}
//delete [] circuit_accuracy_all_bits
;
arr_delete
(
circuit_accuracy_all_bits
)
;
circuit_accuracy
/=
how_many_start_nodes
;
circuit_accuracy
/=
how_many_start_nodes
;
cout
<<
"How many start nodes = "
<<
how_many_start_nodes
<<
endl
;
cout
<<
"How many start nodes = "
<<
how_many_start_nodes
<<
endl
;
cout
<<
"Average Accuracy among all output bits = "
<<
circuit_accuracy
<<
endl
;
cout
<<
"Average Accuracy among all output bits = "
<<
circuit_accuracy
<<
endl
;
...
@@ -1176,7 +1180,7 @@ int BDD_class::BDD_infer(BDD_node** BDD,int* most_influence){
...
@@ -1176,7 +1180,7 @@ int BDD_class::BDD_infer(BDD_node** BDD,int* most_influence){
gettimeofday
(
&
finish_time
,
NULL
);
gettimeofday
(
&
finish_time
,
NULL
);
double
test_time
=
double
(
finish_time
.
tv_usec
-
start_time
.
tv_usec
+
1000000
*
(
finish_time
.
tv_sec
-
start_time
.
tv_sec
))
/
1000000
;
double
test_time
=
double
(
finish_time
.
tv_usec
-
start_time
.
tv_usec
+
1000000
*
(
finish_time
.
tv_sec
-
start_time
.
tv_sec
))
/
1000000
;
cout
<<
"Total test time = "
<<
test_time
<<
"s"
<<
endl
;
cout
<<
"Total test time = "
<<
test_time
<<
"s"
<<
endl
;
//delete [] error_all
;
arr_delete
(
error_all
)
;
return
0
;
return
0
;
};
};
...
@@ -1279,7 +1283,7 @@ int BDD_class::BDD_FULL_PROCESS(){
...
@@ -1279,7 +1283,7 @@ int BDD_class::BDD_FULL_PROCESS(){
}
}
for
(
int
i
=
0
;
i
<
parameter_input_bit_width
;
i
++
)
for
(
int
i
=
0
;
i
<
parameter_input_bit_width
;
i
++
)
BDD_split_nodes_each_layer
[
i
]
=
0
;
BDD_split_nodes_each_layer
[
i
]
=
0
;
train_BDD
(
BDD
,
most_influence
,
start_depth
,
how_many_start_nodes
,
start_nodes
);
train_BDD
(
start_depth
,
how_many_start_nodes
,
start_nodes
);
int
best_total_split_nodes_recursive
=
total_split_nodes_recursive
;
int
best_total_split_nodes_recursive
=
total_split_nodes_recursive
;
cout
<<
"Finish Train"
<<
endl
;
cout
<<
"Finish Train"
<<
endl
;
struct
timeval
switch_start_time
,
switch_finish_time
;
struct
timeval
switch_start_time
,
switch_finish_time
;
...
@@ -1287,7 +1291,7 @@ int BDD_class::BDD_FULL_PROCESS(){
...
@@ -1287,7 +1291,7 @@ int BDD_class::BDD_FULL_PROCESS(){
int
max_move_length
=
40
;
int
max_move_length
=
40
;
int
max_group
=
5
;
int
max_group
=
5
;
BDD_infer
(
BDD
,
most_influence
);
BDD_infer
();
if
(
circuit_accuracy
<
0
.
96
){}
if
(
circuit_accuracy
<
0
.
96
){}
else
{
else
{
int
optimize_time
=
0
;
int
optimize_time
=
0
;
...
@@ -1393,11 +1397,8 @@ int BDD_class::BDD_FULL_PROCESS(){
...
@@ -1393,11 +1397,8 @@ int BDD_class::BDD_FULL_PROCESS(){
cout
<<
" Switch time = "
<<
switch_time
<<
"s"
<<
endl
;
cout
<<
" Switch time = "
<<
switch_time
<<
"s"
<<
endl
;
}
}
//cout<<"Start infer"<<endl;
//BDD_infer(BDD,most_influence);
//print_circuit(BDD,most_influence);
if
(
circuit_accuracy
>
0
.
9999
)
if
(
circuit_accuracy
>
0
.
9999
)
print_circuit
(
BDD
,
most_influence
,
start_depth
,
start_node_index_string
);
print_circuit
(
start_depth
,
start_node_index_string
);
for
(
int
vi
=
0
;
vi
<
parameter_input_bit_width
;
vi
++
){
for
(
int
vi
=
0
;
vi
<
parameter_input_bit_width
;
vi
++
){
BSD_variable_order
[
vi
]
=
most_influence
[
vi
];
BSD_variable_order
[
vi
]
=
most_influence
[
vi
];
}
}
...
...
src/BSD_top.h
View file @
3c636707
...
@@ -45,7 +45,7 @@ bool* io_generator_function(bool* input_data, bool* output_data) {
...
@@ -45,7 +45,7 @@ bool* io_generator_function(bool* input_data, bool* output_data) {
else
else
output_data
[
i
]
=
output_data_temp
[
output_bit_index
[
i
]];
output_data
[
i
]
=
output_data_temp
[
output_bit_index
[
i
]];
}
}
delete
[]
output_data_temp
;
arr_delete
(
output_data_temp
)
;
return
output_data
;
return
output_data
;
}
}
...
@@ -64,7 +64,7 @@ uint64_t* io_generator_function_vec(uint64_t* input_data, uint64_t* output_data)
...
@@ -64,7 +64,7 @@ uint64_t* io_generator_function_vec(uint64_t* input_data, uint64_t* output_data)
else
else
output_data
[
i
]
=
output_data_temp
[
output_bit_index
[
i
]];
output_data
[
i
]
=
output_data_temp
[
output_bit_index
[
i
]];
}
}
delete
[]
output_data_temp
;
arr_delete
(
output_data_temp
)
;
return
output_data
;
return
output_data
;
}
}
...
@@ -81,8 +81,8 @@ public:
...
@@ -81,8 +81,8 @@ public:
expand_input_bit_data
=
new
bool
[
parameter_input_bit_width
];
expand_input_bit_data
=
new
bool
[
parameter_input_bit_width
];
}
}
~
node_index
(){
~
node_index
(){
//delete [] expand_input_bit_index
;
arr_delete
(
expand_input_bit_index
)
;
//delete [] expand_input_bit_data
;
arr_delete
(
expand_input_bit_data
)
;
}
}
};
};
...
@@ -265,7 +265,7 @@ int search_partition(int start_node_number=default_start_node_number,int start_n
...
@@ -265,7 +265,7 @@ int search_partition(int start_node_number=default_start_node_number,int start_n
}
}
area_parts
[
i
]
=
search_order
(
start_node_partition
,
start_node_depth
,
start_node_index_partition
,
search_order_times
,
start_order
);
area_parts
[
i
]
=
search_order
(
start_node_partition
,
start_node_depth
,
start_node_index_partition
,
search_order_times
,
start_order
);
area
+=
area_parts
[
i
];
area
+=
area_parts
[
i
];
//delete [] start_node_index_partition
;
arr_delete
(
start_node_index_partition
)
;
}
}
if
(
area
<
best_area
){
if
(
area
<
best_area
){
best_area
=
area
;
best_area
=
area
;
...
@@ -340,11 +340,11 @@ int search_partition(int start_node_number=default_start_node_number,int start_n
...
@@ -340,11 +340,11 @@ int search_partition(int start_node_number=default_start_node_number,int start_n
int
use_part
;
int
use_part
;
for
(
use_part
=
0
;
use_part
<
partition_parts
;
use_part
++
){
for
(
use_part
=
0
;
use_part
<
partition_parts
;
use_part
++
){
bool
merge_success
=
0
;
bool
merge_success
=
0
;
for
(
int
merge_part
=
use_part
+
1
;
merge_part
<
partition_parts
;
merge_part
++
){
for
(
int
merge_part
=
use_part
+
1
;
merge_part
<
partition_parts
+
1
;
merge_part
++
){
//改变Partition Set
//改变Partition Set
for
(
int
i
=
0
;
i
<
max_
partition_parts
;
i
++
){
for
(
int
i
=
0
;
i
<
partition_parts
;
i
++
){
if
(
i
<
merge_part
){
if
(
i
<
merge_part
){
for
(
int
j
=
0
;
j
<
max_partition_parts
;
j
++
){
for
(
int
j
=
0
;
j
<
max_partition_parts
;
j
++
){
partition_sets
[
i
][
j
]
=
best_partition_sets
[
i
][
j
];
partition_sets
[
i
][
j
]
=
best_partition_sets
[
i
][
j
];
...
@@ -377,7 +377,7 @@ int search_partition(int start_node_number=default_start_node_number,int start_n
...
@@ -377,7 +377,7 @@ int search_partition(int start_node_number=default_start_node_number,int start_n
cout
<<
"Partition_set ["
<<
i
<<
"] "
;
cout
<<
"Partition_set ["
<<
i
<<
"] "
;
int
start_node_partition
=
0
;
int
start_node_partition
=
0
;
for
(
int
j
=
0
;
j
<
partition_parts
;
j
++
){
for
(
int
j
=
0
;
j
<
max_
partition_parts
;
j
++
){
cout
<<
partition_sets
[
i
][
j
];
cout
<<
partition_sets
[
i
][
j
];
if
(
partition_sets
[
i
][
j
]){
if
(
partition_sets
[
i
][
j
]){
start_node_partition
++
;
start_node_partition
++
;
...
@@ -394,7 +394,7 @@ int search_partition(int start_node_number=default_start_node_number,int start_n
...
@@ -394,7 +394,7 @@ int search_partition(int start_node_number=default_start_node_number,int start_n
}
}
area_parts
[
i
]
=
search_order
(
start_node_partition
,
start_node_depth
,
start_node_index_partition
,
search_order_times
,
start_order
);
area_parts
[
i
]
=
search_order
(
start_node_partition
,
start_node_depth
,
start_node_index_partition
,
search_order_times
,
start_order
);
area
+=
area_parts
[
i
];
area
+=
area_parts
[
i
];
//delete [] start_node_index_partition
;
arr_delete
(
start_node_index_partition
)
;
}
}
}
}
...
@@ -488,15 +488,11 @@ int search_partition(int start_node_number=default_start_node_number,int start_n
...
@@ -488,15 +488,11 @@ int search_partition(int start_node_number=default_start_node_number,int start_n
}
}
cout
<<
"###########################################################################"
<<
endl
;
cout
<<
"###########################################################################"
<<
endl
;
//for (int i=0;i<max_partition_parts;i++){
arr2d_delete
(
partition_sets
,
max_partition_parts
);
// delete [] partition_sets[i] ;
arr2d_delete
(
best_partition_sets
,
max_partition_parts
);
// delete [] best_partition_sets[i] ;
//}
//delete [] partition_sets ;
//delete [] best_partition_sets ;
//delete [] area_parts
;
arr_delete
(
area_parts
)
;
//delete [] best_area_parts
;
arr_delete
(
best_area_parts
)
;
};
};
int
BSD_execute
(
int
start_node_number
,
node_index
*
start_node_index
,
int
variable_order_number
,
int
*
variable_order
){
int
BSD_execute
(
int
start_node_number
,
node_index
*
start_node_index
,
int
variable_order_number
,
int
*
variable_order
){
...
@@ -544,7 +540,6 @@ int BSD_execute(int start_node_number, node_index* start_node_index,int variable
...
@@ -544,7 +540,6 @@ int BSD_execute(int start_node_number, node_index* start_node_index,int variable
BDD_class_main
.
BDD_FULL_PROCESS
();
BDD_class_main
.
BDD_FULL_PROCESS
();
for
(
int
zi
=
0
;
zi
<
parameter_input_bit_width
;
zi
++
){
for
(
int
zi
=
0
;
zi
<
parameter_input_bit_width
;
zi
++
){
variable_order
[
zi
]
=
BSD_features_0
.
variable_order
[
zi
]
;
variable_order
[
zi
]
=
BSD_features_0
.
variable_order
[
zi
]
;
}
}
...
@@ -950,16 +945,12 @@ int search_order(int start_node_number = default_start_node_number, int start_no
...
@@ -950,16 +945,12 @@ int search_order(int start_node_number = default_start_node_number, int start_no
//area = BSD_execute(parameter_input_bit_width,best_variable_order,10000,best_partition_parts,best_order_num,output_partition_set);
//area = BSD_execute(parameter_input_bit_width,best_variable_order,10000,best_partition_parts,best_order_num,output_partition_set);
//delete [] best_BDD_split_nodes ;
arr_delete
(
best_BDD_split_nodes
);
//delete [] best_areas ;
arr_delete
(
best_areas
);
//delete [] best_rewards ;
arr_delete
(
best_rewards
)
;
//delete [] best_area_depths;
arr_delete
(
best_area_depths
);
//for (int vi=0;vi<parameter_max_orders;vi++){
arr2d_delete
(
multi_variable_order
,
parameter_max_orders
);
// delete [] multi_variable_order[vi];
arr2d_delete
(
best_variable_order
,
parameter_max_orders
);
// delete [] best_variable_order[vi];
//}
//delete [] multi_variable_order;
//delete [] best_variable_order;
return
reward
;
return
reward
;
};
};
...
...
src/next_layer_bit.h
View file @
3c636707
...
@@ -111,8 +111,8 @@ int BDD_class::next_bit_layer_single(int depth,int which_node_this_layer){
...
@@ -111,8 +111,8 @@ int BDD_class::next_bit_layer_single(int depth,int which_node_this_layer){
}
}
delete
[]
should_not_be_unfold
;
arr_delete
(
should_not_be_unfold
)
;
delete
[]
which_node_this_layer_array
;
arr_delete
(
which_node_this_layer_array
)
;
return
most_influence_next
;
return
most_influence_next
;
};
};
...
@@ -340,9 +340,9 @@ int BDD_class::next_bit_layer_1(int depth){
...
@@ -340,9 +340,9 @@ int BDD_class::next_bit_layer_1(int depth){
cout
<<
"模拟展开修改 "
<<
change_nodes
[
best_expansion_node
]
<<
endl
;
cout
<<
"模拟展开修改 "
<<
change_nodes
[
best_expansion_node
]
<<
endl
;
most_influence_next
=
best_expansion_node
;
most_influence_next
=
best_expansion_node
;
has_been_unfold
[
most_influence_next
]
=
1
;
has_been_unfold
[
most_influence_next
]
=
1
;
delete
[]
how_many_nodes_if_expansion
;
arr_delete
(
how_many_nodes_if_expansion
)
;
delete
[]
left_son_mask
;
arr_delete
(
left_son_mask
)
;
delete
[]
right_son_mask
;
arr_delete
(
right_son_mask
)
;
}
}
return
most_influence_next
;
return
most_influence_next
;
};
};
...
...
src/print_circuit.h
View file @
3c636707
int
BDD_class
::
print_circuit
(
BDD_node
**
BDD
,
int
*
most_influence
,
int
node_depth
,
char
*
start_node_index_string
){
int
BDD_class
::
print_circuit
(
int
node_depth
,
char
*
start_node_index_string
){
int
i
,
j
;
int
i
,
j
;
int
zi
;
int
zi
;
...
...
src/tool_function.h
View file @
3c636707
...
@@ -28,7 +28,7 @@ int BDD_class::set_random_input_data(bool** mask_input_data){
...
@@ -28,7 +28,7 @@ int BDD_class::set_random_input_data(bool** mask_input_data){
return
0
;
return
0
;
};
};
int
BDD_class
::
mask_random_input_data
(
int
depth
,
bool
*
mask
,
int
amount
,
int
*
most_influence
,
bool
**
mask_input_data
){
int
BDD_class
::
mask_random_input_data
(
int
depth
,
bool
*
mask
,
int
amount
,
bool
**
mask_input_data
){
int
i
,
j
;
int
i
,
j
;
//#pragma omp parallel for
//#pragma omp parallel for
for
(
i
=
0
;
i
<
amount
;
i
++
){
for
(
i
=
0
;
i
<
amount
;
i
++
){
...
...
src/top.h
View file @
3c636707
#include "head.h"
#include "head.h"
//#include "io_generator/c1355
.h" //io_generator中需要包含对PI_WIDTH,PO_WIDTH的全局定义,如: extern const int PI_WIDTH = 36;
#include "io_generator/c432
.h" //io_generator中需要包含对PI_WIDTH,PO_WIDTH的全局定义,如: extern const int PI_WIDTH = 36;
//#include "io_generator_vec/c1355
_vec.h" //如果有对应Verilog, 可以在aag_to_rtl里面直接生成2个文件
#include "io_generator_vec/c432
_vec.h" //如果有对应Verilog, 可以在aag_to_rtl里面直接生成2个文件
#include "io_generator/ip-cores/combinational_circuits/c_lod.h"
//
#include "io_generator/ip-cores/combinational_circuits/c_lod.h"
#include "io_generator/ip-cores/combinational_circuits_vec/c_lod_vec.h"
//
#include "io_generator/ip-cores/combinational_circuits_vec/c_lod_vec.h"
#define INPUT_AIG //io_generator是否可以用uint按位操作进行加速,也即是否包含_vec后缀的另一个io_generator
#define INPUT_AIG //io_generator是否可以用uint按位操作进行加速,也即是否包含_vec后缀的另一个io_generator
//
#define SINGLE_BITS //io_generator是否包含每一个bit单独的io_generator_o{x}
#define SINGLE_BITS //io_generator是否包含每一个bit单独的io_generator_o{x}
#define SEARCH_PARTITION //BSD算法搜索partition策略
//
#define SEARCH_PARTITION //BSD算法搜索partition策略
#define ACCURACY_FIRST //精度优先算法
//#define ACCURACY_FIRST //精度优先算法: 慢且面积冗余大,在精度是瓶颈时使用,不作为默认选项。
extern
const
int
parameter_input_bit_width
=
PI_WIDTH
+
5
;
extern
const
int
parameter_input_bit_width
=
PI_WIDTH
+
5
;
int
parameter_output_bit_width
=
PO_WIDTH
;
int
parameter_output_bit_width
=
PO_WIDTH
;
...
...
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