Skip to content

Commit 39e0cf6

Browse files
committed
Removing commented out code
1 parent 26213f9 commit 39e0cf6

File tree

1 file changed

+1
-175
lines changed

1 file changed

+1
-175
lines changed

parmys/parmys-plugin/core/subtractor.cc

Lines changed: 1 addition & 175 deletions
Original file line numberDiff line numberDiff line change
@@ -565,14 +565,6 @@ void split_adder_for_sub(nnode_t *nodeo, int a, int b, int sizea, int sizeb, int
565565
}
566566
}
567567

568-
//if(nodeo->output_pins[nodeo->num_output_pins - 1] == allocate_npin()) {
569-
// npin_t* p = allocate_npin();
570-
// add_output_pin_to_node(nodeo, p, nodeo->num_output_pins - 1);
571-
// nodeo->output_pins[nodeo->num_output_pins - 1] = p;
572-
//}
573-
// int W = nodeo->num_output_pins - 1;
574-
// int sums_mapped = 0;
575-
576568

577569
if (count > 1 || configuration.adder_cin_global) {
578570
// remap the output pins of each adder to nodeo
@@ -589,179 +581,13 @@ void split_adder_for_sub(nnode_t *nodeo, int a, int b, int sizea, int sizeb, int
589581
}
590582
}
591583
}
592-
//remap_pin_to_new_node(nodeo->output_pins[nodeo->num_output_pins - 1], node[count - 1], 1);
593584
}
594585
node[count - 1]->output_pins[0] = allocate_npin();
595-
596-
597-
// const int W = nodeo->num_output_pins - 1; // number of sum bits
598-
// // 1) Map sums from all real slices EXCEPT the last slice (tail)
599-
// int sums = 0;
600-
// for (int i = offset; i < count - 1 && sums < W; ++i) {
601-
// const int sum_pins = node[i]->num_output_pins - 1; // skip pin0=cout
602-
// for (int j = 0; j < sum_pins && sums < W; ++j) {
603-
// int out_idx = /* pack densely or keep your spacing */ sums;
604-
// remap_pin_to_new_node(nodeo->output_pins[out_idx], node[i], /*from pin*/ j + 1);
605-
// nodeo->output_pins[out_idx] = NULL;
606-
607-
// // Optional: if remap nulls source slot, pad it to keep iteration safe later
608-
// if (node[i]->output_pins[j + 1] == nullptr) {
609-
// node[i]->output_pins[j + 1] = allocate_npin();
610-
// node[i]->output_pins[j + 1]->name =
611-
// append_string("", "%s~dummy_sum~%d~%d", node[i]->name, i, j + 1);
612-
// }
613-
// ++sums;
614-
// }
615-
// }
616-
// if (count > 0) {
617-
// remap_pin_to_new_node(nodeo->output_pins[W], node[count - 1], 1);
618-
// nodeo->output_pins[W] = NULL;
619-
// }
620-
// node[count - 1]->output_pins[0] = allocate_npin();
621-
//printf("Net of tail node: %s\n", node[5]->output_pins[1]->net);
622-
//std::cout << "TESTING " << node[5]->output_pins[1]->net->fanout_pins << "\n";
623-
//std::cout << "TESTING " << node[3]->output_pins[1]->net->fanout_pins << "\n";
624-
//remap_pin_to_new_node(nodeo->output_pins[nodeo->num_output_pins - 1], node[count - 1], 0);
625586
// Pad outputs with a unique and descriptive name to avoid collisions.
626587
node[count - 1]->output_pins[0]->name = append_string("", "%s~dummy_output~%d~%d", node[(count - 1)]->name, (count - 1), 0);
627588
// connect_nodes(node[count - 1], (node[(count - 1)]->num_output_pins - 1), netlist->gnd_node, 0);
628589
// }
629-
630-
// for (int k = 0; k < nodeo->num_output_pins; ++k) {
631-
// oassert(nodeo->output_pins[k] == NULL);
632-
// }
633-
634-
// for (int i = 1; i < count; ++i) {
635-
// for (int p = 0; p < node[i]->num_output_pins; ++p) {
636-
// if(i == 5 && p ==0) continue;
637-
// oassert(node[i]->output_pins[p] != NULL);
638-
// oassert(node[i]->output_pins[p]->net != NULL);
639-
// oassert(node[i]->output_pins[p]->type == OUTPUT);
640-
// oassert(node[i]->output_pins[p]->node == node[i]);
641-
// oassert(node[i]->output_pins[p]->pin_node_idx == p);
642-
// }
643-
// }
644-
645-
// for (int i = offset; i < count-1; ++i)
646-
// oassert(node[i]->output_pins[1]->net->num_driver_pins == 1);
647-
// oassert(node[count-1]->output_pins[1]->net->num_driver_pins == 1); // MSB via sumout
648-
649-
// static const char* pin_role(const nnode_t* n, int pidx) {
650-
// // adder: pin 0 = cout, 1 = sumout. For other nodes, return an empty tag.
651-
// if (n && n->name && strstr(n->name, "adder")) {
652-
// return pidx == 0 ? "cout" : (pidx == 1 ? "sum" : "?");
653-
// }
654-
// return "";
655-
// }
656-
657-
// int po_count = netlist->num_top_output_nodes;
658-
659-
// for(int k = 0; k < po_count; k++) { //move through each primary output node
660-
// nnode_t* po = netlist->top_output_nodes[k]; //po is PO[k]
661-
// oassert(po);
662-
// oassert(po->num_input_pins >= 1);
663-
// npin_t* in = po->input_pins[0]; //in is input pin to po
664-
// char tag[64]; snprintf(tag, sizeof(tag), "PO[%d] %s.in0", k, po->name ? po->name : "out");
665-
666-
// oassert(in && in->net);
667-
// oassert(in->net->num_driver_pins == 1);
668-
669-
// npin_t* d = in->net->driver_pins[0]; //d is the driver pin to in
670-
// oassert(d && d->node);
671-
// char* role;
672-
// if(d->node && d->node->name && strstr(d->node->name, "adder")){
673-
// if(d->pin_node_idx == 0) role = "cout";
674-
// else if(d->pin_node_idx == 1) role = "sum";
675-
// else role = "?";
676-
// }
677-
// fprintf(stderr, " -> driven by %s pin %d (%s)\n",
678-
// d->node->name ? d->node->name : "(noname)",
679-
// d->pin_node_idx,
680-
// role);
681-
// }
682-
683-
// oassert(netlist->num_top_output_nodes == 5);
684-
// for (int k = 0; k < 5; ++k) {
685-
// nnode_t* po = netlist->top_output_nodes[k];
686-
// oassert(po && po->num_input_pins >= 1);
687-
// npin_t* in = po->input_pins[0];
688-
// oassert(in && in->net && in->net->num_driver_pins == 1);
689-
690-
// // Optional: ensure the driver is the expected slice pin:
691-
// npin_t* drv = in->net->driver_pins[0];
692-
// oassert(drv && drv->node);
693-
// // k=0..3 → slice [offset+k] pin1 (sumout), k=4 → tail pin1 (sumout)
694-
// }
695-
696-
//Create 1-to-1 identity node between drivers of PO nets and PO nodes to allow ABC to see POs
697-
// for (int i = 0; i < netlist->num_top_output_nodes; i++) {
698-
// nnode_t* po_node = netlist->top_output_nodes[i];
699-
// oassert(po_node && po_node->num_input_pins >= 1);
700-
// npin_t* po_in = po_node->input_pins[0];
701-
// oassert(po_in && po_in->net);
702-
// nnet_t* po_net = po_in->net;
703-
// oassert(po_net->num_driver_pins == 1);
704-
// npin_t* po_driver = po_net->driver_pins[0];
705-
// const char* out_name = po_net->name ? po_net->name : "out";
706-
707-
// nnet_t* id_net = allocate_nnet();
708-
// id_net->name = append_string("", "%s_id_net", out_name);
709-
710-
// remap_pin_to_new_net(po_driver, id_net);
711-
712-
// //identity node
713-
// nnode_t* id_node = make_1port_gate(BUF_NODE, 1, 1, po_node, (short)-1);
714-
// id_node->name = append_string("", "%s_abc_anchor", out_name);
715-
// npin_t* id_in = allocate_npin();
716-
// add_input_pin_to_node(id_node, id_in, 0);
717-
// add_fanout_pin_to_net(id_net, id_in);
718-
// npin_t* id_out = allocate_npin();
719-
// add_output_pin_to_node(id_node, id_out, 0);
720-
// add_driver_pin_to_net(po_net, id_out);
721-
722-
// oassert(id_net->num_driver_pins == 1);
723-
// oassert(po_net->num_driver_pins == 1);
724-
// }
725-
// for (int i = 0; i < netlist->num_top_output_nodes; i++) {
726-
// nnode_t* po_node = netlist->top_output_nodes[i];
727-
// oassert(po_node && po_node->num_input_pins >= 1);
728-
// npin_t* po_in = po_node->input_pins[0];
729-
// oassert(po_in && po_in->net);
730-
// nnet_t* po_net = po_in->net;
731-
// oassert(po_net->num_driver_pins == 1);
732-
// npin_t* po_driver = po_net->driver_pins[0];
733-
// const char* out_name = po_net->name ? po_net->name : "out";
734-
735-
// nnet_t* id_net = allocate_nnet();
736-
// id_net->name = append_string("", "%s_id_net", out_name);
737-
738-
// remap_pin_to_new_net(po_driver, id_net);
739-
740-
// //identity NOT nodes
741-
// nnode_t* n1 = make_not_gate(po_node, (short)-1);
742-
// n1->name = append_string("", "%s_abc_anchor_n1", out_name);
743-
744-
// nnet_t* id_net2 = allocate_nnet();
745-
// id_net2->name = append_string("", "%s_id_net2", out_name);
746-
747-
// npin_t* n1_in = allocate_npin(); add_input_pin_to_node(n1, n1_in, 0); add_fanout_pin_to_net(id_net, n1_in);
748-
// npin_t* n1_out = allocate_npin(); add_output_pin_to_node(n1, n1_out, 0); add_driver_pin_to_net(id_net2, n1_out);
749-
750-
// // 3) Second NOT: id_net2 -> n2 -> po_net (n2 becomes the new driver of po_net)
751-
// nnode_t* n2 = make_not_gate(po_node, (short)-1);
752-
// n2->name = append_string("", "%s_abc_anchor_n2", out_name);
753-
754-
// npin_t* n2_in = allocate_npin(); add_input_pin_to_node(n2, n2_in, 0); add_fanout_pin_to_net(id_net2, n2_in);
755-
// npin_t* n2_out = allocate_npin(); add_output_pin_to_node(n2, n2_out, 0); add_driver_pin_to_net(po_net, n2_out);
756-
757-
// // 4) Sanity
758-
// oassert(id_net->num_driver_pins == 1);
759-
// oassert(id_net2->num_driver_pins == 1);
760-
// oassert(po_net->num_driver_pins == 1);
761-
// oassert(po_net->driver_pins[0]->node == n2);
762-
// }
763-
764-
590+
765591
/* Freeing the old node! */
766592
cleanup_sub_old_node(nodeo, netlist);
767593

0 commit comments

Comments
 (0)