yosys-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
stat.cc File Reference
#include "kernel/register.h"
#include "kernel/celltypes.h"
#include "kernel/log.h"
+ Include dependency graph for stat.cc:

Go to the source code of this file.

Data Structures

struct  statdata_t
 
struct  StatPass
 

Macros

#define STAT_INT_MEMBERS
 
#define X(_name)   int _name;
 
#define X(_name)   sum._name += _name;
 
#define X(_name)   sum._name *= other;
 
#define X(_name)   _name = 0;
 
#define X(_name)   _name = 0;
 

Functions

statdata_t hierarchy_worker (std::map< RTLIL::IdString, statdata_t > &mod_stat, RTLIL::IdString mod, int level)
 

Variables

StatPass StatPass
 

Macro Definition Documentation

#define STAT_INT_MEMBERS
Value:
X(num_wires) X(num_wire_bits) X(num_pub_wires) X(num_pub_wire_bits) \
X(num_memories) X(num_memory_bits) X(num_cells) X(num_processes)
#define X(_name)
Definition: stat.cc:32

Definition at line 29 of file stat.cc.

#define X (   _name)    int _name;

Definition at line 32 of file stat.cc.

#define X (   _name)    sum._name += _name;

Definition at line 32 of file stat.cc.

#define X (   _name)    sum._name *= other;

Definition at line 32 of file stat.cc.

#define X (   _name)    _name = 0;

Definition at line 32 of file stat.cc.

#define X (   _name)    _name = 0;

Definition at line 32 of file stat.cc.

Function Documentation

statdata_t hierarchy_worker ( std::map< RTLIL::IdString, statdata_t > &  mod_stat,
RTLIL::IdString  mod,
int  level 
)

Definition at line 147 of file stat.cc.

148 {
149  statdata_t mod_data = mod_stat.at(mod);
150  std::map<RTLIL::IdString, int, RTLIL::sort_by_id_str> num_cells_by_type;
151  num_cells_by_type.swap(mod_data.num_cells_by_type);
152 
153  for (auto &it : num_cells_by_type)
154  if (mod_stat.count(it.first) > 0) {
155  log(" %*s%-*s %6d\n", 2*level, "", 26-2*level, RTLIL::id2cstr(it.first), it.second);
156  mod_data = mod_data + hierarchy_worker(mod_stat, it.first, level+1) * it.second;
157  mod_data.num_cells -= it.second;
158  } else {
159  mod_data.num_cells_by_type[it.first] += it.second;
160  }
161 
162  return mod_data;
163 }
statdata_t hierarchy_worker(std::map< RTLIL::IdString, statdata_t > &mod_stat, RTLIL::IdString mod, int level)
Definition: stat.cc:147
STAT_INT_MEMBERS std::map< RTLIL::IdString, int, RTLIL::sort_by_id_str > num_cells_by_type
Definition: stat.cc:36
static const char * id2cstr(const RTLIL::IdString &str)
Definition: rtlil.h:267
void log(const char *format,...)
Definition: log.cc:180

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation