CIRCT
20.0.0git
|
#include <PortConverter.h>
Public Member Functions | |
LogicalResult | run () |
Run port conversion. More... | |
Block * | getBody () const |
hw::HWMutableModuleLike | getModule () const |
Value | createNewInput (hw::PortInfo origPort, const Twine &suffix, Type type, hw::PortInfo &newPort) |
These two methods take care of allocating new ports in the correct place based on the position of 'origPort'. More... | |
void | createNewOutput (hw::PortInfo origPort, const Twine &suffix, Type type, Value output, hw::PortInfo &newPort) |
Same as above. More... | |
Protected Member Functions | |
PortConverterImpl (igraph::InstanceGraphNode *moduleNode) | |
Protected Attributes | |
std::unique_ptr< PortConversionBuilder > | ssb |
Private Member Functions | |
void | updateInstance (hw::InstanceOp) |
Updates an instance of the module. More... | |
Private Attributes | |
Block * | body = nullptr |
igraph::InstanceGraphNode * | moduleNode |
hw::HWMutableModuleLike | mod |
OpBuilder | b |
SmallVector< std::unique_ptr< PortConversion > > | loweredInputs |
SmallVector< std::unique_ptr< PortConversion > > | loweredOutputs |
SmallVector< std::pair< unsigned, hw::PortInfo >, 0 > | newInputs |
SmallVector< std::pair< unsigned, hw::PortInfo >, 0 > | newOutputs |
Operation * | terminator = nullptr |
Definition at line 36 of file PortConverter.h.
|
protected |
Definition at line 75 of file PortConverter.cpp.
References assert(), body, circt::igraph::InstanceGraphNode::getModule(), mod, moduleNode, and terminator.
Value PortConverterImpl::createNewInput | ( | hw::PortInfo | origPort, |
const Twine & | suffix, | ||
Type | type, | ||
hw::PortInfo & | newPort | ||
) |
These two methods take care of allocating new ports in the correct place based on the position of 'origPort'.
The new port is based on the original name and suffix. The specification for the new port is given by newPort
and is recorded internally. Any changes to 'newPort' after calling this will not be reflected in the modules new port list. Will also add the new input to the block arguments of the body of the module.
Definition at line 86 of file PortConverter.cpp.
References append(), body, Input, circt::hw::PortInfo::loc, circt::hw::ModulePort::name, and newInputs.
void PortConverterImpl::createNewOutput | ( | hw::PortInfo | origPort, |
const Twine & | suffix, | ||
Type | type, | ||
Value | output, | ||
hw::PortInfo & | newPort | ||
) |
Same as above.
'output' is the value fed into the new port and is required if 'body' is non-null. Important note: cannot be a backedge which gets replaced since this isn't attached to an op until later in the pass.
Definition at line 100 of file PortConverter.cpp.
References append(), b, body, circt::hw::PortInfo::loc, circt::hw::ModulePort::name, newOutputs, Output, and terminator.
|
inline |
Definition at line 40 of file PortConverter.h.
References body.
|
inline |
Definition at line 41 of file PortConverter.h.
References mod.
Referenced by circt::hw::PortConversion::getModule().
LogicalResult PortConverterImpl::run | ( | ) |
Run port conversion.
Definition at line 118 of file PortConverter.cpp.
References body, loweredInputs, loweredOutputs, mod, moduleNode, newInputs, newOutputs, Output, circt::hw::ModulePortInfo::sizeInputs(), circt::hw::ModulePortInfo::sizeOutputs(), ssb, terminator, updateInstance(), and circt::igraph::InstanceGraphNode::uses().
|
private |
Updates an instance of the module.
This is called after the module has been updated. It will update the instance to match the new port
Definition at line 204 of file PortConverter.cpp.
References assert(), b, circt::BackedgeBuilder::get(), circt::hw::ModulePortInfo::getOutputs(), loweredInputs, loweredOutputs, mod, and circt::hw::ModulePortInfo::sizeInputs().
Referenced by run().
|
private |
Definition at line 73 of file PortConverter.h.
Referenced by createNewOutput(), and updateInstance().
|
private |
Definition at line 69 of file PortConverter.h.
Referenced by fsm.MachineOp::__init__(), esi.ESIPureModuleOp::add_entry_block(), handshake.FuncOp::add_entry_block(), hw.HWModuleOp::add_entry_block(), createNewInput(), createNewOutput(), getBody(), PortConverterImpl(), and run().
|
private |
Definition at line 78 of file PortConverter.h.
Referenced by run(), and updateInstance().
|
private |
Definition at line 79 of file PortConverter.h.
Referenced by run(), and updateInstance().
|
private |
Definition at line 72 of file PortConverter.h.
Referenced by getModule(), PortConverterImpl(), run(), and updateInstance().
|
private |
Definition at line 71 of file PortConverter.h.
Referenced by PortConverterImpl(), and run().
|
private |
Definition at line 85 of file PortConverter.h.
Referenced by createNewInput(), and run().
|
private |
Definition at line 86 of file PortConverter.h.
Referenced by createNewOutput(), and run().
|
protected |
Definition at line 60 of file PortConverter.h.
Referenced by circt::hw::PortConverter< PortConversionBuilderImpl >::PortConverter(), and run().
|
private |
Definition at line 91 of file PortConverter.h.
Referenced by createNewOutput(), PortConverterImpl(), and run().