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

#include <HDLGenerator.hh>

Inheritance diagram for HDLGenerator::DefaultCase:
Inheritance graph
Collaboration diagram for HDLGenerator::DefaultCase:
Collaboration graph

Public Member Functions

 DefaultCase ()
 
DefaultCaseoperator<< (DefaultAssign &&rhs)
 
DefaultCaseoperator<< (DefaultAssign &rhs)
 
void hdl (std::ostream &stream, Language lang, int level) override
 
- 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

When others/default.

Definition at line 614 of file HDLGenerator.hh.

Constructor & Destructor Documentation

◆ DefaultCase()

HDLGenerator::DefaultCase::DefaultCase ( )
inline

Definition at line 616 of file HDLGenerator.hh.

616 : Generatable("defaultCase") {}

Member Function Documentation

◆ hdl()

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

Reimplemented from HDLGenerator::Generatable.

Definition at line 628 of file HDLGenerator.hh.

628  {
629  if (lang == Language::VHDL) {
630  stream << StringTools::indent(level) << "when others =>\n";
631  implementAll(stream, lang, level);
632  } else if (lang == Language::Verilog) {
633  stream << StringTools::indent(level) << "default: begin\n";
634  implementAll(stream, lang, level);
635  stream << StringTools::indent(level) << "end\n";
636  } else {
637  throw std::runtime_error(__PRETTY_FUNCTION__);
638  }
639  }

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

Here is the call graph for this function:

◆ operator<<() [1/2]

DefaultCase& HDLGenerator::DefaultCase::operator<< ( DefaultAssign &&  rhs)
inline

Definition at line 618 of file HDLGenerator.hh.

618  {
619  addComponent(rhs);
620  return *this;
621  }

References HDLGenerator::Generatable::addComponent().

Here is the call graph for this function:

◆ operator<<() [2/2]

DefaultCase& HDLGenerator::DefaultCase::operator<< ( DefaultAssign rhs)
inline

Definition at line 623 of file HDLGenerator.hh.

623  {
624  addComponent(rhs);
625  return *this;
626  }

References HDLGenerator::Generatable::addComponent().

Here is the call graph for this function:

The documentation for this class was generated from the following file:
StringTools::indent
static std::string indent(int level)
Definition: StringTools.cc:319
HDLGenerator::Generatable::addComponent
void addComponent(Component c)
Definition: Generatable.hh:235
HDLGenerator::Generatable::Generatable
Generatable(std::string name)
Definition: Generatable.hh:53
HDLGenerator::Language::Verilog
@ Verilog
HDLGenerator::Generatable::implementAll
virtual void implementAll(std::ostream &stream, Language lang)
Definition: Generatable.hh:183
HDLGenerator::Language::VHDL
@ VHDL