My Project
Classes | Public Member Functions | Public Attributes | List of all members
Dataflow::DFnetlist_Impl Class Reference

#include <DFnetlist.h>

Collaboration diagram for Dataflow::DFnetlist_Impl:
Collaboration graph
[legend]

Public Member Functions

 DFnetlist_Impl ()
 Default constructor.
 
 DFnetlist_Impl (const std::string &name)
 Constructor. It reads a netlist from a file. More...
 
 DFnetlist_Impl (FILE *file)
 Constructor. It creates a netlist from a file descriptor. The file is assumed to be opened. More...
 
 DFnetlist_Impl (const std::string &name, const std::string &name_bb)
 Constructor. It creates a netlist from two files. first file consists of blocks. second file consists of basic blocks. More...
 
bool check ()
 Checks that the netlist is well-formed. More...
 
const std::string & getName () const
 
blockID createBlock (BlockType type, const std::string &name="")
 Creates a new block in the netlist. More...
 
blockID getBlock (const std::string &name) const
 Returns a block id of the netlist. More...
 
const std::string & getBlockName (blockID id) const
 Returns the name of a block. More...
 
BlockType getBlockType (blockID id) const
 Returns the type of block. More...
 
std::string printBlockType (BlockType type) const
 
void printChannelInfo (channelID c, int slots, int transparent)
 
bool isInnerChannel (channelID c)
 
bool getChannelMerge (channelID c)
 
void setChannelMerge (channelID c)
 
double getBlockDelay (blockID id, int indx) const
 Returns the delay of a block. More...
 
void setBasicBlock (blockID id, bbID bb=invalidDataflowID)
 Defines the basic block of a block. More...
 
bbID getBasicBlock (blockID id) const
 Returns the basic block of a block. More...
 
void setBlockDelay (blockID id, double d, int indx)
 Sets the delay of a block. More...
 
int getLatency (blockID id) const
 Returns the latency of a block. More...
 
void setLatency (blockID id, int lat)
 Sets the latency of a block. More...
 
double getBlockRetimingDiff (blockID id) const
 
void setBlockRetimingDiff (blockID id, double diff)
 
int getInitiationInterval (blockID id) const
 Returns the initiation interval of a block. More...
 
void setInitiationInterval (blockID id, int ii)
 Sets the initiation interval of a block. More...
 
void setExecutionFrequency (blockID id, double freq)
 Sets the execution frequency of a block. More...
 
int getExecutionFrequency (blockID id) const
 Returns the execution frequency of a block. More...
 
void setTrueFrac (blockID id, double freq)
 Sets the true/false exe. fraction of a select op. More...
 
double getTrueFrac (blockID id) const
 Returns the the true/false exe. fraction of a select op. More...
 
void setValue (blockID id, longValueType value)
 Defines the value of a constant block. More...
 
void setOperation (blockID id, std::string op)
 Defines the operation (instruction) of operators. More...
 
const std::string & getOperation (blockID id) const
 
void setMemPortID (blockID id, int memPortID)
 
int getMemPortID (blockID id) const
 
void setMemOffset (blockID id, int memOffset)
 
int getMemOffset (blockID id) const
 
void setMemBBCount (blockID id, int count)
 
int getMemBBCount (blockID id) const
 
void setMemLdCount (blockID id, int count)
 
int getMemLdCount (blockID id) const
 
void setMemStCount (blockID id, int count)
 
int getMemStCount (blockID id) const
 
void setMemName (blockID id, std::string name)
 
const std::string & getMemName (blockID id) const
 
void setMemPortSuffix (blockID id, std::string op)
 
const std::string & getMemPortSuffix (blockID id) const
 
void setFuncName (blockID id, std::string op)
 
const std::string & getFuncName (blockID id) const
 
void setOrderings (blockID id, map< bbID, vector< int >> value)
 
void setLSQDepth (blockID id, int depth)
 
int getLSQDepth (blockID id) const
 
void setNumLoads (blockID id, std::string name)
 
const std::string & getNumLoads (blockID id) const
 
void setNumStores (blockID id, std::string name)
 
const std::string & getNumStores (blockID id) const
 
void setLoadOffsets (blockID id, std::string name)
 
const std::string & getLoadOffsets (blockID id) const
 
void setStoreOffsets (blockID id, std::string name)
 
const std::string & getStoreOffsets (blockID id) const
 
void setLoadPorts (blockID id, std::string name)
 
const std::string & getLoadPorts (blockID id) const
 
void setStorePorts (blockID id, std::string name)
 
const std::string & getStorePorts (blockID id) const
 
void setGetPtrConst (blockID id, int c)
 
int getGetPtrConst (blockID id) const
 
longValueType getValue (blockID id)
 Defines the value of a constant block. More...
 
bool getBoolValue (blockID id) const
 Retruns the boolean value of a constant. More...
 
int getBufferSize (blockID id) const
 Returns the number of slots of an elastic buffer. More...
 
void setBufferSize (blockID id, int slots)
 Sets the number of slots of an elastic buffer. More...
 
bool isBufferTransparent (blockID id) const
 Checks whether the buffer is transparent. More...
 
void setBufferTransparency (blockID id, bool value)
 Sets the transparency of an elastic buffer. More...
 
blockID getBlockFromPort (portID p) const
 
void removeBlock (blockID block)
 Removes a block and all the associated channels from the netlist. More...
 
portID createPort (blockID block, bool isInput, const std::string &name="", int width=-1, PortType type=GENERIC_PORT)
 Adds a new port to a block. More...
 
void removePort (portID port)
 Removes a port and the associated channels from the netlist. More...
 
portID getPort (blockID block, const std::string &name) const
 Returns the id of a port from a given block and pin name. More...
 
const std::string & getPortName (portID port, bool full=true) const
 Returns the name of a port. More...
 
PortType getPortType (portID port) const
 Returns the type of a port. More...
 
bool isInputPort (portID port) const
 Indicates whether a port is input. More...
 
bool isOutputPort (portID port) const
 Indicates whether a port is output. More...
 
void setPortWidth (portID port, int width)
 Defines the width of a port. More...
 
int getPortWidth (portID port) const
 Returns the width of a port. More...
 
bool isBooleanPort (portID port) const
 Checks whether a port is Boolean. More...
 
bool isControlPort (portID port) const
 Checks whether a port is a control port. More...
 
bool isBooleanConstant (portID port, bool &value) const
 Indicates whether the port has a constant boolean value. More...
 
double getPortDelay (portID port) const
 Returns the delay of a port. More...
 
void setPortDelay (portID port, double d)
 Sets the delay of a port. More...
 
double getCombinationalDelay (portID inp, portID outp) const
 Returns the combinational delay between an input and and output port of a block. The ports are assumed to belong to the same blocks and the latency of the block is assumed to be zero. More...
 
const setPorts & getPorts (blockID id, PortDirection dir) const
 Returns a set of ports with a certain direction. More...
 
const setPorts & getDefinitions (portID p) const
 Returns the set of ports that define values for a port. More...
 
portID getConditionalPort (blockID id) const
 
portID getTruePort (blockID id) const
 
portID getFalsePort (blockID id) const
 
portID getDataPort (blockID id) const
 
portID getDemuxComplementaryPort (portID port) const
 Returns the complementary port associated to one of the ports of a demux. If the parameter is an input control port, it returns the corresponding output data port, and vice versa. More...
 
channelID getConnectedChannel (portID port) const
 Returns the channel associated to a port. More...
 
bool isPortConnected (portID port) const
 Checks whether a port is connected. More...
 
portID getConnectedPort (portID port) const
 Returns the opposite port connected to the same channel. More...
 
channelID createChannel (portID src, portID dst, int slots=0, bool transparent=true)
 Creates a channel between two ports. More...
 
void removeChannel (channelID id)
 Removes a channel. More...
 
portID getSrcPort (channelID id) const
 Returns the source port of a channel. More...
 
portID getDstPort (channelID id) const
 Returns the destination port of a channel. More...
 
blockID getSrcBlock (channelID id) const
 Returns the source block of a channel. More...
 
blockID getDstBlock (channelID id) const
 Returns the destination block of a channel. More...
 
string getChannelName (channelID id, bool full=true) const
 Returns the name of the channel. More...
 
channelID getChannelID (portID id)
 Returns the channel ID. More...
 
int getChannelBufferSize (channelID id) const
 Returns the number of slots of the elastic buffer in the channel. More...
 
void setChannelBufferSize (blockID id, int slots)
 Sets the number of slots of the elastic buffer in the channel. More...
 
bool isChannelTransparent (channelID id) const
 Checks whether the buffer of the channel is transparent. More...
 
void setChannelTransparency (channelID id, bool value)
 Sets the transparency of the elastic buffer in the channel. More...
 
void setChannelEB (channelID id)
 Sets the presence of an EB on the channel. More...
 
bool getChannelEB (channelID id)
 Gets the presence of an EB on the channel. More...
 
void setChannelFrequency (channelID id, double value)
 
double getChannelFrequency (channelID id)
 
bool hasBuffer (channelID id) const
 Checks whether a channel has an elastic buffer (slots > 0). More...
 
blockID insertBuffer (channelID c, int slots, bool transparent)
 Inserts a buffer in a channel. The insertion removes the previous channel and creates two new channels. More...
 
blockID insertBuffer (channelID c, int slots, bool transparent, bool EB)
 Inserts a buffer in a channel. The insertion removes the previous channel and creates two new channels. More...
 
channelID removeBuffer (blockID buf)
 Removes a buffer and reconnects the input and output channels. More...
 
void setError (const std::string &err)
 Sets an error message for the netlist. More...
 
const std::string & getError () const
 
std::string & getError ()
 
void clearError ()
 Erases the error.
 
bool hasError () const
 Indicates whether there is an error. More...
 
int numBlocks () const
 
int numChannels () const
 
int numPorts () const
 
bool validPort (portID p) const
 
bool validBlock (blockID id) const
 Indicates whether a block id is valid. More...
 
bool validChannel (channelID id) const
 Indicates whether a channel id is valid. More...
 
void reduceMerges ()
 Reduce the number of merges since 1 input merges can be reduced to a wire.
 
void execute_reduction (blockID b)
 
bool writeDot (const std::string &filename="")
 Writes the dataflow netlist in dot format. More...
 
bool writeDot (std::ostream &of)
 Writes the dataflow netlist in dot format. More...
 
bool writeDotMG (const std::string &filename="")
 
bool writeDotMG (std::ostream &s)
 
bool writeDotBB (const std::string &filename="")
 
bool writeDotBB (std::ostream &of)
 
bool writeBasicBlockDot (const std::string &filename="")
 Writes the basic blocks of a dataflow netlist in dot format. More...
 
bool writeBasicBlockDot (std::ostream &s)
 Writes the basic blocks of a dataflow netlist in dot format. More...
 
bool addElasticBuffers (double Period=0, double BufferDelay=0, bool MaxThroughput=false, double coverage=0)
 Adds elastic buffers to meet a certain cycle period and guarantee elasticity in the system. More...
 
bool addElasticBuffersBB (double Period=0, double BufferDelay=0, bool MaxThroughput=false, double coverage=0, int timeout=-1, bool first_MG=false)
 Adds elastic buffers to meet a certain cycle period and guarantee elasticity in the system by looking at a Basic Block level. More...
 
bool addElasticBuffersBB_sc (double Period=0, double BufferDelay=0, bool MaxThroughput=false, double coverage=0, int timeout=-1, bool first_MG=false, const std::string &model_mode="default", const std::string &lib_path="")
 
void addBorderBuffers ()
 
void findMCLSQ_load_channels ()
 
void instantiateElasticBuffers ()
 Creates buffers for all those channels annotated with buffers. The information in the channels is deleted.
 
void instantiateAdditionalElasticBuffers (const std::string &filename)
 Creates buffers for all those channels annotated inside input file. // Carmine 09.02.22.
 
void hideElasticBuffers ()
 Removes the elastic buffers and transfers the information to the channels.
 
void cleanElasticBuffers ()
 Removes all the elastic buffers from the netlist.
 
void setMilpSolver (const std::string &solver="cbc")
 Sets the solver for MILP optimization problems. More...
 
void eraseNonSCC ()
 Removes all non-SCC blocks and channels. More...
 
bool calculateBasicBlocks ()
 Calculates the graph of basic blocks. More...
 
bool optimize ()
 Performs different types of optimizations to reduce the complexity of the dataflow netlist. It also calculates the rechable definitions for every block. More...
 
bool removeControl ()
 Remove the control (synchronization) blocks of the dataflow netlist. More...
 
double extractMarkedGraphs (double coverage)
 Extract a set of marked graphs to achieve a certain execution frequency coverage. The extraction is stopped when the coverage is achieved or no more marked graphs are found. More...
 
double extractMarkedGraphsBB (double coverage)
 Extract a set of marked graphs consisting of Basic Blocks to achieve a certain execution frequency coverage. The extraction is stopped when the coverage is achieved or no more marked graphs are found. More...
 
void printBlockSCCs ()
 
void computeSCCpublic (bool onlyMarked)
 
std::vector< Block > & getBlocks ()
 
std::vector< Port > & getPorts ()
 
std::vector< Channel > & getChannels ()
 

Public Attributes

setBlocks allBlocks
 
setPorts allPorts
 
setChannels allChannels
 
BasicBlockGraph BBG
 

Detailed Description

Author
Jordi Cortadella
Date
30/08/18

Constructor & Destructor Documentation

◆ DFnetlist_Impl() [1/3]

Dataflow::DFnetlist_Impl::DFnetlist_Impl ( const std::string &  name)

Constructor. It reads a netlist from a file.

Parameters
nameFile name of the input description.

◆ DFnetlist_Impl() [2/3]

DFnetlist_Impl::DFnetlist_Impl ( FILE *  file)

Constructor. It creates a netlist from a file descriptor. The file is assumed to be opened.

Parameters
fileFile descriptor.

◆ DFnetlist_Impl() [3/3]

DFnetlist_Impl::DFnetlist_Impl ( const std::string &  name,
const std::string &  name_bb 
)

Constructor. It creates a netlist from two files. first file consists of blocks. second file consists of basic blocks.

Shabnam:

Parameters
fileFile name of the input descriptions.

Member Function Documentation

◆ addElasticBuffers()

bool DFnetlist_Impl::addElasticBuffers ( double  Period = 0,
double  BufferDelay = 0,
bool  MaxThroughput = false,
double  coverage = 0 
)

Adds elastic buffers to meet a certain cycle period and guarantee elasticity in the system.

Parameters
PeriodTarget cycle Period. If Period <= 0, then no constraints on the period are assumed.
BufferDelayCLK-to-Q delay of the Elastic Buffer.
Ifasserted, throughput is maximized.
Returns
True if no error, and false otherwise.
Note
In case of throughput maximization, it is assumed that the set of critical basic blocks has been extracted.

◆ addElasticBuffersBB()

bool DFnetlist_Impl::addElasticBuffersBB ( double  Period = 0,
double  BufferDelay = 0,
bool  MaxThroughput = false,
double  coverage = 0,
int  timeout = -1,
bool  first_MG = false 
)

Adds elastic buffers to meet a certain cycle period and guarantee elasticity in the system by looking at a Basic Block level.

Parameters
PeriodTarget cycle Period. If Period <= 0, then no constraints on the period are assumed.
BufferDelayCLK-to-Q delay of the Elastic Buffer.
Ifasserted, throughput is maximized.
Returns
True if no error, and false otherwise.
Note
In case of throughput maximization, it is assumed that the set of critical basic blocks has been extracted.

◆ calculateBasicBlocks()

bool DFnetlist_Impl::calculateBasicBlocks ( )

Calculates the graph of basic blocks.

Returns
True if successful, and False otherwise.
Note
The function assumes that the reachable definitions have been previously computed.

◆ check()

bool DFnetlist_Impl::check ( )

Checks that the netlist is well-formed.

Returns
True if it is well-formed and false otherwise.
Note
If not well-formed, an error message is generated.

◆ createBlock()

blockID DFnetlist_Impl::createBlock ( BlockType  type,
const std::string &  name = "" 
)

Creates a new block in the netlist.

Parameters
typeType of the block.
nameName of the block.
Returns
The block id. It returns an invalid block if an error occurs.

◆ createChannel()

channelID DFnetlist_Impl::createChannel ( portID  src,
portID  dst,
int  slots = 0,
bool  transparent = true 
)

Creates a channel between two ports.

Parameters
srcThe source port.
dstThe destination port.
slotsSize of the elastic buffer (0 if no buffer).
transparentIndicates that the elastic buffer is transparent.
Returns
The channel id. It returns invalidChannel in case of an error.

◆ createPort()

portID DFnetlist_Impl::createPort ( blockID  block,
bool  isInput,
const std::string &  name = "",
int  width = -1,
PortType  type = GENERIC_PORT 
)

Adds a new port to a block.

Parameters
blockid of the block.
isInputDirection of the port.
nameName of the port.
widthThe width of the port.
typeType of the port (generic, select, true, false).
Returns
The port id. It returns an invalidPort in case of error.
Note
If the name is empty, a new fresh name is generated.

◆ eraseNonSCC()

void DFnetlist_Impl::eraseNonSCC ( )

Removes all non-SCC blocks and channels.

Returns
The netlist with only the SCCs.
Note
The method recalculates the DFS order of all components.

◆ extractMarkedGraphs()

double DFnetlist_Impl::extractMarkedGraphs ( double  coverage)

Extract a set of marked graphs to achieve a certain execution frequency coverage. The extraction is stopped when the coverage is achieved or no more marked graphs are found.

Parameters
coverageThe target coverage.
Returns
The achieved coverage.

◆ extractMarkedGraphsBB()

double DFnetlist_Impl::extractMarkedGraphsBB ( double  coverage)

Extract a set of marked graphs consisting of Basic Blocks to achieve a certain execution frequency coverage. The extraction is stopped when the coverage is achieved or no more marked graphs are found.

Parameters
coverageThe target coverage.
Returns
The achieved coverage.

◆ getBasicBlock()

bbID DFnetlist_Impl::getBasicBlock ( blockID  id) const

Returns the basic block of a block.

Parameters
idIdentifier of the block.
Returns
The basic block of the block.

◆ getBlock()

blockID DFnetlist_Impl::getBlock ( const std::string &  name) const

Returns a block id of the netlist.

Parameters
nameName of the block.
Returns
The id of the block (invalidDataflowID if not found).

◆ getBlockDelay()

double DFnetlist_Impl::getBlockDelay ( blockID  id,
int  indx 
) const

Returns the delay of a block.

Parameters
idIdentifier of the block.
Returns
The delay of the block.

◆ getBlockFromPort()

blockID DFnetlist_Impl::getBlockFromPort ( portID  p) const
Parameters
pPort ID.
Returns
The block owner of the port.

◆ getBlockName()

const string & DFnetlist_Impl::getBlockName ( blockID  id) const

Returns the name of a block.

Parameters
idIdentifier of the block.
Returns
The name of the block.

◆ getBlockType()

BlockType DFnetlist_Impl::getBlockType ( blockID  id) const

Returns the type of block.

Parameters
idIdentifier of the block.
Returns
The type of the block.

◆ getBoolValue()

bool DFnetlist_Impl::getBoolValue ( blockID  id) const

Retruns the boolean value of a constant.

Parameters
idIdentifier of the block.
Returns
The Boolean value of the constant.

◆ getBufferSize()

int DFnetlist_Impl::getBufferSize ( blockID  id) const

Returns the number of slots of an elastic buffer.

Parameters
idIdentifier of the block.
Returns
The number of slots of the buffer.

◆ getChannelBufferSize()

int DFnetlist_Impl::getChannelBufferSize ( channelID  id) const

Returns the number of slots of the elastic buffer in the channel.

Parameters
idIdentifier of the channel.
Returns
The number of slots of the buffer.

◆ getChannelEB()

bool DFnetlist_Impl::getChannelEB ( channelID  id)

Gets the presence of an EB on the channel.

//Carmine 21.02.22

Parameters
idIdentifier of the channel.

◆ getChannelID()

channelID DFnetlist_Impl::getChannelID ( portID  id)

Returns the channel ID.

Parameters
idIdentifier of the port.
Returns
The ID representing the channel connected to that port

◆ getChannelName()

string DFnetlist_Impl::getChannelName ( channelID  id,
bool  full = true 
) const

Returns the name of the channel.

Parameters
idIdentifier of the channel.
fullIf asserted, a block:port -> block:port description is generated. Otherwise, a block -> block description is generated.
Returns
The string representing the name of the port.

◆ getCombinationalDelay()

double DFnetlist_Impl::getCombinationalDelay ( portID  inp,
portID  outp 
) const

Returns the combinational delay between an input and and output port of a block. The ports are assumed to belong to the same blocks and the latency of the block is assumed to be zero.

Parameters
inpThe input port.
outpThe output port.
Returns
The combinational delay between inp and outp.

◆ getConditionalPort()

portID DFnetlist_Impl::getConditionalPort ( blockID  id) const
Parameters
idBlock id.
Returns
The conditional port of a block (invalidDataflowID if it does not exists).

◆ getConnectedChannel()

channelID DFnetlist_Impl::getConnectedChannel ( portID  port) const

Returns the channel associated to a port.

Parameters
portThe port from which we want to obtain the channel.
Returns
The channel id..

◆ getConnectedPort()

portID DFnetlist_Impl::getConnectedPort ( portID  port) const

Returns the opposite port connected to the same channel.

Parameters
portThe id of the port.
Returns
The port ID of the opposite port.

◆ getDataPort()

portID DFnetlist_Impl::getDataPort ( blockID  id) const
Parameters
idBlock id.
Returns
The data port of a branch or demux.

◆ getDefinitions()

const setPorts & DFnetlist_Impl::getDefinitions ( portID  p) const

Returns the set of ports that define values for a port.

Parameters
pThe identifier of the port.
Returns
The set of ports that define values that reach port p.

◆ getDemuxComplementaryPort()

portID DFnetlist_Impl::getDemuxComplementaryPort ( portID  port) const

Returns the complementary port associated to one of the ports of a demux. If the parameter is an input control port, it returns the corresponding output data port, and vice versa.

Parameters
portPort of the demux.
Returns
The complementary port.

◆ getDstBlock()

blockID DFnetlist_Impl::getDstBlock ( channelID  id) const

Returns the destination block of a channel.

Parameters
idId of the channel.
Returns
The destination block. It returns invalidBlock in case of error.

◆ getDstPort()

portID DFnetlist_Impl::getDstPort ( channelID  id) const

Returns the destination port of a channel.

Parameters
idId of the channel.
Returns
The destination port. It returns invalidPort in case of error.

◆ getError() [1/2]

const string & DFnetlist_Impl::getError ( ) const
Returns
The error message associated to the netlist.

◆ getError() [2/2]

string & DFnetlist_Impl::getError ( )
Returns
The error message associated to the netlist.

◆ getExecutionFrequency()

int DFnetlist_Impl::getExecutionFrequency ( blockID  id) const

Returns the execution frequency of a block.

Parameters
idIdentifier of the block.
Returns
The execution frequency of the block.

◆ getFalsePort()

portID DFnetlist_Impl::getFalsePort ( blockID  id) const
Parameters
idBlock id.
Returns
The False port of a block (invalidDataflowID if it does not exists).

◆ getInitiationInterval()

int DFnetlist_Impl::getInitiationInterval ( blockID  id) const

Returns the initiation interval of a block.

Parameters
idIdentifier of the block.
Returns
The initiation interval of the block.

◆ getLatency()

int DFnetlist_Impl::getLatency ( blockID  id) const

Returns the latency of a block.

Parameters
idIdentifier of the block.
Returns
The latency of the block.

◆ getName()

const string & DFnetlist_Impl::getName ( ) const
Returns
The name of the netlist.

◆ getPort()

portID DFnetlist_Impl::getPort ( blockID  block,
const std::string &  name 
) const

Returns the id of a port from a given block and pin name.

Parameters
blockId of the block.
nameName of the pin
Returns
the port id (invalidePort if not found).

◆ getPortDelay()

double DFnetlist_Impl::getPortDelay ( portID  port) const

Returns the delay of a port.

Parameters
portIdentifier of the port.
Returns
The delay of the port.

◆ getPortName()

const string & DFnetlist_Impl::getPortName ( portID  port,
bool  full = true 
) const

Returns the name of a port.

Parameters
portIdentifier of the port.
fullIf asserted, the full name (block:port) is returned.
Returns
A string with the name of the port.

◆ getPorts()

const setPorts & DFnetlist_Impl::getPorts ( blockID  id,
PortDirection  dir 
) const

Returns a set of ports with a certain direction.

Parameters
idBlock id (the owner of the ports).
dirDirection of the ports (input/output/all).
Returns
The set of ports.

◆ getPortType()

PortType DFnetlist_Impl::getPortType ( portID  port) const

Returns the type of a port.

Parameters
portThe id of the port.
Returns
The type of the port.

◆ getPortWidth()

int DFnetlist_Impl::getPortWidth ( portID  port) const

Returns the width of a port.

Parameters
portThe id of the port.
Returns
The width of the port.

◆ getSrcBlock()

blockID DFnetlist_Impl::getSrcBlock ( channelID  id) const

Returns the source block of a channel.

Parameters
idId of the channel.
Returns
The source block. It returns invalidBlock in case of error.

◆ getSrcPort()

portID DFnetlist_Impl::getSrcPort ( channelID  id) const

Returns the source port of a channel.

Parameters
idId of the channel.
Returns
The source port. It returns invalidPort in case of error.

◆ getTrueFrac()

double DFnetlist_Impl::getTrueFrac ( blockID  id) const

Returns the the true/false exe. fraction of a select op.

Parameters
idIdentifier of the block.
Returns
The execution frequency of the block.

◆ getTruePort()

portID DFnetlist_Impl::getTruePort ( blockID  id) const
Parameters
idBlock id.
Returns
The True port of a block (invalidDataflowID if it does not exists).

◆ getValue()

long long DFnetlist_Impl::getValue ( blockID  id)

Defines the value of a constant block.

Parameters
idIdentifier of the block.
valueValue of the constant.

◆ hasBuffer()

bool DFnetlist_Impl::hasBuffer ( channelID  id) const

Checks whether a channel has an elastic buffer (slots > 0).

Parameters
idIdentifier of the channel.
Returns
True if it has a buffer, and false otherwise.

◆ hasError()

bool DFnetlist_Impl::hasError ( ) const

Indicates whether there is an error.

Returns
True if there is an error and false otherwise.

◆ insertBuffer() [1/2]

blockID DFnetlist_Impl::insertBuffer ( channelID  c,
int  slots,
bool  transparent 
)

Inserts a buffer in a channel. The insertion removes the previous channel and creates two new channels.

Parameters
cThe channel identifier.
slotsNumber of slots of the buffer.
transparentTrue if the channel must be transparent and false if opaque.
Returns
The block identifier.

◆ insertBuffer() [2/2]

blockID DFnetlist_Impl::insertBuffer ( channelID  c,
int  slots,
bool  transparent,
bool  EB 
)

Inserts a buffer in a channel. The insertion removes the previous channel and creates two new channels.

Parameters
cThe channel identifier.
slotsNumber of slots of the buffer.
transparentTrue if the channel must be transparent and false if opaque.
EBTrue if an elastic buffer needs to be placed.
Returns
The block identifier.

◆ isBooleanConstant()

bool DFnetlist_Impl::isBooleanConstant ( portID  port,
bool &  value 
) const

Indicates whether the port has a constant boolean value.

Parameters
portIdentifier of the port.
valueValue of the constant in case the port has a constant value.
Returns
True if it has a Boolean constant value, and false otherwise.

◆ isBooleanPort()

bool DFnetlist_Impl::isBooleanPort ( portID  port) const

Checks whether a port is Boolean.

Parameters
portThe id of the port.
Returns
True if it is boolean, and false otherwise.

◆ isBufferTransparent()

bool DFnetlist_Impl::isBufferTransparent ( blockID  id) const

Checks whether the buffer is transparent.

Parameters
idIdentifier of the block.
Returns
True if transparent, and false if opaque.

◆ isChannelTransparent()

bool DFnetlist_Impl::isChannelTransparent ( channelID  id) const

Checks whether the buffer of the channel is transparent.

Parameters
idIdentifier of the channel.
Returns
True if transparent, and false if opaque.

◆ isControlPort()

bool DFnetlist_Impl::isControlPort ( portID  port) const

Checks whether a port is a control port.

Parameters
portThe id of the port.
Returns
True if it is a control port, and false otherwise.

◆ isInputPort()

bool DFnetlist_Impl::isInputPort ( portID  port) const

Indicates whether a port is input.

Parameters
portThe id of the port.
Returns
True if it is an input port, and false if it is output.

◆ isOutputPort()

bool DFnetlist_Impl::isOutputPort ( portID  port) const

Indicates whether a port is output.

Parameters
portThe id of the port.
Returns
True if it is an output port, and false if it is input.

◆ isPortConnected()

bool DFnetlist_Impl::isPortConnected ( portID  port) const

Checks whether a port is connected.

Parameters
portThe port id.
Returns
True if the port is connected, and False otherwise.

◆ numBlocks()

int DFnetlist_Impl::numBlocks ( ) const
Returns
The number of blocks of the netlist.

◆ numChannels()

int DFnetlist_Impl::numChannels ( ) const
Returns
The number of channels of the netlist.

◆ numPorts()

int DFnetlist_Impl::numPorts ( ) const
Returns
The number of ports of the netlist.

◆ optimize()

bool DFnetlist_Impl::optimize ( )

Performs different types of optimizations to reduce the complexity of the dataflow netlist. It also calculates the rechable definitions for every block.

Returns
True if changes have been produced, and false otherwise.

◆ removeBlock()

void DFnetlist_Impl::removeBlock ( blockID  block)

Removes a block and all the associated channels from the netlist.

Parameters
blockIdentifier of the block.

◆ removeBuffer()

channelID DFnetlist_Impl::removeBuffer ( blockID  buf)

Removes a buffer and reconnects the input and output channels.

Parameters
bufIdentifier of the buffer.
Returns
The identifier of the new channel.

◆ removeChannel()

void DFnetlist_Impl::removeChannel ( channelID  id)

Removes a channel.

Parameters
idId of the channel.

◆ removeControl()

bool DFnetlist_Impl::removeControl ( )

Remove the control (synchronization) blocks of the dataflow netlist.

Returns
True if changes have been produced, and false otherwise.

◆ removePort()

void DFnetlist_Impl::removePort ( portID  port)

Removes a port and the associated channels from the netlist.

Parameters
portIdentifier of the port.

◆ setBasicBlock()

void DFnetlist_Impl::setBasicBlock ( blockID  id,
bbID  bb = invalidDataflowID 
)

Defines the basic block of a block.

Parameters
idIdentifer of the block

◆ setBlockDelay()

void DFnetlist_Impl::setBlockDelay ( blockID  id,
double  d,
int  indx 
)

Sets the delay of a block.

Parameters
idIdentifier of the block.
dDelay of the block.

◆ setBufferSize()

void DFnetlist_Impl::setBufferSize ( blockID  id,
int  slots 
)

Sets the number of slots of an elastic buffer.

Parameters
idIdentifier of the block.
slotsNumber of slots of the buffer.

◆ setBufferTransparency()

void DFnetlist_Impl::setBufferTransparency ( blockID  id,
bool  value 
)

Sets the transparency of an elastic buffer.

Parameters
idIdentifier of the block.
valueTrue if transparent, and false if opaque.

◆ setChannelBufferSize()

void DFnetlist_Impl::setChannelBufferSize ( blockID  id,
int  slots 
)

Sets the number of slots of the elastic buffer in the channel.

Parameters
idIdentifier of the channel.
slotsNumber of slots of the buffer.

◆ setChannelEB()

void DFnetlist_Impl::setChannelEB ( channelID  id)

Sets the presence of an EB on the channel.

//Carmine 21.02.22

Parameters
idIdentifier of the channel.

◆ setChannelTransparency()

void DFnetlist_Impl::setChannelTransparency ( channelID  id,
bool  value 
)

Sets the transparency of the elastic buffer in the channel.

Parameters
idIdentifier of the channel.
valueTrue if transparent, and false if opaque.

◆ setError()

void DFnetlist_Impl::setError ( const std::string &  err)

Sets an error message for the netlist.

Parameters
errError message.

◆ setExecutionFrequency()

void DFnetlist_Impl::setExecutionFrequency ( blockID  id,
double  freq 
)

Sets the execution frequency of a block.

Parameters
idIdentifier of the block.
freqExecution frequency of the block.

◆ setInitiationInterval()

void DFnetlist_Impl::setInitiationInterval ( blockID  id,
int  ii 
)

Sets the initiation interval of a block.

Parameters
idIdentifier of the block.
iiInitiation interval of the block.

◆ setLatency()

void DFnetlist_Impl::setLatency ( blockID  id,
int  lat 
)

Sets the latency of a block.

Parameters
idIdentifier of the block.
latLatency of the block.

◆ setMilpSolver()

void DFnetlist_Impl::setMilpSolver ( const std::string &  solver = "cbc")

Sets the solver for MILP optimization problems.

Parameters
solverName of the solver (usually cbc or glpsol).

◆ setOperation()

void DFnetlist_Impl::setOperation ( blockID  id,
std::string  op 
)

Defines the operation (instruction) of operators.

Lana 07.03.19

Parameters
idIdentifier of the block.
opOperation.

◆ setPortDelay()

void DFnetlist_Impl::setPortDelay ( portID  port,
double  d 
)

Sets the delay of a port.

Parameters
portIdentifier of the port.
dThe delay.

◆ setPortWidth()

void DFnetlist_Impl::setPortWidth ( portID  port,
int  width 
)

Defines the width of a port.

Parameters
portThe id of the port.
widthThe width of the port.

◆ setTrueFrac()

void DFnetlist_Impl::setTrueFrac ( blockID  id,
double  freq 
)

Sets the true/false exe. fraction of a select op.

Parameters
idIdentifier of the block.
freqExecution frequency of the block.

◆ setValue()

void DFnetlist_Impl::setValue ( blockID  id,
longValueType  value 
)

Defines the value of a constant block.

Parameters
idIdentifier of the block.
valueValue of the constant.

◆ validBlock()

bool DFnetlist_Impl::validBlock ( blockID  id) const

Indicates whether a block id is valid.

Parameters
idThe id of the block.
Returns
True if the id is valid and false otherwise.

◆ validChannel()

bool DFnetlist_Impl::validChannel ( channelID  id) const

Indicates whether a channel id is valid.

Parameters
idThe id of the channel.
Returns
True if the id is valid and false otherwise.

◆ validPort()

bool DFnetlist_Impl::validPort ( portID  p) const
Parameters
pThe port id.
Returns
True if it is valid and false otherwise.

◆ writeBasicBlockDot() [1/2]

bool Dataflow::DFnetlist_Impl::writeBasicBlockDot ( const std::string &  filename = "")

Writes the basic blocks of a dataflow netlist in dot format.

Parameters
filenameThe name of the file. In case the filename is empty, it is written into cout.
Returns
true if successful, and false otherwise.

◆ writeBasicBlockDot() [2/2]

bool DFnetlist_Impl::writeBasicBlockDot ( std::ostream &  s)

Writes the basic blocks of a dataflow netlist in dot format.

Parameters
sThe output stream.
Returns
True if successful, and false otherwise.

◆ writeDot() [1/2]

bool Dataflow::DFnetlist_Impl::writeDot ( const std::string &  filename = "")

Writes the dataflow netlist in dot format.

Parameters
filenameThe name of the file. In case the filename is empty, it is written into cout.
Returns
true if successful, and false otherwise.

◆ writeDot() [2/2]

bool DFnetlist_Impl::writeDot ( std::ostream &  of)

Writes the dataflow netlist in dot format.

Parameters
sThe output stream.
Returns
True if successful, and false otherwise.

The documentation for this class was generated from the following files: