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

Public Member Functions

void append_wire (RTLIL::Module *module, RTLIL::Wire *wire, int offset, int width, std::string format)
 
void operator() (RTLIL::SigSpec &sig)
 

Data Fields

std::map< RTLIL::Wire
*, std::vector< RTLIL::SigBit > > 
splitmap
 

Detailed Description

Definition at line 28 of file splitnets.cc.

Member Function Documentation

void SplitnetsWorker::append_wire ( RTLIL::Module module,
RTLIL::Wire wire,
int  offset,
int  width,
std::string  format 
)
inline

Definition at line 32 of file splitnets.cc.

33  {
34  std::string new_wire_name = wire->name.str();
35 
36  if (format.size() > 0)
37  new_wire_name += format.substr(0, 1);
38 
39  if (width > 1) {
40  new_wire_name += stringf("%d", offset+width-1);
41  if (format.size() > 2)
42  new_wire_name += format.substr(2, 1);
43  else
44  new_wire_name += ":";
45  }
46 
47  new_wire_name += stringf("%d", offset);
48 
49  if (format.size() > 1)
50  new_wire_name += format.substr(1, 1);
51 
52  RTLIL::Wire *new_wire = module->addWire(module->uniquify(new_wire_name), width);
53  new_wire->port_id = wire->port_id;
54  new_wire->port_input = wire->port_input;
55  new_wire->port_output = wire->port_output;
56 
57  std::vector<RTLIL::SigBit> sigvec = RTLIL::SigSpec(new_wire).to_sigbit_vector();
58  splitmap[wire].insert(splitmap[wire].end(), sigvec.begin(), sigvec.end());
59  }
std::map< RTLIL::Wire *, std::vector< RTLIL::SigBit > > splitmap
Definition: splitnets.cc:30
std::string str() const
Definition: rtlil.h:182
std::string stringf(const char *fmt,...)
Definition: yosys.cc:58
bool port_input
Definition: rtlil.h:827
int port_id
Definition: rtlil.h:826
bool port_output
Definition: rtlil.h:827
RTLIL::Wire * addWire(RTLIL::IdString name, int width=1)
Definition: rtlil.cc:1331
RTLIL::IdString name
Definition: rtlil.h:825
RTLIL::IdString uniquify(RTLIL::IdString name)
Definition: rtlil.cc:1244
std::vector< RTLIL::SigBit > to_sigbit_vector() const
Definition: rtlil.cc:2921

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SplitnetsWorker::operator() ( RTLIL::SigSpec sig)
inline

Definition at line 61 of file splitnets.cc.

62  {
63  for (auto &bit : sig)
64  if (splitmap.count(bit.wire) > 0)
65  bit = splitmap.at(bit.wire).at(bit.offset);
66  }
std::map< RTLIL::Wire *, std::vector< RTLIL::SigBit > > splitmap
Definition: splitnets.cc:30

Field Documentation

std::map<RTLIL::Wire*, std::vector<RTLIL::SigBit> > SplitnetsWorker::splitmap

Definition at line 30 of file splitnets.cc.


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