Commit f8766c7e by ZhiangWang033

add fast cpp implementation

parent 5bed6913
{
"files.associations": {
"array": "cpp",
"atomic": "cpp",
"*.tcc": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"map": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"new": "cpp",
"ostream": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"typeinfo": "cpp"
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"C_Cpp.errorSquiggles": "disabled"
}
\ No newline at end of file
......@@ -6,23 +6,27 @@ int main(int argc, char* argv[]) {
std::string netlist_file = argv[1];
std::string plc_file = argv[2];
PBFNetlist design(netlist_file);
std::string new_netlist_file = netlist_file + ".new";
std::string new_netlist_file = netlist_file + ".os_cpp.txt";
design.WriteNetlist(new_netlist_file);
design.RestorePlacement(plc_file);
const float io_factor = 1.0;
const std::vector<int> num_steps { 10, 10, 10 };
const std::vector<float> attract_factor { 100, 1.0e-3, 1.0e-5 };
const std::vector<float> repel_factor { 0.0, 1.0e6, 1.0e6 };
const std::vector<int> num_steps { 100, 100, 100 };
const std::vector<float> attract_factor { 100.0, 1.0e-3, 1.0e-5 };
const std::vector<float> repel_factor { 0.0, 1.0e6, 1.0e7 };
const std::vector<float> move_distance_factor { 1.0, 1.0, 1.0 };
const bool use_current_loc = false;
const bool debug_mode = false;
const bool debug_mode = true;
auto start_timestamp_global = std::chrono::high_resolution_clock::now();
design.FDPlacer(io_factor, num_steps,
move_distance_factor,
attract_factor,
repel_factor,
use_current_loc,
debug_mode);
auto end_timestamp_global = std::chrono::high_resolution_clock::now();
double total_global_time
= std::chrono::duration_cast<std::chrono::nanoseconds>(
......@@ -30,6 +34,6 @@ int main(int argc, char* argv[]) {
.count();
total_global_time *= 1e-9;
std::cout << "Runtime of FDPlacer : " << total_global_time << std::endl;
design.WritePlcFile(plc_file + ".new");
design.WritePlcFile(plc_file + ".os_cpp.txt");
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment