void MoveWindow(t_point destination, double delta) { t_point bottom_left, top_right; bottom_left.x = destination.x - delta; bottom_left.y = destination.y - delta; top_right.x = destination.x + delta; top_right.y = destination.y + delta; t_bound_box move_coords = t_bound_box(bottom_left, top_right); set_visible_world(move_coords); }
void begin_graphics (void) { t_bound_box initial_coords = t_bound_box(0,0,100,100); init_graphics("Analytical Placer - Final View", WHITE); set_visible_world(initial_coords); std::ostringstream str_buf; str_buf << cells.size() << " cells placed with " << nets.size() << " nets"; std::string disp_str = str_buf.str(); update_message(disp_str); if(!created_button) { create_button ("Window", "Toggle Lines", act_on_toggle_nets_button); // name is UTF-8 created_button = true; } event_loop(NULL, NULL, NULL, drawscreen); //t_bound_box old_coords = get_visible_world(); //save the current view for later }
void step_graphis (double overlap_ratio, int vpin_cnt) { t_bound_box initial_coords = t_bound_box(0,0,100,100); init_graphics("Analytical Placer - verbose mode", WHITE); set_visible_world(initial_coords); std::ostringstream str_buf; str_buf << "Added " << vpin_cnt << " virtual pins; overlap ratio = " << overlap_ratio; std::string disp_str = str_buf.str(); update_message(disp_str); if(!created_button) { create_button ("Window", "Toggle Lines", act_on_toggle_nets_button); // name is UTF-8 created_button = true; } drawscreen(); event_loop(NULL, NULL, NULL, drawscreen); }
int main(int argc, char** argv) { int randomSwaps = 0; int seed = 0; if (argc < 2) { cerr << "Error: Missing filename! Use " << argv[0] << " <filename>" << std::endl; return -1; } if (argc > 3 && std::string(argv[2]) == "-swap") randomSwaps = atoi(argv[3]); if (argc > 4 && std::string(argv[2]) == "-swap") seed = atoi(argv[4]); else { std::random_device rd; seed = rd(); } parseInputFile(argv[1]); // for (auto& x : commonvars::allBlocks) // x.print(); cout << "Found " << commonvars::allBlocks.size() << " blocks." << endl; cout << "Found a max of " << commonvars::maxNetNum << " nets." << endl; init_graphics("Analytical Placer", WHITE); set_visible_world(0, 0, 1010, 1010); for (int i = 1; i <= commonvars::maxNetNum; i++) { commonvars::allNets.emplace_back(i); commonvars::allNets.back().buildBlockList(&commonvars::allBlocks); // commonvars::allNets.back().print(); } //Part 2 - random IO swaps std::mt19937 mt(seed); for (int i = 0; i < randomSwaps; i++) { doRandomSwaps(&mt); // event_loop(NULL, NULL, NULL, drawscreen); } commonvars::tempRouting.clear(); for (auto& x : commonvars::allNets) { x.buildConnections();// &commonvars::allBlocks); } initialPlace(&commonvars::allBlocks); cout << "Used "<< wireusage(&commonvars::allNets) << " units of wiring. " << endl; event_loop(NULL, NULL, NULL, drawscreen); simpleOverlap(); cout << "Used " << wireusage(&commonvars::allNets) << " units of wiring. (basic spread)" << endl; event_loop(NULL, NULL, NULL, drawscreen); #if DO_FULL_SPREADING recurseRemoveOverlap(&commonvars::allBlocks, 2); cout << "Used " << wireusage(&commonvars::allNets) << " units of wiring. (full spread)" << endl; event_loop(NULL, NULL, NULL, drawscreen); #endif return 0; }