Skip to content

Commit

Permalink
unary expressions as parameters (PR#42, PR#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
steve committed Dec 9, 2000
1 parent 371f43e commit 245472c
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion t-vvm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: t-vvm.cc,v 1.186 2000/11/30 17:31:42 steve Exp $"
#ident "$Id: t-vvm.cc,v 1.187 2000/12/09 06:17:20 steve Exp $"
#endif

# include <iostream>
Expand Down Expand Up @@ -375,6 +375,7 @@ class vvm_parm_rval : public expr_scan_t {
virtual void expr_scope(const NetEScope*);
virtual void expr_sfunc(const NetESFunc*);
virtual void expr_signal(const NetESignal*);
virtual void expr_unary(const NetEUnary*);

private:
target_vvm*tgt_;
Expand Down Expand Up @@ -804,6 +805,17 @@ void vvm_parm_rval::expr_binary(const NetEBinary*expr)
result = "&" + tmp + ".base";
}

void vvm_parm_rval::expr_unary(const NetEUnary*expr)
{
string rval = emit_proc_rval(tgt_, expr);

string tmp = make_temp();
tgt_->defn << " struct __vpiNumberConst " << tmp << ";" << endl;
tgt_->defn << " vpip_make_number_const(&" << tmp << ", "
<< rval << ".bits, " << expr->expr_width() << ");" << endl;
result = "&" + tmp + ".base";
}

void vvm_parm_rval::expr_const(const NetEConst*expr)
{
if (expr->value().is_string()) {
Expand Down Expand Up @@ -3358,6 +3370,9 @@ extern const struct target tgt_vvm = {
};
/*
* $Log: t-vvm.cc,v $
* Revision 1.187 2000/12/09 06:17:20 steve
* unary expressions as parameters (PR#42, PR#68)
*
* Revision 1.186 2000/11/30 17:31:42 steve
* Change LineInfo to store const C strings.
*
Expand Down

0 comments on commit 245472c

Please sign in to comment.