yosys-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SigPool Struct Reference

#include <sigtools.h>

Data Structures

struct  bitDef_t
 

Public Member Functions

void clear ()
 
void add (RTLIL::SigSpec sig)
 
void add (const SigPool &other)
 
void del (RTLIL::SigSpec sig)
 
void del (const SigPool &other)
 
void expand (RTLIL::SigSpec from, RTLIL::SigSpec to)
 
RTLIL::SigSpec extract (RTLIL::SigSpec sig)
 
RTLIL::SigSpec remove (RTLIL::SigSpec sig)
 
bool check (RTLIL::SigBit bit)
 
bool check_any (RTLIL::SigSpec sig)
 
bool check_all (RTLIL::SigSpec sig)
 
RTLIL::SigSpec export_one ()
 
RTLIL::SigSpec export_all ()
 
size_t size ()
 

Data Fields

std::set< bitDef_tbits
 

Detailed Description

Definition at line 27 of file sigtools.h.

Member Function Documentation

void SigPool::add ( RTLIL::SigSpec  sig)
inline

Definition at line 41 of file sigtools.h.

42  {
43  for (auto &bit : sig)
44  if (bit.wire != NULL)
45  bits.insert(bit);
46  }
#define NULL
std::set< bitDef_t > bits
Definition: sigtools.h:34

+ Here is the caller graph for this function:

void SigPool::add ( const SigPool other)
inline

Definition at line 48 of file sigtools.h.

49  {
50  for (auto &bit : other.bits)
51  bits.insert(bit);
52  }
std::set< bitDef_t > bits
Definition: sigtools.h:34
bool SigPool::check ( RTLIL::SigBit  bit)
inline

Definition at line 95 of file sigtools.h.

96  {
97  return bit.wire != NULL && bits.count(bit);
98  }
RTLIL::Wire * wire
Definition: rtlil.h:907
#define NULL
std::set< bitDef_t > bits
Definition: sigtools.h:34

+ Here is the caller graph for this function:

bool SigPool::check_all ( RTLIL::SigSpec  sig)
inline

Definition at line 108 of file sigtools.h.

109  {
110  for (auto &bit : sig)
111  if (bit.wire != NULL && bits.count(bit) == 0)
112  return false;
113  return true;
114  }
#define NULL
std::set< bitDef_t > bits
Definition: sigtools.h:34

+ Here is the caller graph for this function:

bool SigPool::check_any ( RTLIL::SigSpec  sig)
inline

Definition at line 100 of file sigtools.h.

101  {
102  for (auto &bit : sig)
103  if (bit.wire != NULL && bits.count(bit))
104  return true;
105  return false;
106  }
#define NULL
std::set< bitDef_t > bits
Definition: sigtools.h:34

+ Here is the caller graph for this function:

void SigPool::clear ( )
inline

Definition at line 36 of file sigtools.h.

37  {
38  bits.clear();
39  }
std::set< bitDef_t > bits
Definition: sigtools.h:34

+ Here is the caller graph for this function:

void SigPool::del ( RTLIL::SigSpec  sig)
inline

Definition at line 54 of file sigtools.h.

55  {
56  for (auto &bit : sig)
57  if (bit.wire != NULL)
58  bits.erase(bit);
59  }
#define NULL
std::set< bitDef_t > bits
Definition: sigtools.h:34

+ Here is the caller graph for this function:

void SigPool::del ( const SigPool other)
inline

Definition at line 61 of file sigtools.h.

62  {
63  for (auto &bit : other.bits)
64  bits.erase(bit);
65  }
std::set< bitDef_t > bits
Definition: sigtools.h:34
void SigPool::expand ( RTLIL::SigSpec  from,
RTLIL::SigSpec  to 
)
inline

Definition at line 67 of file sigtools.h.

68  {
69  log_assert(GetSize(from) == GetSize(to));
70  for (int i = 0; i < GetSize(from); i++) {
71  bitDef_t bit_from(from[i]), bit_to(to[i]);
72  if (bit_from.first != NULL && bit_to.first != NULL && bits.count(bit_from) > 0)
73  bits.insert(bit_to);
74  }
75  }
int GetSize(RTLIL::Wire *wire)
Definition: yosys.cc:334
#define log_assert(_assert_expr_)
Definition: log.h:85
#define NULL
std::set< bitDef_t > bits
Definition: sigtools.h:34

+ Here is the call graph for this function:

RTLIL::SigSpec SigPool::export_all ( )
inline

Definition at line 123 of file sigtools.h.

124  {
125  std::set<RTLIL::SigBit> sig;
126  for (auto &bit : bits)
127  sig.insert(RTLIL::SigBit(bit.first, bit.second));
128  return sig;
129  }
std::set< bitDef_t > bits
Definition: sigtools.h:34

+ Here is the caller graph for this function:

RTLIL::SigSpec SigPool::export_one ( )
inline

Definition at line 116 of file sigtools.h.

117  {
118  for (auto &bit : bits)
119  return RTLIL::SigSpec(bit.first, bit.second);
120  return RTLIL::SigSpec();
121  }
std::set< bitDef_t > bits
Definition: sigtools.h:34

+ Here is the caller graph for this function:

RTLIL::SigSpec SigPool::extract ( RTLIL::SigSpec  sig)
inline

Definition at line 77 of file sigtools.h.

78  {
79  RTLIL::SigSpec result;
80  for (auto &bit : sig)
81  if (bit.wire != NULL && bits.count(bit))
82  result.append_bit(bit);
83  return result;
84  }
void append_bit(const RTLIL::SigBit &bit)
Definition: rtlil.cc:2562
#define NULL
std::set< bitDef_t > bits
Definition: sigtools.h:34

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

RTLIL::SigSpec SigPool::remove ( RTLIL::SigSpec  sig)
inline

Definition at line 86 of file sigtools.h.

87  {
88  RTLIL::SigSpec result;
89  for (auto &bit : sig)
90  if (bit.wire != NULL && bits.count(bit) == 0)
91  result.append(bit);
92  return result;
93  }
#define NULL
std::set< bitDef_t > bits
Definition: sigtools.h:34
void append(const RTLIL::SigSpec &signal)
Definition: rtlil.cc:2523

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t SigPool::size ( )
inline

Definition at line 131 of file sigtools.h.

132  {
133  return bits.size();
134  }
std::set< bitDef_t > bits
Definition: sigtools.h:34

+ Here is the caller graph for this function:

Field Documentation

std::set<bitDef_t> SigPool::bits

Definition at line 34 of file sigtools.h.


The documentation for this struct was generated from the following file: