OpenASIP  2.0
Public Member Functions | Protected Attributes | List of all members
HDLGenerator::LHSValue Class Reference

#include <LHSValue.hh>

Inheritance diagram for HDLGenerator::LHSValue:
Inheritance graph
Collaboration diagram for HDLGenerator::LHSValue:
Collaboration graph

Public Member Functions

 LHSValue ()
 
void hdl (std::ostream &stream, Language lang, int level)
 
void hdl (std::ostream &stream, Language lang)
 
void writeSignals (std::unordered_set< std::string > &readList) const
 
std::string vhdl () const
 
std::string verilog () const
 
LHSValue operator|| (LHSValue rhs)
 
LHSValue operator| (LHSValue rhs)
 
LHSValue operator&& (LHSValue rhs)
 
LHSValue operator& (LHSValue rhs)
 
LHSValue operator^ (LHSValue rhs)
 
LHSValue operator! ()
 
LHSValue operator~ ()
 

Protected Attributes

std::unordered_set< std::string > readList_
 
std::string vhdl_
 
std::string verilog_
 

Detailed Description

Base class for left-hand side values (assignments, If clauses)

Definition at line 39 of file LHSValue.hh.

Constructor & Destructor Documentation

◆ LHSValue()

HDLGenerator::LHSValue::LHSValue ( )
inline

Definition at line 41 of file LHSValue.hh.

41 {}

Member Function Documentation

◆ hdl() [1/2]

void HDLGenerator::LHSValue::hdl ( std::ostream &  stream,
Language  lang 
)

Definition at line 43 of file LHSValue.cc.

43  {
44  if (lang == Language::VHDL) {
45  stream << vhdl_;
46  } else {
47  stream << verilog_;
48  }
49 }

References verilog_, HDLGenerator::VHDL, and vhdl_.

◆ hdl() [2/2]

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

Definition at line 37 of file LHSValue.cc.

37  {
38  stream << StringTools::indent(level);
39  hdl(stream, lang);
40 }

References StringTools::indent().

Referenced by HDLGenerator::Assign::hdl(), HDLGenerator::Switch::hdl(), and HDLGenerator::Register::reset().

Here is the call graph for this function:

◆ operator!()

LHSValue HDLGenerator::LHSValue::operator! ( )

Definition at line 84 of file LHSValue.cc.

84  {
85  return LogicalNot(*this);
86 }

◆ operator&()

LHSValue HDLGenerator::LHSValue::operator& ( LHSValue  rhs)

Definition at line 74 of file LHSValue.cc.

74  {
75  return BitwiseAnd(*this, rhs);
76 }

◆ operator&&()

LHSValue HDLGenerator::LHSValue::operator&& ( LHSValue  rhs)

Definition at line 69 of file LHSValue.cc.

69  {
70  return LogicalAnd(*this, rhs);
71 }

◆ operator^()

LHSValue HDLGenerator::LHSValue::operator^ ( LHSValue  rhs)

Definition at line 79 of file LHSValue.cc.

79  {
80  return BitwiseXor(*this, rhs);
81 }

◆ operator|()

LHSValue HDLGenerator::LHSValue::operator| ( LHSValue  rhs)

Definition at line 64 of file LHSValue.cc.

64  {
65  return BitwiseOr(*this, rhs);
66 }

◆ operator||()

LHSValue HDLGenerator::LHSValue::operator|| ( LHSValue  rhs)

Definition at line 59 of file LHSValue.cc.

59  {
60  return LogicalOr(*this, rhs);
61 }

◆ operator~()

LHSValue HDLGenerator::LHSValue::operator~ ( )

Definition at line 89 of file LHSValue.cc.

89  {
90  return BitwiseNot(*this);
91 }

◆ verilog()

std::string HDLGenerator::LHSValue::verilog ( ) const
inline

Definition at line 46 of file LHSValue.hh.

46 { return verilog_; }

References verilog_.

Referenced by HDLGenerator::BinaryOp::BinaryOp(), HDLGenerator::Reduce::Reduce(), and HDLGenerator::UnaryOp::UnaryOp().

◆ vhdl()

std::string HDLGenerator::LHSValue::vhdl ( ) const
inline

Definition at line 45 of file LHSValue.hh.

45 { return vhdl_; }

References vhdl_.

Referenced by HDLGenerator::BinaryOp::BinaryOp(), HDLGenerator::Reduce::Reduce(), and HDLGenerator::UnaryOp::UnaryOp().

◆ writeSignals()

void HDLGenerator::LHSValue::writeSignals ( std::unordered_set< std::string > &  readList) const

Definition at line 52 of file LHSValue.cc.

52  {
53  for (auto a : readList_) {
54  readList.insert(a);
55  }
56 }

References readList_.

Referenced by HDLGenerator::BinaryOp::BinaryOp(), HDLGenerator::Generatable::reads(), HDLGenerator::Reduce::Reduce(), and HDLGenerator::UnaryOp::UnaryOp().

Member Data Documentation

◆ readList_

std::unordered_set<std::string> HDLGenerator::LHSValue::readList_
protected

◆ verilog_

std::string HDLGenerator::LHSValue::verilog_
protected

◆ vhdl_

std::string HDLGenerator::LHSValue::vhdl_
protected

The documentation for this class was generated from the following files:
HDLGenerator::LHSValue::vhdl_
std::string vhdl_
Definition: LHSValue.hh:59
StringTools::indent
static std::string indent(int level)
Definition: StringTools.cc:319
HDLGenerator::LHSValue::hdl
void hdl(std::ostream &stream, Language lang, int level)
Definition: LHSValue.cc:37
HDLGenerator::LHSValue::verilog_
std::string verilog_
Definition: LHSValue.hh:60
HDLGenerator::LHSValue::readList_
std::unordered_set< std::string > readList_
Definition: LHSValue.hh:58
HDLGenerator::Language::VHDL
@ VHDL