Commit a04eedcc by ZhiangWang033

add cost curve

parent cafbcdea
......@@ -60,16 +60,6 @@ cassert
basic_object.h
/home/zf4_projects/macro_placer/TILOS_repo/new_repo/MacroPlacement/CodeElements/SimulatedAnnealing/src/basic_object.h
/home/zf4_projects/macro_placer/TILOS_repo/new_repo/MacroPlacement/CodeElements/SimulatedAnnealing/src/main.cpp
iostream
-
chrono
-
sstream
-
plc_netlist.h
/home/zf4_projects/macro_placer/TILOS_repo/new_repo/MacroPlacement/CodeElements/SimulatedAnnealing/src/plc_netlist.h
/home/zf4_projects/macro_placer/TILOS_repo/new_repo/MacroPlacement/CodeElements/SimulatedAnnealing/src/net.h
vector
-
......@@ -134,72 +124,6 @@ grid.h
plc_object.h
/home/zf4_projects/macro_placer/TILOS_repo/new_repo/MacroPlacement/CodeElements/SimulatedAnnealing/src/plc_object.h
/home/zf4_projects/macro_placer/TILOS_repo/new_repo/MacroPlacement/CodeElements/SimulatedAnnealing/src/plc_netlist_cost.cpp
iostream
-
map
-
vector
-
string
-
fstream
-
iomanip
-
algorithm
-
cmath
-
numeric
-
plc_netlist.h
/home/zf4_projects/macro_placer/TILOS_repo/new_repo/MacroPlacement/CodeElements/SimulatedAnnealing/src/plc_netlist.h
/home/zf4_projects/macro_placer/TILOS_repo/new_repo/MacroPlacement/CodeElements/SimulatedAnnealing/src/plc_netlist_fd_placer.cpp
iostream
-
map
-
vector
-
string
-
fstream
-
iomanip
-
algorithm
-
cmath
-
numeric
-
plc_netlist.h
/home/zf4_projects/macro_placer/TILOS_repo/new_repo/MacroPlacement/CodeElements/SimulatedAnnealing/src/plc_netlist.h
/home/zf4_projects/macro_placer/TILOS_repo/new_repo/MacroPlacement/CodeElements/SimulatedAnnealing/src/plc_netlist_io.cpp
iostream
-
map
-
vector
-
string
-
fstream
-
iomanip
-
algorithm
-
cmath
-
numeric
-
plc_netlist.h
/home/zf4_projects/macro_placer/TILOS_repo/new_repo/MacroPlacement/CodeElements/SimulatedAnnealing/src/plc_netlist.h
/home/zf4_projects/macro_placer/TILOS_repo/new_repo/MacroPlacement/CodeElements/SimulatedAnnealing/src/plc_netlist_sa.cpp
iostream
-
......@@ -222,28 +146,6 @@ numeric
plc_netlist.h
/home/zf4_projects/macro_placer/TILOS_repo/new_repo/MacroPlacement/CodeElements/SimulatedAnnealing/src/plc_netlist.h
/home/zf4_projects/macro_placer/TILOS_repo/new_repo/MacroPlacement/CodeElements/SimulatedAnnealing/src/plc_object.cpp
iostream
-
map
-
vector
-
string
-
fstream
-
iomanip
-
algorithm
-
cmath
-
numeric
-
plc_object.h
/home/zf4_projects/macro_placer/TILOS_repo/new_repo/MacroPlacement/CodeElements/SimulatedAnnealing/src/plc_object.h
/home/zf4_projects/macro_placer/TILOS_repo/new_repo/MacroPlacement/CodeElements/SimulatedAnnealing/src/plc_object.h
vector
-
......
......@@ -453,6 +453,11 @@ void PBFNetlist::SimulatedAnnealing(std::vector<float> action_probs,
float cur_cost = 0.0;
std::vector<float> cost_list; // we need to plot the cost curve
CallFDPlacer();
std::ofstream f;
f.open(summary_file);
f.close();
for (int num_iter = 0; num_iter < num_iters; num_iter++) {
// call FDPlacer to update the cost
CallFDPlacer();
......@@ -472,13 +477,23 @@ void PBFNetlist::SimulatedAnnealing(std::vector<float> action_probs,
}
cost_list.push_back(cur_cost);
}
if ((num_iter + 1) % 5 == 0) {
f.open(summary_file, std::ios::out | std::ios::app);
for (auto& value : cost_list)
f << value << std::endl;
f.close();
cost_list.clear();
}
// update the temperature
t = max_temperature * std::exp(t_factor * num_iter / num_iters);
}
std::ofstream f;
f.open(summary_file);
for (auto& value : cost_list)
f << value << std::endl;
f.close();
if (cost_list.size() > 0) {
f.open(summary_file, std::ios::out | std::ios::app);
for (auto& value : cost_list)
f << value << std::endl;
f.close();
cost_list.clear();
}
}
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