Skip to content

Commit

Permalink
Pass back target errors processing conditionals.
Browse files Browse the repository at this point in the history
  • Loading branch information
steve committed Jan 19, 2002
1 parent ec8b6e1 commit 608555c
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 29 deletions.
20 changes: 13 additions & 7 deletions emit.cc
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: emit.cc,v 1.63 2001/10/19 21:53:24 steve Exp $"
#ident "$Id: emit.cc,v 1.64 2002/01/19 19:02:08 steve Exp $"
#endif

# include "config.h"
Expand Down Expand Up @@ -186,8 +186,7 @@ bool NetCAssign::emit_proc(struct target_t*tgt) const

bool NetCondit::emit_proc(struct target_t*tgt) const
{
tgt->proc_condit(this);
return true;
return tgt->proc_condit(this);
}

bool NetDeassign::emit_proc(struct target_t*tgt) const
Expand Down Expand Up @@ -263,16 +262,20 @@ void NetBlock::emit_recurse(struct target_t*tgt) const
} while (cur != last_);
}

void NetCondit::emit_recurse_if(struct target_t*tgt) const
bool NetCondit::emit_recurse_if(struct target_t*tgt) const
{
if (if_)
if_->emit_proc(tgt);
return if_->emit_proc(tgt);
else
return true;
}

void NetCondit::emit_recurse_else(struct target_t*tgt) const
bool NetCondit::emit_recurse_else(struct target_t*tgt) const
{
if (else_)
else_->emit_proc(tgt);
return else_->emit_proc(tgt);
else
return true;
}

bool NetEvProbe::emit_node(struct target_t*tgt) const
Expand Down Expand Up @@ -474,6 +477,9 @@ bool emit(const Design*des, const char*type)

/*
* $Log: emit.cc,v $
* Revision 1.64 2002/01/19 19:02:08 steve
* Pass back target errors processing conditionals.
*
* Revision 1.63 2001/10/19 21:53:24 steve
* Support multiple root modules (Philip Blundell)
*
Expand Down
8 changes: 7 additions & 1 deletion net_force.cc
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: net_force.cc,v 1.6 2001/11/14 03:28:49 steve Exp $"
#ident "$Id: net_force.cc,v 1.7 2002/01/19 19:02:08 steve Exp $"
#endif

# include "config.h"
Expand Down Expand Up @@ -89,6 +89,8 @@ const NetNet*NetDeassign::lval() const
NetForce::NetForce(NetScope*s, const string&n, NetNet*l)
: NetNode(s, n, l->pin_count()), lval_(l)
{
lval_->incr_eref();

for (unsigned idx = 0 ; idx < pin_count() ; idx += 1) {
pin(idx).set_dir(Link::INPUT);
pin(idx).set_name("I", idx);
Expand All @@ -97,6 +99,7 @@ NetForce::NetForce(NetScope*s, const string&n, NetNet*l)

NetForce::~NetForce()
{
lval_->decr_eref();
}

const Link& NetForce::lval_pin(unsigned idx) const
Expand Down Expand Up @@ -127,6 +130,9 @@ const NetNet*NetRelease::lval() const

/*
* $Log: net_force.cc,v $
* Revision 1.7 2002/01/19 19:02:08 steve
* Pass back target errors processing conditionals.
*
* Revision 1.6 2001/11/14 03:28:49 steve
* DLL target support for force and release.
*
Expand Down
9 changes: 6 additions & 3 deletions netlist.h
Expand Up @@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: netlist.h,v 1.228 2001/12/31 00:08:14 steve Exp $"
#ident "$Id: netlist.h,v 1.229 2002/01/19 19:02:08 steve Exp $"
#endif

/*
Expand Down Expand Up @@ -1455,8 +1455,8 @@ class NetCondit : public NetProc {
// Replace the condition expression.
void set_expr(NetExpr*ex);

void emit_recurse_if(struct target_t*) const;
void emit_recurse_else(struct target_t*) const;
bool emit_recurse_if(struct target_t*) const;
bool emit_recurse_else(struct target_t*) const;

virtual bool emit_proc(struct target_t*) const;
virtual int match_proc(struct proc_match_t*);
Expand Down Expand Up @@ -2864,6 +2864,9 @@ extern ostream& operator << (ostream&, NetNet::Type);

/*
* $Log: netlist.h,v $
* Revision 1.229 2002/01/19 19:02:08 steve
* Pass back target errors processing conditionals.
*
* Revision 1.228 2001/12/31 00:08:14 steve
* Support $signed cast of expressions.
*
Expand Down
20 changes: 16 additions & 4 deletions t-dll-proc.cc
Expand Up @@ -18,7 +18,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: t-dll-proc.cc,v 1.40 2001/11/14 03:28:49 steve Exp $"
#ident "$Id: t-dll-proc.cc,v 1.41 2002/01/19 19:02:08 steve Exp $"
#endif

# include "config.h"
Expand Down Expand Up @@ -421,7 +421,7 @@ bool dll_target::proc_cassign(const NetCAssign*net)
return true;
}

void dll_target::proc_condit(const NetCondit*net)
bool dll_target::proc_condit(const NetCondit*net)
{
assert(stmt_cur_);
assert(stmt_cur_->type_ == IVL_ST_NONE);
Expand All @@ -438,12 +438,13 @@ void dll_target::proc_condit(const NetCondit*net)
ivl_statement_t save_cur_ = stmt_cur_;

stmt_cur_ = save_cur_->u_.condit_.stmt_+0;
net->emit_recurse_if(this);
bool flag = net->emit_recurse_if(this);

stmt_cur_ = save_cur_->u_.condit_.stmt_+1;
net->emit_recurse_else(this);
flag = flag && net->emit_recurse_else(this);

stmt_cur_ = save_cur_;
return flag;
}

bool dll_target::proc_deassign(const NetDeassign*net)
Expand Down Expand Up @@ -531,8 +532,16 @@ bool dll_target::proc_force(const NetForce*net)
calloc(1, sizeof(struct ivl_lval_s));

const NetNet*lsig = net->lval();
assert(lsig);
ivl_signal_t sig = find_signal(des_, lsig);
assert(sig);
if (sig->type_ != IVL_SIT_REG) {
cerr << net->get_line() << ": internal error: Sorry, "
<< "force to nets not supported by this target."
<< endl;
return false;
}

assert(sig->type_ == IVL_SIT_REG);

stmt_cur_->u_.cassign_.lval[0].width_ = lsig->pin_count();
Expand Down Expand Up @@ -784,6 +793,9 @@ void dll_target::proc_while(const NetWhile*net)

/*
* $Log: t-dll-proc.cc,v $
* Revision 1.41 2002/01/19 19:02:08 steve
* Pass back target errors processing conditionals.
*
* Revision 1.40 2001/11/14 03:28:49 steve
* DLL target support for force and release.
*
Expand Down
14 changes: 10 additions & 4 deletions t-dll.cc
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-dll.cc,v 1.77 2002/01/12 04:03:09 steve Exp $"
#ident "$Id: t-dll.cc,v 1.78 2002/01/19 19:02:08 steve Exp $"
#endif

# include "config.h"
Expand Down Expand Up @@ -163,10 +163,13 @@ static ivl_scope_t find_scope_from_root(ivl_scope_t root, const NetScope*cur)

ivl_scope_t dll_target::find_scope(ivl_design_s &des, const NetScope*cur)
{
unsigned i;
ivl_scope_t scope = NULL;
for (i = 0; i < des.nroots_ && scope == NULL; i++)
assert(cur);

ivl_scope_t scope = 0;
for (unsigned i = 0; i < des.nroots_ && scope == 0; i += 1) {
assert(des.roots_[i]);
scope = find_scope_from_root(des.roots_[i], cur);
}
return scope;
}

Expand Down Expand Up @@ -1873,6 +1876,9 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj };

/*
* $Log: t-dll.cc,v $
* Revision 1.78 2002/01/19 19:02:08 steve
* Pass back target errors processing conditionals.
*
* Revision 1.77 2002/01/12 04:03:09 steve
* Make BUFZ device strengths available.
*
Expand Down
7 changes: 5 additions & 2 deletions t-dll.h
Expand Up @@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: t-dll.h,v 1.73 2002/01/03 04:19:01 steve Exp $"
#ident "$Id: t-dll.h,v 1.74 2002/01/19 19:02:08 steve Exp $"
#endif

# include "target.h"
Expand Down Expand Up @@ -108,7 +108,7 @@ struct dll_target : public target_t, public expr_scan_t {
bool proc_block(const NetBlock*);
void proc_case(const NetCase*);
bool proc_cassign(const NetCAssign*);
void proc_condit(const NetCondit*);
bool proc_condit(const NetCondit*);
bool proc_deassign(const NetDeassign*);
bool proc_delay(const NetPDelay*);
bool proc_disable(const NetDisable*);
Expand Down Expand Up @@ -590,6 +590,9 @@ struct ivl_statement_s {

/*
* $Log: t-dll.h,v $
* Revision 1.74 2002/01/19 19:02:08 steve
* Pass back target errors processing conditionals.
*
* Revision 1.73 2002/01/03 04:19:01 steve
* Add structural modulus support down to vvp.
*
Expand Down
12 changes: 8 additions & 4 deletions t-vvm.cc
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.213 2001/10/14 03:50:53 steve Exp $"
#ident "$Id: t-vvm.cc,v 1.214 2002/01/19 19:02:08 steve Exp $"
#endif

# include "config.h"
Expand Down Expand Up @@ -190,7 +190,7 @@ class target_vvm : public target_t {
virtual void proc_case(const NetCase*net);
void proc_case_fun(ostream&os, const NetCase*net);
virtual bool proc_cassign(const NetCAssign*);
virtual void proc_condit(const NetCondit*);
virtual bool proc_condit(const NetCondit*);
void proc_condit_fun(ostream&os, const NetCondit*);
virtual bool proc_deassign(const NetDeassign*);
virtual bool proc_delay(const NetPDelay*);
Expand Down Expand Up @@ -3195,11 +3195,11 @@ bool target_vvm::proc_cassign(const NetCAssign*dev)
return true;
}

void target_vvm::proc_condit(const NetCondit*net)
bool target_vvm::proc_condit(const NetCondit*net)
{
if (function_def_flag_) {
proc_condit_fun(out, net);
return;
return true;
}

string expr = emit_proc_rval(this, net->expr());
Expand Down Expand Up @@ -3250,6 +3250,7 @@ void target_vvm::proc_condit(const NetCondit*net)

defn << "static bool " << thread_class_ << "_step_" << out_step <<
"_(vvm_thread*thr) {" << endl;
return true;
}

void target_vvm::proc_condit_fun(ostream&os, const NetCondit*net)
Expand Down Expand Up @@ -3658,6 +3659,9 @@ extern const struct target tgt_vvm = {
};
/*
* $Log: t-vvm.cc,v $
* Revision 1.214 2002/01/19 19:02:08 steve
* Pass back target errors processing conditionals.
*
* Revision 1.213 2001/10/14 03:50:53 steve
* vvm support for pullup/down gates (PR#288)
*
Expand Down
8 changes: 6 additions & 2 deletions target.cc
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: target.cc,v 1.57 2001/08/25 23:50:03 steve Exp $"
#ident "$Id: target.cc,v 1.58 2002/01/19 19:02:08 steve Exp $"
#endif

# include "config.h"
Expand Down Expand Up @@ -216,11 +216,12 @@ bool target_t::proc_cassign(const NetCAssign*dev)
return false;
}

void target_t::proc_condit(const NetCondit*condit)
bool target_t::proc_condit(const NetCondit*condit)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled conditional:" << endl;
condit->dump(cerr, 6);
return false;
}

bool target_t::proc_deassign(const NetDeassign*dev)
Expand Down Expand Up @@ -383,6 +384,9 @@ void expr_scan_t::expr_binary(const NetEBinary*ex)

/*
* $Log: target.cc,v $
* Revision 1.58 2002/01/19 19:02:08 steve
* Pass back target errors processing conditionals.
*
* Revision 1.57 2001/08/25 23:50:03 steve
* Change the NetAssign_ class to refer to the signal
* instead of link into the netlist. This is faster
Expand Down
7 changes: 5 additions & 2 deletions target.h
Expand Up @@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: target.h,v 1.54 2001/08/25 23:50:03 steve Exp $"
#ident "$Id: target.h,v 1.55 2002/01/19 19:02:08 steve Exp $"
#endif

# include "netlist.h"
Expand Down Expand Up @@ -105,7 +105,7 @@ struct target_t {
virtual bool proc_block(const NetBlock*);
virtual void proc_case(const NetCase*);
virtual bool proc_cassign(const NetCAssign*);
virtual void proc_condit(const NetCondit*);
virtual bool proc_condit(const NetCondit*);
virtual bool proc_deassign(const NetDeassign*);
virtual bool proc_delay(const NetPDelay*);
virtual bool proc_disable(const NetDisable*);
Expand Down Expand Up @@ -162,6 +162,9 @@ extern const struct target *target_table[];

/*
* $Log: target.h,v $
* Revision 1.55 2002/01/19 19:02:08 steve
* Pass back target errors processing conditionals.
*
* Revision 1.54 2001/08/25 23:50:03 steve
* Change the NetAssign_ class to refer to the signal
* instead of link into the netlist. This is faster
Expand Down

0 comments on commit 608555c

Please sign in to comment.