Skip to content

Commit

Permalink
Compute Topology area at spec/construction time instead of eval time.
Browse files Browse the repository at this point in the history
  • Loading branch information
angshuman-parashar committed Jan 3, 2020
1 parent a264b30 commit 11920be
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/model/topology.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,17 @@ void Topology::Spec(const Topology::Specs& specs)
is_specced_ = true;

FloorPlan();

// Compute area at spec-time (instead of at eval-time).
// FIXME: area is being stored as a stat here, while it is stored as a spec
// in individual modules. We need to be consistent.
double area = 0;
for (auto level : levels_)
{
assert(level->Area() >= 0);
area += level->Area();
}
stats_.area = area;
}

// The hierarchical ParseSpecs functions are static and do not
Expand Down Expand Up @@ -892,15 +903,6 @@ void Topology::ComputeStats()

stats_.energy = energy;

// Area.
double area = 0;
for (auto level : levels_)
{
assert(level->Area() >= 0);
area += level->Area();
}
stats_.area = area;

// Cycles.
std::uint64_t cycles = 0;
for (auto level : levels_)
Expand Down

0 comments on commit 11920be

Please sign in to comment.