aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2020-01-14 16:32:46 -0800
committerEddie Hung <eddie@fpgeh.com>2020-01-14 16:32:46 -0800
commit48984a7605dc04463329263c3ada4ee2b42cbae7 (patch)
tree895950860fd69dc367a92bbf524406b3ff39fdfd
parentf60e071e1c3ab64d1a45c4aea3580027b4242908 (diff)
parent1c41dc6b95c4c0261db96c15dd1b3cce8de6491f (diff)
downloadyosys-48984a7605dc04463329263c3ada4ee2b42cbae7.tar.gz
yosys-48984a7605dc04463329263c3ada4ee2b42cbae7.tar.bz2
yosys-48984a7605dc04463329263c3ada4ee2b42cbae7.zip
Merge remote-tracking branch 'origin/eddie/abc9_refactor' into eddie/abc9_required
-rw-r--r--backends/aiger/xaiger.cc8
-rw-r--r--kernel/driver.cc38
2 files changed, 19 insertions, 27 deletions
diff --git a/backends/aiger/xaiger.cc b/backends/aiger/xaiger.cc
index 268be432a..c2d076c86 100644
--- a/backends/aiger/xaiger.cc
+++ b/backends/aiger/xaiger.cc
@@ -226,6 +226,7 @@ struct XAigerWriter
}
if (inst_module) {
+ bool abc9_flop = inst_module->get_bool_attribute("\\abc9_flop");
auto it = cell->attributes.find("\\abc9_box_seq");
if (it != cell->attributes.end()) {
int abc9_box_seq = it->second.as_int();
@@ -234,7 +235,7 @@ struct XAigerWriter
box_list[abc9_box_seq] = cell;
// Only flop boxes may have arrival times
// (all others are combinatorial)
- if (!inst_module->get_bool_attribute("\\abc9_flop"))
+ if (!abc9_flop)
continue;
}
@@ -277,6 +278,9 @@ struct XAigerWriter
jt++;
}
}
+
+ if (abc9_flop)
+ continue;
}
}
@@ -616,7 +620,7 @@ struct XAigerWriter
// For flops only, create an extra 1-bit input that drives a new wire
// called "<cell>.abc9_ff.Q" that is used below
if (box_module->get_bool_attribute("\\abc9_flop"))
- box_inputs++;
+ box_inputs++;
std::get<0>(v) = box_inputs;
std::get<1>(v) = box_outputs;
diff --git a/kernel/driver.cc b/kernel/driver.cc
index 70a97c4b9..f0d495b46 100644
--- a/kernel/driver.cc
+++ b/kernel/driver.cc
@@ -566,34 +566,22 @@ int main(int argc, char **argv)
#else
std::string meminfo;
std::string stats_divider = ", ";
-# if defined(__linux__)
- std::ifstream statm;
- statm.open(stringf("/proc/%lld/statm", (long long)getpid()));
- if (statm.is_open()) {
- int sz_total, sz_resident;
- statm >> sz_total >> sz_resident;
- meminfo = stringf(", MEM: %.2f MB total, %.2f MB resident",
- sz_total * (getpagesize() / 1024.0 / 1024.0),
- sz_resident * (getpagesize() / 1024.0 / 1024.0));
- stats_divider = "\n";
- }
-# elif defined(__FreeBSD__)
- pid_t pid = getpid();
- int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, (int)pid};
- struct kinfo_proc kip;
- size_t kip_len = sizeof(kip);
- if (sysctl(mib, 4, &kip, &kip_len, NULL, 0) == 0) {
- vm_size_t sz_total = kip.ki_size;
- segsz_t sz_resident = kip.ki_rssize;
- meminfo = stringf(", MEM: %.2f MB total, %.2f MB resident",
- (int)sz_total / 1024.0 / 1024.0,
- (int)sz_resident * (getpagesize() / 1024.0 / 1024.0));
- stats_divider = "\n";
- }
-# endif
struct rusage ru_buffer;
getrusage(RUSAGE_SELF, &ru_buffer);
+ if (yosys_design->scratchpad_get_bool("print_stats.include_children")) {
+ struct rusage ru_buffer_children;
+ getrusage(RUSAGE_CHILDREN, &ru_buffer_children);
+ ru_buffer.ru_utime.tv_sec += ru_buffer_children.ru_utime.tv_sec;
+ ru_buffer.ru_utime.tv_usec += ru_buffer_children.ru_utime.tv_usec;
+ ru_buffer.ru_stime.tv_sec += ru_buffer_children.ru_stime.tv_sec;
+ ru_buffer.ru_stime.tv_usec += ru_buffer_children.ru_stime.tv_usec;
+ ru_buffer.ru_maxrss = std::max(ru_buffer.ru_maxrss, ru_buffer_children.ru_maxrss);
+ }
+# if defined(__linux__) || defined(__FreeBSD__)
+ meminfo = stringf(", MEM: %.2f MB peak",
+ ru_buffer.ru_maxrss / 1024.0);
+#endif
log("End of script. Logfile hash: %s%sCPU: user %.2fs system %.2fs%s\n", hash.c_str(),
stats_divider.c_str(), ru_buffer.ru_utime.tv_sec + 1e-6 * ru_buffer.ru_utime.tv_usec,
ru_buffer.ru_stime.tv_sec + 1e-6 * ru_buffer.ru_stime.tv_usec, meminfo.c_str());