mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-12 20:18:20 +00:00
Rewrite ABC output to include proper net names in timing report
This commit is contained in:
parent
142f4ca03a
commit
7c57d8fbb4
|
@ -111,6 +111,7 @@ bool recover_init;
|
||||||
|
|
||||||
bool clk_polarity, en_polarity;
|
bool clk_polarity, en_polarity;
|
||||||
RTLIL::SigSpec clk_sig, en_sig;
|
RTLIL::SigSpec clk_sig, en_sig;
|
||||||
|
dict<int, std::string> pi_map, po_map;
|
||||||
|
|
||||||
int map_signal(RTLIL::SigBit bit, gate_type_t gate_type = G(NONE), int in1 = -1, int in2 = -1, int in3 = -1, int in4 = -1)
|
int map_signal(RTLIL::SigBit bit, gate_type_t gate_type = G(NONE), int in1 = -1, int in2 = -1, int in3 = -1, int in4 = -1)
|
||||||
{
|
{
|
||||||
|
@ -601,6 +602,14 @@ struct abc_output_filter
|
||||||
|
|
||||||
void next_line(const std::string &line)
|
void next_line(const std::string &line)
|
||||||
{
|
{
|
||||||
|
int pi, po;
|
||||||
|
if (sscanf(line.c_str(), "Start-point = pi%d. End-point = po%d.", &pi, &po) == 2) {
|
||||||
|
log("ABC: Start-point = pi%d (%s). End-point = po%d (%s).\n",
|
||||||
|
pi, pi_map.count(pi) ? pi_map.at(pi).c_str() : "???",
|
||||||
|
po, po_map.count(po) ? po_map.at(po).c_str() : "???");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (char ch : line)
|
for (char ch : line)
|
||||||
next_char(ch);
|
next_char(ch);
|
||||||
}
|
}
|
||||||
|
@ -616,6 +625,8 @@ void abc_module(RTLIL::Design *design, RTLIL::Module *current_module, std::strin
|
||||||
|
|
||||||
signal_map.clear();
|
signal_map.clear();
|
||||||
signal_list.clear();
|
signal_list.clear();
|
||||||
|
pi_map.clear();
|
||||||
|
po_map.clear();
|
||||||
recover_init = false;
|
recover_init = false;
|
||||||
|
|
||||||
if (clk_str != "$")
|
if (clk_str != "$")
|
||||||
|
@ -768,7 +779,7 @@ void abc_module(RTLIL::Design *design, RTLIL::Module *current_module, std::strin
|
||||||
if (!si.is_port || si.type != G(NONE))
|
if (!si.is_port || si.type != G(NONE))
|
||||||
continue;
|
continue;
|
||||||
fprintf(f, " n%d", si.id);
|
fprintf(f, " n%d", si.id);
|
||||||
count_input++;
|
pi_map[count_input++] = log_signal(si.bit);
|
||||||
}
|
}
|
||||||
if (count_input == 0)
|
if (count_input == 0)
|
||||||
fprintf(f, " dummy_input\n");
|
fprintf(f, " dummy_input\n");
|
||||||
|
@ -780,7 +791,7 @@ void abc_module(RTLIL::Design *design, RTLIL::Module *current_module, std::strin
|
||||||
if (!si.is_port || si.type == G(NONE))
|
if (!si.is_port || si.type == G(NONE))
|
||||||
continue;
|
continue;
|
||||||
fprintf(f, " n%d", si.id);
|
fprintf(f, " n%d", si.id);
|
||||||
count_output++;
|
po_map[count_output++] = log_signal(si.bit);
|
||||||
}
|
}
|
||||||
fprintf(f, "\n");
|
fprintf(f, "\n");
|
||||||
|
|
||||||
|
@ -1392,6 +1403,8 @@ struct AbcPass : public Pass {
|
||||||
signal_list.clear();
|
signal_list.clear();
|
||||||
signal_map.clear();
|
signal_map.clear();
|
||||||
signal_init.clear();
|
signal_init.clear();
|
||||||
|
pi_map.clear();
|
||||||
|
po_map.clear();
|
||||||
|
|
||||||
#ifdef ABCEXTERNAL
|
#ifdef ABCEXTERNAL
|
||||||
std::string exe_file = ABCEXTERNAL;
|
std::string exe_file = ABCEXTERNAL;
|
||||||
|
@ -1819,6 +1832,8 @@ struct AbcPass : public Pass {
|
||||||
signal_list.clear();
|
signal_list.clear();
|
||||||
signal_map.clear();
|
signal_map.clear();
|
||||||
signal_init.clear();
|
signal_init.clear();
|
||||||
|
pi_map.clear();
|
||||||
|
po_map.clear();
|
||||||
|
|
||||||
log_pop();
|
log_pop();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue