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

#include <HDLGenerator.hh>

Inheritance diagram for HDLGenerator::SignedVariable:
Inheritance graph
Collaboration diagram for HDLGenerator::SignedVariable:
Collaboration graph

Public Member Functions

 SignedVariable (std::string name, int width=1)
 
 SignedVariable (std::string name, std::string width)
 
std::string vhdlTypeDeclaration ()
 
std::string verilogTypeDeclaration ()
 
- Public Member Functions inherited from HDLGenerator::Variable
 Variable (std::string name, int width=1)
 
 Variable (std::string name, std::string width)
 
Width width () final
 
void declare (std::ostream &stream, Language lang, int level)
 
std::string vhdlRange ()
 
std::string verilogRange ()
 
std::string verilogTypeDeclaration ()
 
bool isVector ()
 
WireType wireType ()
 
- 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 WireType wireType () const
 
virtual void hdl (std::ostream &stream, Language lang, int indent)
 
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

Signed variable/async reg signed.

Definition at line 516 of file HDLGenerator.hh.

Constructor & Destructor Documentation

◆ SignedVariable() [1/2]

HDLGenerator::SignedVariable::SignedVariable ( std::string  name,
int  width = 1 
)
inline

Definition at line 518 of file HDLGenerator.hh.

519  : Variable(name, width) {}

◆ SignedVariable() [2/2]

HDLGenerator::SignedVariable::SignedVariable ( std::string  name,
std::string  width 
)
inline

Definition at line 520 of file HDLGenerator.hh.

521  : Variable(name, width) {}

Member Function Documentation

◆ verilogTypeDeclaration()

std::string HDLGenerator::SignedVariable::verilogTypeDeclaration ( )
inline

Definition at line 527 of file HDLGenerator.hh.

527  {
528  std::string decl = "reg signed";
529  if (isVector()) {
530  decl += " " + verilogRange();
531  }
532  return decl;
533  }

References HDLGenerator::Variable::isVector(), and HDLGenerator::Variable::verilogRange().

Here is the call graph for this function:

◆ vhdlTypeDeclaration()

std::string HDLGenerator::SignedVariable::vhdlTypeDeclaration ( )
inlinevirtual

Reimplemented from HDLGenerator::Variable.

Definition at line 523 of file HDLGenerator.hh.

523  {
524  return "signed" + vhdlRange();
525  }

References HDLGenerator::Variable::vhdlRange().

Here is the call graph for this function:

The documentation for this class was generated from the following file:
HDLGenerator::Variable::verilogRange
std::string verilogRange()
Definition: HDLGenerator.hh:445
HDLGenerator::Variable::vhdlRange
std::string vhdlRange()
Definition: HDLGenerator.hh:437
HDLGenerator::Variable::Variable
Variable(std::string name, int width=1)
Definition: HDLGenerator.hh:415
HDLGenerator::Variable::isVector
bool isVector()
Definition: HDLGenerator.hh:465
HDLGenerator::Variable::width
Width width() final
Definition: HDLGenerator.hh:422
HDLGenerator::Generatable::name
const std::string & name() const noexcept
Definition: Generatable.hh:239