Permalink
Browse files

Expression width rework.

This patch is a major rework of expression elaboration and
evaluation in the compiler, aimed at better compliance with
the IEEE standard.
  • Loading branch information...
1 parent 2df6850 commit 312b4da46fe94a2af619b3c95f0503334bf19a4e @martinwhitaker martinwhitaker committed with steveicarus Feb 26, 2011
Showing with 1,501 additions and 2,687 deletions.
  1. +1 −1 Makefile.in
  2. +2 −6 PDelays.cc
  3. +19 −6 PExpr.cc
  4. +141 −119 PExpr.h
  5. +2 −6 design_dump.cc
  6. +119 −25 dup_expr.cc
  7. +787 −1,082 elab_expr.cc
  8. +1 −19 elab_lval.cc
  9. +0 −12 elab_net.cc
  10. +3 −15 elab_scope.cc
  11. +1 −12 elab_sig.cc
  12. +30 −139 elaborate.cc
  13. +1 −3 elaborate_analog.cc
  14. +107 −211 eval_tree.cc
  15. +7 −34 net_design.cc
  16. +18 −258 net_expr.cc
  17. +1 −4 net_proc.cc
  18. +39 −85 netlist.cc
  19. +43 −103 netlist.h
  20. +113 −30 netmisc.cc
  21. +20 −27 netmisc.h
  22. +0 −486 set_width.cc
  23. +2 −2 t-dll-expr.cc
  24. +36 −1 verinum.cc
  25. +8 −1 verinum.h
View
@@ -106,7 +106,7 @@ O = main.o async.o design_dump.o discipline.o dup_expr.o elaborate.o \
netenum.o net_event.o net_expr.o net_func.o net_link.o net_modulo.o \
net_nex_input.o net_nex_output.o net_proc.o net_scope.o net_tran.o \
net_udp.o pad_to_width.o parse.o parse_misc.o pform.o pform_analog.o \
- pform_disciplines.o pform_dump.o pform_types.o set_width.o \
+ pform_disciplines.o pform_dump.o pform_types.o \
symbol_search.o sync.o sys_funcs.o verinum.o verireal.o target.o \
Attrib.o HName.o Module.o PDelays.o PEvent.o PExpr.o PGate.o \
PGenerate.o PScope.o PSpec.o PTask.o PUdp.o PFunction.o PWire.o \
View
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999-2010 Stephen Williams (steve@icarus.com)
+ * Copyright (c) 1999-2011 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -78,11 +78,7 @@ unsigned PDelays::delay_count() const
static NetExpr*calculate_val(Design*des, NetScope*scope, PExpr*expr)
{
- ivl_variable_type_t tmp_type = IVL_VT_NO_TYPE;
- bool tmp_flag = false;
- expr->test_width(des, scope, 0, 0, tmp_type, tmp_flag);
- NetExpr*dex = expr->elaborate_expr(des, scope, -1, false);
- eval_expr(dex);
+ NetExpr*dex = elab_and_eval(des, scope, expr, -1);
/* Print a warning if we find default and `timescale based
* delays in the design, since this is likely an error. */
View
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2010 Stephen Williams <steve@icarus.com>
+ * Copyright (c) 1998-2011 Stephen Williams <steve@icarus.com>
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -31,8 +31,10 @@
PExpr::PExpr()
{
- expr_width_ = 0;
- expr_type_ = IVL_VT_NO_TYPE;
+ expr_type_ = IVL_VT_NO_TYPE;
+ expr_width_ = 0;
+ min_width_ = 0;
+ signed_flag_ = false;
}
PExpr::~PExpr()
@@ -94,8 +96,8 @@ bool PEBinary::has_aa_term(Design*des, NetScope*scope) const
PEBComp::PEBComp(char op, PExpr*l, PExpr*r)
: PEBinary(op, l, r)
{
- left_width_ = 0;
- right_width_ = 0;
+ l_width_ = 0;
+ r_width_ = 0;
}
PEBComp::~PEBComp()
@@ -204,13 +206,16 @@ bool PECallFunction::has_aa_term(Design*des, NetScope*scope) const
}
PEConcat::PEConcat(const list<PExpr*>&p, PExpr*r)
-: parms_(p.size()), tested_widths_(p.size()), repeat_(r)
+: parms_(p.size()), width_modes_(p.size()), repeat_(r)
{
int tmp_idx = 0;
assert(parms_.size() == p.size());
for (list<PExpr*>::const_iterator idx = p.begin()
; idx != p.end() ; ++idx)
parms_[tmp_idx++] = *idx;
+
+ tested_scope_ = 0;
+ repeat_count_ = 1;
}
PEConcat::~PEConcat()
@@ -437,3 +442,11 @@ bool PEUnary::has_aa_term(Design*des, NetScope*scope) const
assert(expr_);
return expr_->has_aa_term(des, scope);
}
+
+PEVoid::PEVoid()
+{
+}
+
+PEVoid::~PEVoid()
+{
+}
Oops, something went wrong.

0 comments on commit 312b4da

Please sign in to comment.