verilator_gantt: Add eval count to report
This commit is contained in:
parent
204804ae52
commit
fd4595d6b4
|
|
@ -174,6 +174,8 @@ def report():
|
||||||
ncpus = len(Global['cpus'])
|
ncpus = len(Global['cpus'])
|
||||||
print(" Total cpus used = %d" % ncpus)
|
print(" Total cpus used = %d" % ncpus)
|
||||||
print(" Total yields = %d" % int(Global['stats']['yields']))
|
print(" Total yields = %d" % int(Global['stats']['yields']))
|
||||||
|
print(" Total evals = %d" % len(Evals))
|
||||||
|
print(" Total eval loops = %d" % len(EvalLoops))
|
||||||
print(" Total eval time = %d rdtsc ticks" %
|
print(" Total eval time = %d rdtsc ticks" %
|
||||||
Global['measured_last_end'])
|
Global['measured_last_end'])
|
||||||
print(" Longest mtask time = %d rdtsc ticks" % long_mtask_time)
|
print(" Longest mtask time = %d rdtsc ticks" % long_mtask_time)
|
||||||
|
|
|
||||||
|
|
@ -44,32 +44,9 @@ run(cmd => ["$ENV{VERILATOR_ROOT}/bin/verilator_gantt",
|
||||||
verilator_run => 1,
|
verilator_run => 1,
|
||||||
);
|
);
|
||||||
|
|
||||||
# We should have three lines of gantt chart, each with
|
file_grep("$Self->{obj_dir}/gantt.log", qr/Total threads += 2/i);
|
||||||
# an even number of mtask-bars (eg "[123--]")
|
file_grep("$Self->{obj_dir}/gantt.log", qr/Total mtasks += 7/i);
|
||||||
my $gantt_line_ct = 0;
|
file_grep("$Self->{obj_dir}/gantt.log", qr/Total evals += 2/i);
|
||||||
my $global_mtask_ct = 0;
|
|
||||||
{
|
|
||||||
my $fh = IO::File->new("<$Self->{obj_dir}/gantt.log")
|
|
||||||
or error("$! $Self->{obj_dir}/gantt.log");
|
|
||||||
while (my $line = ($fh && $fh->getline)) {
|
|
||||||
if ($line !~ m/^ t:/) { next; }
|
|
||||||
$gantt_line_ct++;
|
|
||||||
my $this_thread_mtask_ct = 0;
|
|
||||||
my @mtasks = split(/\[/, $line);
|
|
||||||
shift @mtasks; # throw the '>> ' away
|
|
||||||
foreach my $mtask (@mtasks) {
|
|
||||||
# Format of each mtask is "[123--]" where the hyphens
|
|
||||||
# number or ] may or may not appear; it depends on exact timing.
|
|
||||||
$this_thread_mtask_ct++;
|
|
||||||
$global_mtask_ct++;
|
|
||||||
}
|
|
||||||
if ($this_thread_mtask_ct % 2 != 0) { error("odd number of mtasks found"); }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($gantt_line_ct != 2) { error("wrong number of gantt lines"); }
|
|
||||||
if ($global_mtask_ct == 0) { error("wrong number of mtasks, should be > 0"); }
|
|
||||||
print "Found $gantt_line_ct lines of gantt data with $global_mtask_ct mtasks\n"
|
|
||||||
if $Self->{verbose};
|
|
||||||
|
|
||||||
# Diff to itself, just to check parsing
|
# Diff to itself, just to check parsing
|
||||||
vcd_identical("$Self->{obj_dir}/profile_threads.vcd", "$Self->{obj_dir}/profile_threads.vcd");
|
vcd_identical("$Self->{obj_dir}/profile_threads.vcd", "$Self->{obj_dir}/profile_threads.vcd");
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ Analysis:
|
||||||
Total mtasks = 7
|
Total mtasks = 7
|
||||||
Total cpus used = 2
|
Total cpus used = 2
|
||||||
Total yields = 0
|
Total yields = 0
|
||||||
|
Total evals = 2
|
||||||
|
Total eval loops = 2
|
||||||
Total eval time = 21875 rdtsc ticks
|
Total eval time = 21875 rdtsc ticks
|
||||||
Longest mtask time = 1190 rdtsc ticks
|
Longest mtask time = 1190 rdtsc ticks
|
||||||
All-thread mtask time = 5495 rdtsc ticks
|
All-thread mtask time = 5495 rdtsc ticks
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue