diff --git a/ivl_target.h b/ivl_target.h index ebd0098df..140372a3e 100644 --- a/ivl_target.h +++ b/ivl_target.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: ivl_target.h,v 1.87 2001/11/01 04:25:31 steve Exp $" +#ident "$Id: ivl_target.h,v 1.88 2001/11/14 03:28:49 steve Exp $" #endif #ifdef __cplusplus @@ -927,15 +927,17 @@ extern ivl_expr_t ivl_stmt_delay_expr(ivl_statement_t net); extern unsigned long ivl_stmt_delay_val(ivl_statement_t net); /* IVL_ST_WAIT */ extern ivl_event_t ivl_stmt_event(ivl_statement_t net); - /* IVL_ST_ASSIGN IVL_ST_ASSIGN_NB IVL_ST_CASSIGN IVL_ST_DEASSIGN */ + /* IVL_ST_ASSIGN IVL_ST_ASSIGN_NB IVL_ST_CASSIGN IVL_ST_DEASSIGN + IVL_ST_FORCE IVL_ST_RELEASE */ extern ivl_lval_t ivl_stmt_lval(ivl_statement_t net, unsigned idx); - /* IVL_ST_ASSIGN IVL_ST_ASSIGN_NB IVL_ST_CASSIGN IVL_ST_DEASSIGN */ + /* IVL_ST_ASSIGN IVL_ST_ASSIGN_NB IVL_ST_CASSIGN IVL_ST_DEASSIGN + IVL_ST_FORCE IVL_ST_RELEASE */ extern unsigned ivl_stmt_lvals(ivl_statement_t net); /* IVL_ST_ASSIGN IVL_ST_ASSIGN_NB */ extern unsigned ivl_stmt_lwidth(ivl_statement_t net); /* IVL_ST_STASK */ extern const char* ivl_stmt_name(ivl_statement_t net); - /* IVL_ST_CASSIGN */ + /* IVL_ST_CASSIGN IVL_ST_FORCE */ extern ivl_nexus_t ivl_stmt_nexus(ivl_statement_t net, unsigned idx); extern unsigned ivl_stmt_nexus_count(ivl_statement_t net); /* IVL_ST_STASK */ @@ -974,6 +976,9 @@ _END_DECL /* * $Log: ivl_target.h,v $ + * Revision 1.88 2001/11/14 03:28:49 steve + * DLL target support for force and release. + * * Revision 1.87 2001/11/01 04:25:31 steve * ivl_target support for cassign. * diff --git a/net_force.cc b/net_force.cc index d4252a5bd..d80acce1f 100644 --- a/net_force.cc +++ b/net_force.cc @@ -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.5 2001/10/31 05:24:52 steve Exp $" +#ident "$Id: net_force.cc,v 1.6 2001/11/14 03:28:49 steve Exp $" #endif # include "config.h" @@ -105,6 +105,11 @@ const Link& NetForce::lval_pin(unsigned idx) const return lval_->pin(idx); } +const NetNet* NetForce::lval() const +{ + return lval_; +} + NetRelease::NetRelease(NetNet*l) : lval_(l) { @@ -122,6 +127,9 @@ const NetNet*NetRelease::lval() const /* * $Log: net_force.cc,v $ + * Revision 1.6 2001/11/14 03:28:49 steve + * DLL target support for force and release. + * * Revision 1.5 2001/10/31 05:24:52 steve * ivl_target support for assign/deassign. * diff --git a/netlist.h b/netlist.h index 6f38c03a1..d9408cf41 100644 --- a/netlist.h +++ b/netlist.h @@ -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.223 2001/11/09 03:43:26 steve Exp $" +#ident "$Id: netlist.h,v 1.224 2001/11/14 03:28:49 steve Exp $" #endif /* @@ -1698,6 +1698,8 @@ class NetForce : public NetProc, public NetNode { const Link& lval_pin(unsigned) const; + const NetNet*lval() const; + virtual void dump(ostream&, unsigned ind) const; virtual bool emit_proc(struct target_t*) const; virtual void dump_node(ostream&, unsigned ind) const; @@ -2859,6 +2861,9 @@ extern ostream& operator << (ostream&, NetNet::Type); /* * $Log: netlist.h,v $ + * Revision 1.224 2001/11/14 03:28:49 steve + * DLL target support for force and release. + * * Revision 1.223 2001/11/09 03:43:26 steve * Spelling errors. * diff --git a/t-dll-api.cc b/t-dll-api.cc index 64e4fbeaf..ac1f0c7b7 100644 --- a/t-dll-api.cc +++ b/t-dll-api.cc @@ -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-api.cc,v 1.71 2001/11/01 04:25:31 steve Exp $" +#ident "$Id: t-dll-api.cc,v 1.72 2001/11/14 03:28:49 steve Exp $" #endif # include "config.h" @@ -1285,6 +1285,8 @@ extern "C" ivl_lval_t ivl_stmt_lval(ivl_statement_t net, unsigned idx) case IVL_ST_CASSIGN: case IVL_ST_DEASSIGN: + case IVL_ST_FORCE: + case IVL_ST_RELEASE: assert(idx < net->u_.cassign_.lvals); return net->u_.cassign_.lval + idx; @@ -1303,6 +1305,8 @@ extern "C" unsigned ivl_stmt_lvals(ivl_statement_t net) case IVL_ST_CASSIGN: case IVL_ST_DEASSIGN: + case IVL_ST_FORCE: + case IVL_ST_RELEASE: return net->u_.cassign_.lvals; default: @@ -1353,6 +1357,7 @@ extern "C" ivl_nexus_t ivl_stmt_nexus(ivl_statement_t net, unsigned idx) { switch (net->type_) { case IVL_ST_CASSIGN: + case IVL_ST_FORCE: assert(idx < net->u_.cassign_.npins); return net->u_.cassign_.pins[idx]; default: @@ -1366,6 +1371,7 @@ extern "C" unsigned ivl_stmt_nexus_count(ivl_statement_t net) { switch (net->type_) { case IVL_ST_CASSIGN: + case IVL_ST_FORCE: return net->u_.cassign_.npins; default: assert(0); @@ -1434,6 +1440,9 @@ extern "C" ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net) /* * $Log: t-dll-api.cc,v $ + * Revision 1.72 2001/11/14 03:28:49 steve + * DLL target support for force and release. + * * Revision 1.71 2001/11/01 04:25:31 steve * ivl_target support for cassign. * diff --git a/t-dll-proc.cc b/t-dll-proc.cc index b6d57c1d6..97b44adaa 100644 --- a/t-dll-proc.cc +++ b/t-dll-proc.cc @@ -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.39 2001/11/01 04:25:31 steve Exp $" +#ident "$Id: t-dll-proc.cc,v 1.40 2001/11/14 03:28:49 steve Exp $" #endif # include "config.h" @@ -519,6 +519,40 @@ bool dll_target::proc_disable(const NetDisable*net) return true; } +bool dll_target::proc_force(const NetForce*net) +{ + assert(stmt_cur_); + assert(stmt_cur_->type_ == IVL_ST_NONE); + + stmt_cur_->type_ = IVL_ST_FORCE; + + stmt_cur_->u_.cassign_.lvals = 1; + stmt_cur_->u_.cassign_.lval = (struct ivl_lval_s*) + calloc(1, sizeof(struct ivl_lval_s)); + + const NetNet*lsig = net->lval(); + ivl_signal_t sig = find_signal(des_, lsig); + assert(sig); + assert(sig->type_ == IVL_SIT_REG); + + stmt_cur_->u_.cassign_.lval[0].width_ = lsig->pin_count(); + stmt_cur_->u_.cassign_.lval[0].loff_ = 0; + stmt_cur_->u_.cassign_.lval[0].type_ = IVL_LVAL_REG; + stmt_cur_->u_.cassign_.lval[0].idx = 0; + stmt_cur_->u_.cassign_.lval[0].n.sig = sig; + + stmt_cur_->u_.cassign_.npins = net->pin_count(); + stmt_cur_->u_.cassign_.pins = (ivl_nexus_t*) + calloc(stmt_cur_->u_.cassign_.npins, sizeof(ivl_nexus_t)); + + ivl_nexus_t*ntmp = stmt_cur_->u_.cassign_.pins; + for (unsigned idx = 0 ; idx < net->pin_count() ; idx += 1) { + ntmp[idx] = (ivl_nexus_t)net->pin(idx).nexus()->t_cookie(); + assert(ntmp[idx]); + } + + return true; +} void dll_target::proc_forever(const NetForever*net) { @@ -539,6 +573,31 @@ void dll_target::proc_forever(const NetForever*net) stmt_cur_ = save_cur_; } +bool dll_target::proc_release(const NetRelease*net) +{ + assert(stmt_cur_); + assert(stmt_cur_->type_ == IVL_ST_NONE); + + stmt_cur_->type_ = IVL_ST_RELEASE; + + stmt_cur_->u_.cassign_.lvals = 1; + stmt_cur_->u_.cassign_.lval = (struct ivl_lval_s*) + calloc(1, sizeof(struct ivl_lval_s)); + + const NetNet*lsig = net->lval(); + ivl_signal_t sig = find_signal(des_, lsig); + assert(sig); + assert(sig->type_ == IVL_SIT_REG); + + stmt_cur_->u_.cassign_.lval[0].width_ = lsig->pin_count(); + stmt_cur_->u_.cassign_.lval[0].loff_ = 0; + stmt_cur_->u_.cassign_.lval[0].type_ = IVL_LVAL_REG; + stmt_cur_->u_.cassign_.lval[0].idx = 0; + stmt_cur_->u_.cassign_.lval[0].n.sig = sig; + + return true; +} + void dll_target::proc_repeat(const NetRepeat*net) { assert(stmt_cur_); @@ -725,6 +784,9 @@ void dll_target::proc_while(const NetWhile*net) /* * $Log: t-dll-proc.cc,v $ + * Revision 1.40 2001/11/14 03:28:49 steve + * DLL target support for force and release. + * * Revision 1.39 2001/11/01 04:25:31 steve * ivl_target support for cassign. * diff --git a/t-dll.cc b/t-dll.cc index ca2f85173..406076119 100644 --- a/t-dll.cc +++ b/t-dll.cc @@ -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.69 2001/10/30 02:52:07 steve Exp $" +#ident "$Id: t-dll.cc,v 1.70 2001/11/14 03:28:49 steve Exp $" #endif # include "config.h" @@ -655,6 +655,11 @@ bool dll_target::net_cassign(const NetCAssign*) return false; } +bool dll_target::net_force(const NetForce*net) +{ + return true; +} + void dll_target::udp(const NetUDP*net) { struct ivl_net_logic_s *obj = new struct ivl_net_logic_s; @@ -1661,6 +1666,9 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj }; /* * $Log: t-dll.cc,v $ + * Revision 1.70 2001/11/14 03:28:49 steve + * DLL target support for force and release. + * * Revision 1.69 2001/10/30 02:52:07 steve * Stubs for assign/deassign for t-dll. * diff --git a/t-dll.h b/t-dll.h index bfd973915..9d071c4a8 100644 --- a/t-dll.h +++ b/t-dll.h @@ -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.70 2001/11/04 05:03:21 steve Exp $" +#ident "$Id: t-dll.h,v 1.71 2001/11/14 03:28:49 steve Exp $" #endif # include "target.h" @@ -80,6 +80,7 @@ struct dll_target : public target_t, public expr_scan_t { void lpm_ram_dq(const NetRamDq*); void net_assign(const NetAssign_*); bool net_cassign(const NetCAssign*); + bool net_force(const NetForce*); bool net_const(const NetConst*); void net_probe(const NetEvProbe*); @@ -110,7 +111,9 @@ struct dll_target : public target_t, public expr_scan_t { bool proc_deassign(const NetDeassign*); bool proc_delay(const NetPDelay*); bool proc_disable(const NetDisable*); + bool proc_force(const NetForce*); void proc_forever(const NetForever*); + bool proc_release(const NetRelease*); void proc_repeat(const NetRepeat*); void proc_stask(const NetSTask*); bool proc_trigger(const NetEvTrig*); @@ -584,6 +587,9 @@ struct ivl_statement_s { /* * $Log: t-dll.h,v $ + * Revision 1.71 2001/11/14 03:28:49 steve + * DLL target support for force and release. + * * Revision 1.70 2001/11/04 05:03:21 steve * MacOSX 10.1 updates. * diff --git a/tgt-vvp/vvp_process.c b/tgt-vvp/vvp_process.c index f236a9f04..d11790789 100644 --- a/tgt-vvp/vvp_process.c +++ b/tgt-vvp/vvp_process.c @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: vvp_process.c,v 1.48 2001/11/01 19:31:40 steve Exp $" +#ident "$Id: vvp_process.c,v 1.49 2001/11/14 03:28:49 steve Exp $" #endif # include "vvp_priv.h" @@ -585,6 +585,12 @@ static int show_stmt_disable(ivl_statement_t net, ivl_scope_t sscope) return rc; } +static int show_stmt_force(ivl_statement_t net) +{ + fprintf(vvp_out, " %%force ????;\n"); + return 0; +} + static int show_stmt_forever(ivl_statement_t net, ivl_scope_t sscope) { int rc = 0; @@ -646,6 +652,12 @@ static int show_stmt_noop(ivl_statement_t net) return 0; } +static int show_stmt_release(ivl_statement_t net) +{ + fprintf(vvp_out, " %%release ????;\n"); + return 0; +} + static int show_stmt_repeat(ivl_statement_t net, ivl_scope_t sscope) { int rc = 0; @@ -909,6 +921,10 @@ static int show_statement(ivl_statement_t net, ivl_scope_t sscope) rc += show_stmt_disable(net, sscope); break; + case IVL_ST_FORCE: + rc += show_stmt_force(net); + break; + case IVL_ST_FOREVER: rc += show_stmt_forever(net, sscope); break; @@ -921,6 +937,10 @@ static int show_statement(ivl_statement_t net, ivl_scope_t sscope) rc += show_stmt_noop(net); break; + case IVL_ST_RELEASE: + rc += show_stmt_release(net); + break; + case IVL_ST_REPEAT: rc += show_stmt_repeat(net, sscope); break; @@ -1037,6 +1057,9 @@ int draw_func_definition(ivl_scope_t scope) /* * $Log: vvp_process.c,v $ + * Revision 1.49 2001/11/14 03:28:49 steve + * DLL target support for force and release. + * * Revision 1.48 2001/11/01 19:31:40 steve * make fork label into complete statemnt. *