OpenASIP  2.0
Public Member Functions | List of all members
HDLGenerator::CodeBlock Class Reference

#include <HDLGenerator.hh>

Inheritance diagram for HDLGenerator::CodeBlock:
Inheritance graph
Collaboration diagram for HDLGenerator::CodeBlock:
Collaboration graph

Public Member Functions

 CodeBlock ()
 
template<typename SS >
void append (SS cc)
 
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 build ()
 
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
 

Detailed Description

Code block, i.e., a collection of concurrent statements

Definition at line 876 of file HDLGenerator.hh.

Constructor & Destructor Documentation

◆ CodeBlock()

HDLGenerator::CodeBlock::CodeBlock ( )
inline

Definition at line 878 of file HDLGenerator.hh.

878 : SequentialStatement("codeBlock") {}

Member Function Documentation

◆ append()

template<typename SS >
void HDLGenerator::CodeBlock::append ( SS  cc)
inline

Definition at line 881 of file HDLGenerator.hh.

881  {
882  std::shared_ptr<SequentialStatement> ptr = std::make_shared<SS>(cc);
883  pushComponent(ptr);
884  }

References HDLGenerator::Generatable::pushComponent().

Referenced by FUGen::buildOperations(), FUGen::createOutputPipeline(), FUGen::createPortPipeline(), and FUGen::prepareSnippet().

Here is the call graph for this function:

◆ hdl()

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

Reimplemented from HDLGenerator::SequentialStatement.

Definition at line 886 of file HDLGenerator.hh.

886  {
887  if (lang == Language::VHDL) {
888  implementAll(stream, lang, level);
889  } else if (lang == Language::Verilog) {
890  implementAll(stream, lang, level);
891  } else {
892  throw std::runtime_error(__PRETTY_FUNCTION__);
893  }
894  }

References HDLGenerator::Generatable::implementAll(), HDLGenerator::Verilog, and HDLGenerator::VHDL.

Here is the call graph for this function:

The documentation for this class was generated from the following file:
HDLGenerator::Generatable::pushComponent
void pushComponent(std::shared_ptr< Generatable > c)
Definition: Generatable.hh:230
HDLGenerator::Language::Verilog
@ Verilog
HDLGenerator::SequentialStatement::SequentialStatement
SequentialStatement(std::string name)
Definition: HDLGenerator.hh:123
HDLGenerator::Generatable::implementAll
virtual void implementAll(std::ostream &stream, Language lang)
Definition: Generatable.hh:183
HDLGenerator::Language::VHDL
@ VHDL