OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
HDLGenerator::HDLOperation Class Reference

#include <HDLGenerator.hh>

Inheritance diagram for HDLGenerator::HDLOperation:
Inheritance graph
Collaboration diagram for HDLGenerator::HDLOperation:
Collaboration graph

Public Member Functions

 HDLOperation ()
 
 HDLOperation (std::string name, std::deque< std::string > impl, Language lang)
 
HDLOperationoperator<< (const std::string &rhs)
 
HDLOperationoperator<< (const std::string &&rhs)
 
void build () override
 
void hdl (std::ostream &stream, Language lang, int level) override
 
- Public Member Functions inherited from HDLGenerator::SequentialStatement
 SequentialStatement (std::string name)
 
- Public Member Functions inherited from HDLGenerator::Generatable
 Generatable (std::string name)
 
virtual ~Generatable ()=default
 
virtual void reads (const std::string &var)
 
virtual void reads (const LHSValue &var)
 
virtual void writes (const std::string &var)
 
virtual RegistergetRegister (const std::string &var)
 
virtual bool hasOption (const std::string &var)
 
virtual bool isRegister (const std::string &name)
 
virtual bool isVariable (const std::string &name)
 
virtual bool isConstant (const std::string &name)
 
virtual Width width (const std::string &name)
 
int integerWidth (const std::string &name)
 
virtual WireType wireType (const std::string &name)
 
virtual Width width ()
 
virtual WireType wireType () const
 
virtual void hdl (std::ostream &stream, Language lang)
 
virtual void implementAll (std::ostream &stream, Language lang)
 
virtual void implementAll (std::ostream &stream, Language lang, int indent)
 
template<typename Func >
void forAll (Func func)
 
template<typename Type , typename Func >
void forAll (Func func)
 
template<class Type >
bool parentIs ()
 
template<class Type >
Type * parentType ()
 
void pushComponent (std::shared_ptr< Generatable > c)
 
template<class Component >
void addComponent (Component c)
 
const std::string & name () const noexcept
 
void setParent (Generatable *parent) noexcept
 
Generatableparent () const noexcept
 

Private Attributes

std::deque< std::string > impl_
 
std::vector< std::string > readList_
 
Language lang_
 

Detailed Description

Represents VHDL operation snippet.

Definition at line 141 of file HDLGenerator.hh.

Constructor & Destructor Documentation

◆ HDLOperation() [1/2]

HDLGenerator::HDLOperation::HDLOperation ( )
inline

Definition at line 143 of file HDLGenerator.hh.

143: SequentialStatement("no-op") {}

◆ HDLOperation() [2/2]

HDLGenerator::HDLOperation::HDLOperation ( std::string  name,
std::deque< std::string >  impl,
Language  lang 
)
inline

Definition at line 144 of file HDLGenerator.hh.

146 : SequentialStatement(name), impl_(std::move(impl)), lang_(lang) {}
const std::string & name() const noexcept
std::deque< std::string > impl_

Member Function Documentation

◆ build()

void HDLGenerator::HDLOperation::build ( )
inlineoverridevirtual

Reimplemented from HDLGenerator::Generatable.

Definition at line 158 of file HDLGenerator.hh.

158 {
160 for (auto&& r : readList_) {
161 reads(r);
162 }
163 }
virtual void reads(const std::string &var)
std::vector< std::string > readList_

References HDLGenerator::Generatable::build(), readList_, and HDLGenerator::Generatable::reads().

Here is the call graph for this function:

◆ hdl()

void HDLGenerator::HDLOperation::hdl ( std::ostream &  stream,
Language  lang,
int  level 
)
inlineoverridevirtual

Reimplemented from HDLGenerator::SequentialStatement.

Definition at line 165 of file HDLGenerator.hh.

165 {
166 if (lang != lang_)
167 throw std::runtime_error(__PRETTY_FUNCTION__);
168
169 for (auto&& line : impl_) {
170 stream << StringTools::indent(level) << line << "\n";
171 }
172 }
static std::string indent(int level)

References impl_, StringTools::indent(), and lang_.

Here is the call graph for this function:

◆ operator<<() [1/2]

HDLOperation & HDLGenerator::HDLOperation::operator<< ( const std::string &&  rhs)
inline

Definition at line 153 of file HDLGenerator.hh.

153 {
154 readList_.emplace_back(rhs);
155 return *this;
156 }

References readList_.

◆ operator<<() [2/2]

HDLOperation & HDLGenerator::HDLOperation::operator<< ( const std::string &  rhs)
inline

Definition at line 148 of file HDLGenerator.hh.

148 {
149 readList_.emplace_back(rhs);
150 return *this;
151 }

References readList_.

Member Data Documentation

◆ impl_

std::deque<std::string> HDLGenerator::HDLOperation::impl_
private

Definition at line 175 of file HDLGenerator.hh.

Referenced by hdl().

◆ lang_

Language HDLGenerator::HDLOperation::lang_
private

Definition at line 177 of file HDLGenerator.hh.

Referenced by hdl().

◆ readList_

std::vector<std::string> HDLGenerator::HDLOperation::readList_
private

Definition at line 176 of file HDLGenerator.hh.

Referenced by build(), operator<<(), and operator<<().


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