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
33b26eea
Commit
33b26eea
authored
Apr 23, 2025
by
chengshuyao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add search order()
parent
879d8b82
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
281 additions
and
55 deletions
+281
-55
src/BSD.cpp
+216
-20
src/BSD.h
+9
-3
src/io_generator_function.h
+43
-27
src/next_layer_bit.h
+12
-4
src/zstart.sh
+1
-1
No files found.
src/BSD.cpp
View file @
33b26eea
...
@@ -21,16 +21,17 @@ using namespace std;
...
@@ -21,16 +21,17 @@ using namespace std;
//电路的parameter Circuit_parameter
//电路的parameter Circuit_parameter
int
circuit_index
=
9999
;
//电路编号
int
circuit_index
=
9999
;
//电路编号
extern
const
int
parameter_input_bit_width
=
64
;
//输入bit有几位
extern
const
int
parameter_input_bit_width
=
48
;
//输入bit有几位
extern
const
int
parameter_output_bit_width
=
1
;
//输出bit有几位
extern
const
int
parameter_output_bit_width
=
23
;
//输出bit有几位
int
parameter_test_ios
=
10000
;
//测试要求多少样本
int
parameter_test_ios
=
10000
;
//测试要求多少样本
//算法的parameter Algorithm_parameter
//算法的parameter Algorithm_parameter
extern
const
int
parameter_num_threads
=
100
;
//线程数
extern
const
int
parameter_num_threads
=
100
;
//线程数
extern
const
int
parameter_multi_output_index
=
0
;
//BSD从第几层开始化简,前面若干层展开序确定
extern
const
int
parameter_multi_output_index
=
0
;
//BSD从第几层开始化简,前面若干层展开序确定
extern
const
int
parameter_early_stop_depth
=
100
;
//BSD到第几层终止,输出此时的不准确BSD
int
parameter_early_stop_depth
=
parameter_input_bit_width
;
//BSD到第几层终止,输出此时的不准确BSD
extern
const
int
parameter_max_samples
=
40000
;
//BSD每一个节点最多进行多少次采样
extern
const
int
parameter_max_samples
=
4000
;
//BSD每一个节点最多进行多少次采样
extern
const
int
parameter_max_BDD_width
=
10000
;
//BSD每一层最多多少个节点
int
parameter_max_BDD_width
=
10000
;
//BSD每一层最多多少个节点
int
parameter_early_stop_split_nodes
=
10000
;
//BSD每一层最多多少个节点
//全局变量
//全局变量
int
GLOBAL_which_demo_function
;
int
GLOBAL_which_demo_function
;
...
@@ -45,7 +46,7 @@ int variable_order [parameter_input_bit_width];
...
@@ -45,7 +46,7 @@ int variable_order [parameter_input_bit_width];
int
variable_order_number
;
int
variable_order_number
;
int
BSD_execute
(
int
variable_order_number
,
int
*
variable_order
);
int
BSD_execute
(
int
variable_order_number
,
int
*
variable_order
);
bool
truth_table
[
1024
*
1024
];
#include"cvt.h"
#include"cvt.h"
#include"io_generator_function.h"
#include"io_generator_function.h"
...
@@ -54,26 +55,48 @@ int BSD_execute(int variable_order_number,int* variable_order);
...
@@ -54,26 +55,48 @@ int BSD_execute(int variable_order_number,int* variable_order);
#include"tool_function.h"
#include"tool_function.h"
#include"print_circuit.h"
#include"print_circuit.h"
int
main
(
int
argc
,
char
*
argv
[]){
int
tmp_BDD_depth
;
int
tmp_split_nodes
[
parameter_input_bit_width
];
void
search_order
(){};
int
main
(
int
argc
,
char
*
argv
[]){
omp_set_num_threads
(
parameter_num_threads
);
omp_set_num_threads
(
parameter_num_threads
);
GLOBAL_BDD_id_number
=
0
;
GLOBAL_BDD_id_number
=
0
;
GLOBAL_BDD_nodes
=
0
;
GLOBAL_BDD_nodes
=
0
;
GLOBAL_BDD_split_nodes
=
0
;
GLOBAL_BDD_split_nodes
=
0
;
if
(
argc
>=
2
){
GLOBAL_which_demo_function
=
atoi
(
argv
[
1
]);
}
/// if(argc>=3){
/// which_demo_function = atoi(argv[2]);
/// }else{
/// which_demo_function = 22;
/// }
int
area
=
BSD_execute
(
0
,
variable_order
);
//io generator来自真值表,不来自写好的文件
cout
<<
endl
;
//char* truth_table_name = new char [100];
cout
<<
"Design Area = "
<<
area
<<
endl
;
//int truth_table_input_width;
// if(argc >= 2){
// truth_table_input_width= atoi(argv[1]);
// }
// if(argc>=3){
// truth_table_name = argv[2];
// }
//
// ifstream truth_table_file(truth_table_name);
// string line_data;
// for(int i=0;i<pow(2,20);i++){
// truth_table[i] = 0;
// }
// for(int i=0;i<pow(2,20);i++){
// getline(truth_table_file,line_data);
// //cout<<line_data[truth_table_input_width+1]<<endl;
// if(line_data[truth_table_input_width+1]=='0')
// truth_table[i] = 0;
// else
// truth_table[i] = 1;
// }
search_order
();
};
};
int
BSD_execute
(
int
variable_order_number
,
int
*
variable_order
){
int
BSD_execute
(
int
variable_order_number
,
int
*
variable_order
){
...
@@ -83,12 +106,13 @@ int BSD_execute(int variable_order_number,int* variable_order){
...
@@ -83,12 +106,13 @@ int BSD_execute(int variable_order_number,int* variable_order){
BDD_class_main
.
BSD_variable_order_number
=
variable_order_number
;
BDD_class_main
.
BSD_variable_order_number
=
variable_order_number
;
for
(
int
i
=
0
;
i
<
variable_order_number
;
i
++
){
for
(
int
i
=
0
;
i
<
variable_order_number
;
i
++
){
BDD_class_main
.
BSD_variable_order
[
i
]
=
variable_order
[
i
];
BDD_class_main
.
BSD_variable_order
[
i
]
=
variable_order
[
i
];
cout
<<
BDD_class_main
.
BSD_variable_order
[
i
]
<<
" "
;
}
}
cout
<<
endl
;
BDD_class_main
.
start_depth
=
0
;
BDD_class_main
.
start_depth
=
0
;
BDD_class_main
.
BDD_id
=
0
;
BDD_class_main
.
BDD_id
=
0
;
GLOBAL_BDD_id_number
+=
1
;
BDD_class_main
.
how_many_start_nodes
=
parameter_output_bit_width
;
BDD_class_main
.
how_many_start_nodes
=
parameter_output_bit_width
;
BDD_class_main
.
start_nodes
=
new
BDD_node
[
BDD_class_main
.
how_many_start_nodes
];
BDD_class_main
.
start_nodes
=
new
BDD_node
[
BDD_class_main
.
how_many_start_nodes
];
for
(
int
zi
=
0
;
zi
<
BDD_class_main
.
how_many_start_nodes
;
zi
++
){
for
(
int
zi
=
0
;
zi
<
BDD_class_main
.
how_many_start_nodes
;
zi
++
){
...
@@ -102,6 +126,178 @@ int BSD_execute(int variable_order_number,int* variable_order){
...
@@ -102,6 +126,178 @@ int BSD_execute(int variable_order_number,int* variable_order){
BDD_class_main
.
BDD_width_each_layer
[
zi
]
=
0
;
BDD_class_main
.
BDD_width_each_layer
[
zi
]
=
0
;
}
}
BDD_class_main
.
BDD_FULL_PROCESS
();
BDD_class_main
.
BDD_FULL_PROCESS
();
return
BDD_class_main
.
total_split_nodes
;
for
(
int
zi
=
0
;
zi
<
parameter_input_bit_width
;
zi
++
){
variable_order
[
zi
]
=
BDD_class_main
.
most_influence
[
zi
];
tmp_split_nodes
[
zi
]
=
BDD_class_main
.
split_nodes_each_layer
[
zi
];
}
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
;
};
void
search_order
(){
ofstream
result_0
(
"result_0_20bit"
,
ios
::
app
);
ofstream
result_10
(
"result_10_20bit"
,
ios
::
app
);
ofstream
result_100
(
"result_100_20bit"
,
ios
::
app
);
ofstream
result_1000
(
"result_1000_20bit"
,
ios
::
app
);
int
best_area
=
9999999
;
int
best_area_depth
=
0
;
int
best_BDD_split_nodes
[
parameter_input_bit_width
];
int
best_variable_order
[
parameter_input_bit_width
];
int
area
;
int
mutation_depth
;
random_device
rd
;
mt19937
gen
(
rd
());
int
variable_select_time
[
parameter_input_bit_width
];
double
feature_variable
[
parameter_input_bit_width
];
for
(
int
vi
=
0
;
vi
<
parameter_input_bit_width
;
vi
++
){
variable_select_time
[
vi
]
=
0
;
}
int
best_area_0
;
int
best_area_10
;
int
best_area_100
;
int
best_area_1000
;
for
(
int
i
=
0
;
i
<
10000
;
i
++
){
if
(
i
==
1
){
result_0
<<
best_area
<<
endl
;
best_area_0
=
best_area
;
}
else
if
(
i
==
11
){
result_10
<<
best_area
<<
endl
;
best_area_10
=
best_area
;
if
(
best_area_10
==
best_area_0
){
i
=
90
;
}
}
else
if
(
i
==
101
){
result_100
<<
best_area
<<
endl
;
best_area_100
=
best_area
;
if
(
best_area_100
==
best_area_10
){
i
=
990
;
}
}
else
if
(
i
==
999
){
result_1000
<<
best_area
<<
endl
;
}
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
);
}
int
min_feature
=
9999999
;
cout
<<
"Mutation Depth:"
<<
mutation_depth
<<
endl
;
for
(
int
vi
=
0
;
vi
<
mutation_depth
;
vi
++
){
variable_order
[
vi
]
=
best_variable_order
[
vi
];
feature_variable
[
variable_order
[
vi
]]
=
9999999
;
cout
<<
variable_order
[
vi
]
<<
" "
;
}
cout
<<
endl
;
int
learning_rate
;
if
(
i
<
10000
)
learning_rate
=
int
((
10000
-
i
)
/
1000
);
else
learning_rate
=
1
;
if
(
mutation_depth
>
learning_rate
){
if
(
i
%
2
==
0
){
for
(
int
vi
=
0
;
vi
<
learning_rate
;
vi
++
){
int
num_a
=
gen
()
%
int
(
mutation_depth
);
int
num_b
=
gen
()
%
int
(
mutation_depth
);
int
x
=
variable_order
[
num_a
];
variable_order
[
num_a
]
=
variable_order
[
num_b
];
variable_order
[
num_b
]
=
x
;
}
}
else
{
for
(
int
vi
=
0
;
vi
<
learning_rate
;
vi
++
){
int
num_a
=
gen
()
%
int
(
mutation_depth
);
int
num_b
=
(
num_a
!=
mutation_depth
-
1
)
?
(
num_a
+
1
)
:
(
num_a
-
1
);
int
x
=
variable_order
[
num_a
];
variable_order
[
num_a
]
=
variable_order
[
num_b
];
variable_order
[
num_b
]
=
x
;
}
}
}
else
{
for
(
int
vi
=
0
;
vi
<
mutation_depth
;
vi
++
){
int
num_a
=
gen
()
%
int
(
mutation_depth
);
int
num_b
=
gen
()
%
int
(
mutation_depth
);
int
x
=
variable_order
[
num_a
];
variable_order
[
num_a
]
=
variable_order
[
num_b
];
variable_order
[
num_b
]
=
x
;
}
}
//for(int j=mutation_depth;j<parameter_input_bit_width;j++){
// for (int vi=0;vi<parameter_input_bit_width;vi++){
// if(feature_variable[vi]<min_feature){
// min_feature = feature_variable[vi];
// variable_order[j] = vi;
// }
// }
// min_feature = 9999999;
// feature_variable[variable_order[j]] = 9999999;
//}
if
(
i
==
0
)
area
=
BSD_execute
(
0
,
variable_order
);
else
area
=
BSD_execute
(
mutation_depth
,
variable_order
);
for
(
int
vi
=
0
;
vi
<
tmp_BDD_depth
;
vi
++
){
variable_select_time
[
variable_order
[
vi
]]
+=
1
;
}
if
(
area
<
best_area
){
best_area
=
area
;
best_area_depth
=
tmp_BDD_depth
;
for
(
int
vi
=
0
;
vi
<
tmp_BDD_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
+
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
);
};
};
src/BSD.h
View file @
33b26eea
...
@@ -135,6 +135,8 @@ public:
...
@@ -135,6 +135,8 @@ public:
int
BSD_variable_order
[
parameter_input_bit_width
];
int
BSD_variable_order
[
parameter_input_bit_width
];
int
BSD_variable_order_number
;
int
BSD_variable_order_number
;
int
*
split_nodes_each_layer
;
BDD_class
(){
BDD_class
(){
most_influence
=
new
int
[
parameter_input_bit_width
];
most_influence
=
new
int
[
parameter_input_bit_width
];
BDD_width_each_layer
=
new
int
[
parameter_input_bit_width
+
1
];
BDD_width_each_layer
=
new
int
[
parameter_input_bit_width
+
1
];
...
@@ -155,6 +157,8 @@ public:
...
@@ -155,6 +157,8 @@ public:
left_mask_output_data_all
=
new
bool
[
long
(
parameter_max_BDD_width
)
*
long
(
parameter_max_samples
)];
left_mask_output_data_all
=
new
bool
[
long
(
parameter_max_BDD_width
)
*
long
(
parameter_max_samples
)];
right_mask_output_data_all
=
new
bool
[
long
(
parameter_max_BDD_width
)
*
long
(
parameter_max_samples
)];
right_mask_output_data_all
=
new
bool
[
long
(
parameter_max_BDD_width
)
*
long
(
parameter_max_samples
)];
split_nodes_each_layer
=
new
int
[
parameter_input_bit_width
+
1
];
};
};
...
@@ -189,7 +193,7 @@ bool* BDD_class::io_generator(bool input_data[parameter_input_bit_width],bool* o
...
@@ -189,7 +193,7 @@ bool* BDD_class::io_generator(bool input_data[parameter_input_bit_width],bool* o
bool
BDD_class
::
io_generator_single
(
bool
input_data
[
parameter_input_bit_width
],
int
which_bit_output
){
bool
BDD_class
::
io_generator_single
(
bool
input_data
[
parameter_input_bit_width
],
int
which_bit_output
){
bool
output_bit
;
bool
output_bit
;
bool
*
output_bits
=
new
bool
[
2
*
parameter_input_bit_width
];
bool
*
output_bits
=
new
bool
[
64
*
5
];
output_bits
=
io_generator
(
input_data
,
output_bits
);
output_bits
=
io_generator
(
input_data
,
output_bits
);
output_bit
=
output_bits
[
which_bit_output
]
;
output_bit
=
output_bits
[
which_bit_output
]
;
delete
[]
output_bits
;
delete
[]
output_bits
;
...
@@ -319,7 +323,7 @@ int BDD_class::train_BDD(BDD_node** BDD,int* most_influence,int start_depth, int
...
@@ -319,7 +323,7 @@ int BDD_class::train_BDD(BDD_node** BDD,int* most_influence,int start_depth, int
BDD_partition
[
zi
].
BDD_width_each_layer
[
zj
]
=
BDD_width_each_layer
[
zj
];
BDD_partition
[
zi
].
BDD_width_each_layer
[
zj
]
=
BDD_width_each_layer
[
zj
];
}
}
//if(!this_is_BDD_temp){
//if(!this_is_BDD_temp){
BDD_partition
[
zi
].
partition_depth
=
partition_depth
+
11
;
BDD_partition
[
zi
].
partition_depth
=
100000
;
}
}
// for (zj=0;zj<parameter_max_samples;zj++){
// for (zj=0;zj<parameter_max_samples;zj++){
...
@@ -475,7 +479,7 @@ int BDD_class::train_BDD(BDD_node** BDD,int* most_influence,int start_depth, int
...
@@ -475,7 +479,7 @@ int BDD_class::train_BDD(BDD_node** BDD,int* most_influence,int start_depth, int
break
;
break
;
}
}
}
}
if
((
i
==
(
parameter_early_stop_depth
-
1
))
&&
(
which_BDD
==
0
)
||
((
i
==
(
parameter_early_stop_depth
-
1
))
&&
(
which_BDD
==
1
))){
if
((
i
==
(
parameter_early_stop_depth
-
1
))
&&
(
which_BDD
==
0
)
||
((
i
==
(
parameter_early_stop_depth
-
1
))
&&
(
which_BDD
==
1
))
||
(
total_split_nodes
>
parameter_early_stop_split_nodes
)
){
if
(
left_mask_output_data_sum
>
(
BSD_samples
/
2
)){
if
(
left_mask_output_data_sum
>
(
BSD_samples
/
2
)){
all_one_left
=
1
;
all_one_left
=
1
;
all_zero_left
=
0
;
all_zero_left
=
0
;
...
@@ -700,6 +704,8 @@ int BDD_class::train_BDD(BDD_node** BDD,int* most_influence,int start_depth, int
...
@@ -700,6 +704,8 @@ int BDD_class::train_BDD(BDD_node** BDD,int* most_influence,int start_depth, int
cout
<<
root_nodes_leafs
[
zi
]
<<
" "
;
cout
<<
root_nodes_leafs
[
zi
]
<<
" "
;
}
}
cout
<<
endl
;
cout
<<
endl
;
split_nodes_each_layer
[
i
]
=
total_split_nodes
;
cout
<<
"BSD "
<<
BDD_id
<<
" nodes = "
<<
total_nodes_amount
<<
endl
;
cout
<<
"BSD "
<<
BDD_id
<<
" nodes = "
<<
total_nodes_amount
<<
endl
;
cout
<<
"BSD "
<<
BDD_id
<<
" split nodes = "
<<
total_split_nodes
;
cout
<<
"BSD "
<<
BDD_id
<<
" split nodes = "
<<
total_split_nodes
;
...
...
src/io_generator_function.h
View file @
33b26eea
...
@@ -28,41 +28,57 @@ bool* io_generator_alu_function_5(bool* input_data,bool* output_data);
...
@@ -28,41 +28,57 @@ bool* io_generator_alu_function_5(bool* input_data,bool* output_data);
bool
*
io_generator_cpu_function_1
(
bool
*
input_data
,
bool
*
output_data
);
//add_shift
bool
*
io_generator_cpu_function_1
(
bool
*
input_data
,
bool
*
output_data
);
//add_shift
#include"io_generator/cpp_comb/parallel_serial_16.h"
bool
*
io_generator_function
(
bool
input_data
[
parameter_input_bit_width
],
int
which_demo_function
,
bool
*
output_data
)
{
bool
*
io_generator_function
(
bool
input_data
[
parameter_input_bit_width
],
int
which_demo_function
,
bool
*
output_data
)
{
//bool* output_data = new bool [parameter_input_bit_width*2];
//bool* output_data = new bool [parameter_input_bit_width*2];
int
i
,
j
;
int
i
,
j
;
for
(
i
=
0
;
i
<
parameter_
input_bit_width
*
2
;
i
++
){
for
(
i
=
0
;
i
<
parameter_
output_bit_width
;
i
++
){
output_data
[
i
]
=
0
;
output_data
[
i
]
=
0
;
}
}
switch
(
which_demo_function
){
///if(which_demo_function!=9999){
case
0
:
io_generator_single_function_0
(
input_data
,
output_data
);
break
;
/// switch(which_demo_function){
case
1
:
io_generator_single_function_1
(
input_data
,
output_data
);
break
;
/// case 0: io_generator_single_function_0 (input_data,output_data);break;
case
2
:
io_generator_single_function_2
(
input_data
,
output_data
);
break
;
/// case 1: io_generator_single_function_1 (input_data,output_data);break;
case
3
:
io_generator_single_function_3
(
input_data
,
output_data
);
break
;
/// case 2: io_generator_single_function_2 (input_data,output_data);break;
case
4
:
io_generator_single_function_4
(
input_data
,
output_data
);
break
;
/// case 3: io_generator_single_function_3 (input_data,output_data);break;
case
5
:
io_generator_single_function_5
(
input_data
,
output_data
);
break
;
/// case 4: io_generator_single_function_4 (input_data,output_data);break;
case
6
:
io_generator_single_function_6
(
input_data
,
output_data
);
break
;
/// case 5: io_generator_single_function_5 (input_data,output_data);break;
case
7
:
io_generator_single_function_7
(
input_data
,
output_data
);
break
;
/// case 6: io_generator_single_function_6 (input_data,output_data);break;
case
8
:
io_generator_single_function_8
(
input_data
,
output_data
);
break
;
/// case 7: io_generator_single_function_7 (input_data,output_data);break;
case
9
:
io_generator_single_function_9
(
input_data
,
output_data
);
break
;
/// case 8: io_generator_single_function_8 (input_data,output_data);break;
case
10
:
io_generator_single_function_10
(
input_data
,
output_data
);
break
;
/// case 9: io_generator_single_function_9 (input_data,output_data);break;
case
11
:
io_generator_single_function_11
(
input_data
,
output_data
);
break
;
/// case 10: io_generator_single_function_10(input_data,output_data);break;
case
12
:
io_generator_single_function_12
(
input_data
,
output_data
);
break
;
/// case 11: io_generator_single_function_11(input_data,output_data);break;
case
13
:
io_generator_single_function_13
(
input_data
,
output_data
);
break
;
/// case 12: io_generator_single_function_12(input_data,output_data);break;
case
14
:
io_generator_single_function_14
(
input_data
,
output_data
);
break
;
/// case 13: io_generator_single_function_13(input_data,output_data);break;
case
15
:
io_generator_single_function_15
(
input_data
,
output_data
);
break
;
/// case 14: io_generator_single_function_14(input_data,output_data);break;
case
16
:
io_generator_alu_function_1
(
input_data
,
output_data
);
break
;
/// case 15: io_generator_single_function_15(input_data,output_data);break;
case
17
:
io_generator_alu_function_2
(
input_data
,
output_data
);
break
;
/// case 16: io_generator_alu_function_1 (input_data,output_data);break;
case
18
:
io_generator_alu_function_3
(
input_data
,
output_data
);
break
;
/// case 17: io_generator_alu_function_2 (input_data,output_data);break;
case
19
:
io_generator_alu_function_4
(
input_data
,
output_data
);
break
;
/// case 18: io_generator_alu_function_3 (input_data,output_data);break;
case
20
:
io_generator_alu_function_5
(
input_data
,
output_data
);
break
;
/// case 19: io_generator_alu_function_4 (input_data,output_data);break;
case
21
:
io_generator_single_function_mul
(
input_data
,
output_data
);
break
;
/// case 20: io_generator_alu_function_5 (input_data,output_data);break;
case
22
:
io_generator_single_function_fp32_add
(
input_data
,
output_data
);
break
;
/// case 21: io_generator_single_function_mul(input_data,output_data);break;
}
/// case 22: io_generator_single_function_fp32_add(input_data,output_data);break;
/// }
///}
///else{
/// io_generator_outer(input_data,output_data);
/// //long data = cvt_bit_to_number_unsigned(input_data,parameter_input_bit_width);
/// //for(i=0;i<parameter_output_bit_width;i++){
/// // output_data[i] = truth_table[data];
/// //}
///}
io_generator_outer
(
input_data
,
output_data
);
//long data = cvt_bit_to_number_unsigned(input_data,parameter_input_bit_width);
// for(i=0;i<parameter_output_bit_width;i++){
// output_data[i] = truth_table[data];
// }
//bool* reg_data_a = new bool [parameter_CPU_data_width];
//bool* reg_data_a = new bool [parameter_CPU_data_width];
//bool* reg_data_b = new bool [parameter_CPU_data_width];
//bool* reg_data_b = new bool [parameter_CPU_data_width];
//
//
...
...
src/next_layer_bit.h
View file @
33b26eea
...
@@ -116,9 +116,13 @@ int BDD_class::next_bit_layer_single(int depth,int which_node_this_layer){
...
@@ -116,9 +116,13 @@ int BDD_class::next_bit_layer_single(int depth,int which_node_this_layer){
int
BDD_class
::
next_bit_layer
(
int
depth
){
int
BDD_class
::
next_bit_layer
(
int
depth
){
cout
<<
depth
<<
" "
<<
BSD_variable_order_number
<<
endl
;
if
(
depth
<
BSD_variable_order_number
)
if
(
depth
<
BSD_variable_order_number
){
most_influence
[
depth
]
=
BSD_variable_order
[
depth
];
has_been_unfold
[
most_influence
[
depth
]]
=
1
;
cout
<<
most_influence
[
depth
]
<<
endl
;
return
BSD_variable_order
[
depth
];
return
BSD_variable_order
[
depth
];
}
else
else
return
next_bit_layer_0
(
depth
);
return
next_bit_layer_0
(
depth
);
}
}
...
@@ -353,7 +357,7 @@ int BDD_class::next_bit_layer_0(int depth){
...
@@ -353,7 +357,7 @@ int BDD_class::next_bit_layer_0(int depth){
}
}
}
}
int
BSD_samples_influence
=
BSD_samples_influence_max
;
int
BSD_samples_influence
=
BSD_samples_influence_max
;
for
(
zz
=
0
;
zz
<
1
;
zz
++
){
for
(
zz
=
0
;
zz
<
1
00
;
zz
++
){
if
(
depth
<
parameter_multi_output_index
){
if
(
depth
<
parameter_multi_output_index
){
break
;
break
;
}
}
...
@@ -416,7 +420,11 @@ int BDD_class::next_bit_layer_0(int depth){
...
@@ -416,7 +420,11 @@ int BDD_class::next_bit_layer_0(int depth){
}
}
}
}
//USE_THIS:RANDOM
//USE_THIS:RANDOM
//amount_turn[i] += gen();
//if(i<64)
// amount_turn[i] = gen()%100;
//else
// amount_turn[i] = 0;
if
((
amount_turn
[
i
]
>
40
)
&&
((
zz
*
BSD_samples_influence
-
amount_turn
[
i
])
>
40
)){
if
((
amount_turn
[
i
]
>
40
)
&&
((
zz
*
BSD_samples_influence
-
amount_turn
[
i
])
>
40
)){
finish_influence_sample
=
1
;
finish_influence_sample
=
1
;
}
}
...
...
src/zstart.sh
View file @
33b26eea
...
@@ -3,4 +3,4 @@ export LIBRARY_PATH=/lustre/S/chengshuyao/haoshiming/anaconda3/envs/BSD/bin:/lus
...
@@ -3,4 +3,4 @@ export LIBRARY_PATH=/lustre/S/chengshuyao/haoshiming/anaconda3/envs/BSD/bin:/lus
export
LD_LIBRARY_PATH
=
/lustre/S/chengshuyao/haoshiming/anaconda3/envs/BSD/bin:/lustre/S/chengshuyao/haoshiming/anaconda3/envs/BSD/lib
export
LD_LIBRARY_PATH
=
/lustre/S/chengshuyao/haoshiming/anaconda3/envs/BSD/bin:/lustre/S/chengshuyao/haoshiming/anaconda3/envs/BSD/lib
rm rtl/
*
rm rtl/
*
g++ BSD.cpp
-O3
-std
=
c++11
-fopenmp
-pg
g++ BSD.cpp
-O3
-std
=
c++11
-fopenmp
-pg
./a.out
2
./a.out
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