OpenASIP  2.0
Public Member Functions | Private Attributes | List of all members
HDLGenerator::RawCodeLine Class Reference

#include <HDLGenerator.hh>

Inheritance diagram for HDLGenerator::RawCodeLine:
Inheritance graph
Collaboration diagram for HDLGenerator::RawCodeLine:
Collaboration graph

Public Member Functions

 RawCodeLine (std::string vhdl, std::string verilog)
 
void hdl (std::ostream &stream, Language lang, int level) final
 
- 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
 

Private Attributes

std::string vhdl_
 
std::string verilog_
 

Detailed Description

Raw code.

Definition at line 183 of file HDLGenerator.hh.

Constructor & Destructor Documentation

◆ RawCodeLine()

HDLGenerator::RawCodeLine::RawCodeLine ( std::string  vhdl,
std::string  verilog 
)
inline

Definition at line 185 of file HDLGenerator.hh.

186  : SequentialStatement("raw code line"),
187  vhdl_(vhdl), verilog_(verilog) {}

Member Function Documentation

◆ hdl()

void HDLGenerator::RawCodeLine::hdl ( std::ostream &  stream,
Language  lang,
int  level 
)
inlinefinalvirtual

Reimplemented from HDLGenerator::SequentialStatement.

Definition at line 189 of file HDLGenerator.hh.

189  {
190  if (lang == Language::VHDL) {
191  stream << StringTools::indent(level) << vhdl_ << "\n";
192  } else if (lang == Language::Verilog) {
193  stream << StringTools::indent(level) << verilog_ << "\n";
194  } else {
195  throw std::runtime_error(__PRETTY_FUNCTION__);
196  }
197  }

References StringTools::indent(), HDLGenerator::Verilog, verilog_, HDLGenerator::VHDL, and vhdl_.

Here is the call graph for this function:

Member Data Documentation

◆ verilog_

std::string HDLGenerator::RawCodeLine::verilog_
private

Definition at line 201 of file HDLGenerator.hh.

Referenced by hdl().

◆ vhdl_

std::string HDLGenerator::RawCodeLine::vhdl_
private

Definition at line 200 of file HDLGenerator.hh.

Referenced by hdl().


The documentation for this class was generated from the following file:
StringTools::indent
static std::string indent(int level)
Definition: StringTools.cc:319
HDLGenerator::Language::Verilog
@ Verilog
HDLGenerator::RawCodeLine::verilog_
std::string verilog_
Definition: HDLGenerator.hh:201
HDLGenerator::SequentialStatement::SequentialStatement
SequentialStatement(std::string name)
Definition: HDLGenerator.hh:123
HDLGenerator::RawCodeLine::vhdl_
std::string vhdl_
Definition: HDLGenerator.hh:200
HDLGenerator::Language::VHDL
@ VHDL