icetime: json now contains net and hwnet

This commit is contained in:
Clifford Wolf 2016-05-16 11:39:23 +02:00
parent bafd99bd84
commit a2f635f3f1
1 changed files with 21 additions and 13 deletions

View File

@ -809,13 +809,7 @@ struct TimingAnalysis
if (!std::get<1>(user).empty()) if (!std::get<1>(user).empty())
{ {
delay += std::get<0>(user); delay += std::get<0>(user);
std::string outnet, outnethw, outnetsym;
rpt_lines.push_back(stringf("%10.3f ns", delay));
rpt_lines.push_back(stringf(" %s (%s) %s [setup]: %.3f ns", std::get<1>(user).c_str(),
netlist_cell_types.at(std::get<1>(user)).c_str(), std::get<2>(user).c_str(), std::get<0>(user)));
json_lines.push_back(stringf(" { cell: \"%s\", cell_type: \"%s\", cell_in_port: \"%s\", cell_out_port: \"[setup]\", delay_ns: %.3f, },",
std::get<1>(user).c_str(), netlist_cell_types.at(std::get<1>(user)).c_str(), std::get<2>(user).c_str(), delay));
auto &inports = get_inports(netlist_cell_types.at(std::get<1>(user))); auto &inports = get_inports(netlist_cell_types.at(std::get<1>(user)));
@ -826,15 +820,27 @@ struct TimingAnalysis
int netidx; int netidx;
char dummy_ch; char dummy_ch;
if (sscanf(it.second.c_str(), "net_%d%c", &netidx, &dummy_ch) == 1 && net_symbols.count(netidx))
outsym_list[it.first] = net_symbols[netidx]; outnetsym = outnethw = outnet = it.second;
if (sscanf(it.second.c_str(), "net_%d%c", &netidx, &dummy_ch) == 1 && net_symbols.count(netidx)) {
outnetsym = outsym_list[it.first] = net_symbols[netidx];
outnet += stringf(" (%s)", outnetsym.c_str());
}
} }
rpt_lines.push_back(stringf("%10.3f ns %s", delay, outnet.c_str()));
rpt_lines.push_back(stringf(" %s (%s) %s [setup]: %.3f ns", std::get<1>(user).c_str(),
netlist_cell_types.at(std::get<1>(user)).c_str(), std::get<2>(user).c_str(), std::get<0>(user)));
json_lines.push_back(stringf(" { net: \"%s\", hwnet: \"%s\", cell: \"%s\", cell_type: \"%s\", cell_in_port: \"%s\", cell_out_port: \"[setup]\", delay_ns: %.3f, },",
outnetsym.c_str(), outnethw.c_str(), std::get<1>(user).c_str(), netlist_cell_types.at(std::get<1>(user)).c_str(), std::get<2>(user).c_str(), delay));
} }
while (1) while (1)
{ {
int netidx; int netidx;
char dummy_ch; char dummy_ch;
std::string outnetsym = n;
if (sscanf(n.c_str(), "net_%d%c", &netidx, &dummy_ch) == 1 && net_symbols.count(netidx)) { if (sscanf(n.c_str(), "net_%d%c", &netidx, &dummy_ch) == 1 && net_symbols.count(netidx)) {
sym_list.push_back(std::make_pair(calc_net_max_path_delay(n), net_symbols[netidx])); sym_list.push_back(std::make_pair(calc_net_max_path_delay(n), net_symbols[netidx]));
@ -848,14 +854,15 @@ struct TimingAnalysis
if (!net_sym.empty()) { if (!net_sym.empty()) {
rpt_lines.back() += stringf(" (%s)", net_sym.c_str()); rpt_lines.back() += stringf(" (%s)", net_sym.c_str());
outnetsym = net_sym;
net_sym.clear(); net_sym.clear();
} }
auto &driver_cell = net_driver.at(n).first; auto &driver_cell = net_driver.at(n).first;
auto &driver_port = net_driver.at(n).second; auto &driver_port = net_driver.at(n).second;
auto &driver_type = netlist_cell_types.at(driver_cell); auto &driver_type = netlist_cell_types.at(driver_cell);
json_lines.push_back(stringf(" { out_net: \"%s\", cell: \"%s\", cell_type: \"%s\", cell_in_port: \"[clk]\", cell_out_port: \"%s\", delay_ns: %.3f, },", json_lines.push_back(stringf(" { net: \"%s\", hwnet: \"%s\", cell: \"%s\", cell_type: \"%s\", cell_in_port: \"[clk]\", cell_out_port: \"%s\", delay_ns: %.3f, },",
n.c_str(), driver_cell.c_str(), driver_type.c_str(), driver_port.c_str(), calc_net_max_path_delay(n))); outnetsym.c_str(), n.c_str(), driver_cell.c_str(), driver_type.c_str(), driver_port.c_str(), calc_net_max_path_delay(n)));
rpt_lines.push_back(stringf(" %s (%s) [clk] -> %s: %.3f ns", driver_cell.c_str(), rpt_lines.push_back(stringf(" %s (%s) [clk] -> %s: %.3f ns", driver_cell.c_str(),
driver_type.c_str(), driver_port.c_str(), calc_net_max_path_delay(n))); driver_type.c_str(), driver_port.c_str(), calc_net_max_path_delay(n)));
break; break;
@ -875,12 +882,13 @@ struct TimingAnalysis
if (!net_sym.empty()) { if (!net_sym.empty()) {
rpt_lines.back() += stringf(" (%s)", net_sym.c_str()); rpt_lines.back() += stringf(" (%s)", net_sym.c_str());
outnetsym = net_sym;
net_sym.clear(); net_sym.clear();
} }
} }
json_lines.push_back(stringf(" { out_net: \"%s\", cell: \"%s\", cell_type: \"%s\", cell_in_port: \"%s\", cell_out_port: \"%s\", delay_ns: %.3f, },", json_lines.push_back(stringf(" { net: \"%s\", hwnet: \"%s\", cell: \"%s\", cell_type: \"%s\", cell_in_port: \"%s\", cell_out_port: \"%s\", delay_ns: %.3f, },",
n.c_str(), std::get<1>(entry).c_str(), netlist_cell_types.at(std::get<1>(entry)).c_str(), outnetsym.c_str(), n.c_str(), std::get<1>(entry).c_str(), netlist_cell_types.at(std::get<1>(entry)).c_str(),
std::get<2>(entry).c_str(), std::get<3>(entry).c_str(), calc_net_max_path_delay(n))); std::get<2>(entry).c_str(), std::get<3>(entry).c_str(), calc_net_max_path_delay(n)));
rpt_lines.push_back(stringf(" %s (%s) %s -> %s: %.3f ns", std::get<1>(entry).c_str(), rpt_lines.push_back(stringf(" %s (%s) %s -> %s: %.3f ns", std::get<1>(entry).c_str(),