//printf("worker %d: area %d on gate type %d and depth %d larger then best area %d continueing\n",data->worker_id,current_circuit->area,i,depth,data->best_area);
current_circuit->gates[depth].gate = &gate_types[i]; //set pointer to the type of gate
current_circuit->gates[depth].in1 = in1;
current_circuit->gates[depth].in2 = in2;
current_circuit->gate_count = depth + 1;
int tautology = detect_tautology(current_circuit,in1,in2,i,data); //0: nothing found, 1: direct tautology, 2:unconnected device may still be connected.
if(tautology==1){
continue; //Found already unnecessary combo and should skip it
current_circuit->area += gate_types[i].area; // Example area increment (modify as needed)
if(data->num_circuit[0]%1000000000 == 0){
data->num_circuit[1] += 1;
data->num_circuit[0] = 0;
printf("%d:At circuit number %d M current best_area %d and tested area %d\n",data->worker_id,data->num_circuit[1],data->best_area,current_circuit->area);
//printf("worker %d: area %d on gate type %d and depth %d larger then best area %d continueing\n",data->worker_id,current_circuit->area,i,depth,data->best_area);
- int tautology = detect_tautology(current_circuit,in1,in2,in3,i,data); //0: nothing found, 1: direct tautology, 2:unconnected device may still be connected.
- if(tautology==1){
- continue; //Found already unnecessary combo and should skip it
- }
+ int tautology = detect_tautology(current_circuit,in1,in2,in3,in4,i,data); //0: nothing found, 1: direct tautology, 2:unconnected device may still be connected.
+ if(tautology==1){
+ continue; //Found already unnecessary combo and should skip it
+ }
- int valid = 0;
+ int valid = 0;
- if(tautology!=2){ //There is an unconnected gate if this holds true
- valid = 1;
- int8_t output[NUM_OUTPUTS];
- for (int y=0; y < (1 << data->num_inputs); y++){ //CHECK IF IT IS VALID
- current_circuit->area += gate_types[i].area; // Example area increment (modify as needed)
-
- if(data->num_circuit[0]%1000000000 == 0){
- data->num_circuit[1] += 1;
- data->num_circuit[0] = 0;
- printf("%d:At circuit number %d M current best_area %d and tested area %d\n",data->worker_id,data->num_circuit[1],data->best_area,current_circuit->area);
- }
+ //valid circuit add area
+ current_circuit->area += gate_types[i].area; // Example area increment (modify as needed)
+
+ if(data->num_circuit[0]%1000000000 == 0){
+ data->num_circuit[1] += 1;
+ data->num_circuit[0] = 0;
+ printf("%d:At circuit number %d M current best_area %d and tested area %d\n",data->worker_id,data->num_circuit[1],data->best_area,current_circuit->area);
//printf("worker %d: area %d on gate type %d and depth %d larger then best area %d continueing\n",data->worker_id,current_circuit->area,i,depth,data->best_area);
int tautology = detect_tautology(current_circuit,in1,in2,in3,i,data); //0: nothing found, 1: direct tautology, 2:unconnected device may still be connected.
if(tautology==1){
continue; //Found already unnecessary combo and should skip it
}
int valid = 0;
if(tautology!=2){ //There is an unconnected gate if this holds true
valid = 1;
int8_t output[NUM_OUTPUTS];
for (int y=0; y < (1 << data->num_inputs); y++){ //CHECK IF IT IS VALID
current_circuit->area += gate_types[i].area; // Example area increment (modify as needed)
if(data->num_circuit[0]%1000000000 == 0){
data->num_circuit[1] += 1;
data->num_circuit[0] = 0;
printf("%d:At circuit number %d M current best_area %d and tested area %d\n",data->worker_id,data->num_circuit[1],data->best_area,current_circuit->area);