diff --git a/tgt-vhdl/vhdl_element.cc b/tgt-vhdl/vhdl_element.cc index ab3d49b14..3deff1a69 100644 --- a/tgt-vhdl/vhdl_element.cc +++ b/tgt-vhdl/vhdl_element.cc @@ -444,3 +444,10 @@ void vhdl_null_stmt::emit(std::ofstream &of, int level) const { of << "null;"; } + +void vhdl_fcall::emit(std::ofstream &of, int level) const +{ + of << name_; + exprs_.emit(of, level); +} + diff --git a/tgt-vhdl/vhdl_element.hh b/tgt-vhdl/vhdl_element.hh index 80029e585..0b15c7362 100644 --- a/tgt-vhdl/vhdl_element.hh +++ b/tgt-vhdl/vhdl_element.hh @@ -81,6 +81,7 @@ private: vhdl_type *type_; }; + /* * A normal scalar variable reference. */ @@ -94,6 +95,7 @@ private: std::string name_; }; + class vhdl_const_string : public vhdl_expr { public: vhdl_const_string(const char *value) @@ -104,6 +106,7 @@ private: std::string value_; }; + class vhdl_expr_list : public vhdl_element { public: ~vhdl_expr_list(); @@ -115,6 +118,23 @@ private: }; +/* + * A function call within an expression. + */ +class vhdl_fcall : public vhdl_expr { +public: + vhdl_fcall(const char *name, vhdl_type *rtype) + : vhdl_expr(rtype), name_(name) {}; + ~vhdl_fcall() {} + + void add_expr(vhdl_expr *e) { exprs_.add_expr(e); } + void emit(std::ofstream &of, int level) const; +private: + std::string name_; + vhdl_expr_list exprs_; +}; + + /* * A concurrent statement appears in architecture bodies but not * processes.