Update case comparison (Eric Aardoom).

This commit is contained in:
steve 1999-12-02 16:58:58 +00:00
parent 88193a369f
commit 22d89c5984
3 changed files with 25 additions and 13 deletions

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) #if !defined(WINNT)
#ident "$Id: netlist.cc,v 1.96 1999/11/28 23:42:02 steve Exp $" #ident "$Id: netlist.cc,v 1.97 1999/12/02 16:58:58 steve Exp $"
#endif #endif
# include <cassert> # include <cassert>
@ -1344,9 +1344,9 @@ void NetCase::set_case(unsigned idx, NetExpr*e, NetProc*p)
NetCaseCmp::NetCaseCmp(const string&n) NetCaseCmp::NetCaseCmp(const string&n)
: NetNode(n, 3) : NetNode(n, 3)
{ {
pin(0).set_dir(Link::OUTPUT); pin(0).set_dir(Link::OUTPUT); pin(0).set_name("O",0);
pin(1).set_dir(Link::INPUT); pin(1).set_dir(Link::INPUT); pin(1).set_name("I",0);
pin(2).set_dir(Link::INPUT); pin(2).set_dir(Link::INPUT); pin(2).set_name("I",1);
} }
NetCaseCmp::~NetCaseCmp() NetCaseCmp::~NetCaseCmp()
@ -2641,6 +2641,9 @@ NetNet* Design::find_signal(bool (*func)(const NetNet*))
/* /*
* $Log: netlist.cc,v $ * $Log: netlist.cc,v $
* Revision 1.97 1999/12/02 16:58:58 steve
* Update case comparison (Eric Aardoom).
*
* Revision 1.96 1999/11/28 23:42:02 steve * Revision 1.96 1999/11/28 23:42:02 steve
* NetESignal object no longer need to be NetNode * NetESignal object no longer need to be NetNode
* objects. Let them keep a pointer to NetNet objects. * objects. Let them keep a pointer to NetNet objects.

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) #if !defined(WINNT)
#ident "$Id: t-vvm.cc,v 1.86 1999/11/29 00:38:27 steve Exp $" #ident "$Id: t-vvm.cc,v 1.87 1999/12/02 16:58:58 steve Exp $"
#endif #endif
# include <iostream> # include <iostream>
@ -1257,13 +1257,16 @@ void target_vvm::net_assign_nb(ostream&os, const NetAssignNB*net)
void target_vvm::net_case_cmp(ostream&os, const NetCaseCmp*gate) void target_vvm::net_case_cmp(ostream&os, const NetCaseCmp*gate)
{ {
const NetObj::Link&lnk = gate->pin(0);
os << "static void " << mangle(gate->name()) << os << "static void " << mangle(gate->name()) <<
"_output_fun(vvm_simulation*, vpip_bit_t);" << endl; "_output_" << lnk.get_name() << "_" << lnk.get_inst() <<
"(vvm_simulation*, vpip_bit_t);" << endl;
assert(gate->pin_count() == 3); assert(gate->pin_count() == 3);
os << "static vvm_eeq" << "<" << gate->rise_time() << "> " os << "static vvm_eeq" << "<" << gate->rise_time() << "> "
<< mangle(gate->name()) << "(&" << mangle(gate->name()) << << mangle(gate->name()) << "(&" << mangle(gate->name()) <<
"_output_fun);" << endl; "_output_" << lnk.get_name() << "_" << lnk.get_inst() << ");" << endl;
emit_gate_outputfun_(gate, 0); emit_gate_outputfun_(gate, 0);
@ -1955,6 +1958,9 @@ extern const struct target tgt_vvm = {
}; };
/* /*
* $Log: t-vvm.cc,v $ * $Log: t-vvm.cc,v $
* Revision 1.87 1999/12/02 16:58:58 steve
* Update case comparison (Eric Aardoom).
*
* Revision 1.86 1999/11/29 00:38:27 steve * Revision 1.86 1999/11/29 00:38:27 steve
* Properly initialize registers. * Properly initialize registers.
* *

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) #if !defined(WINNT)
#ident "$Id: vvm_gates.h,v 1.29 1999/12/02 04:54:11 steve Exp $" #ident "$Id: vvm_gates.h,v 1.30 1999/12/02 16:58:58 steve Exp $"
#endif #endif
# include "vvm.h" # include "vvm.h"
@ -716,8 +716,8 @@ template <unsigned long DELAY> class vvm_eeq {
explicit vvm_eeq(vvm_out_event::action_t o) explicit vvm_eeq(vvm_out_event::action_t o)
: output_(o) { } : output_(o) { }
void init(unsigned idx, vpip_bit_t val) void init_I(unsigned idx, vpip_bit_t val)
{ input_[idx-1] = val; } { input_[idx] = val; }
void start(vvm_simulation*sim) void start(vvm_simulation*sim)
{ vvm_event*ev = new vvm_out_event(sim, compute_(), output_); { vvm_event*ev = new vvm_out_event(sim, compute_(), output_);
@ -727,10 +727,10 @@ template <unsigned long DELAY> class vvm_eeq {
sim->active_event(ev); sim->active_event(ev);
} }
void set(vvm_simulation*sim, unsigned idx, vpip_bit_t val) void set_I(vvm_simulation*sim, unsigned idx, vpip_bit_t val)
{ if (input_[idx-1] == val) { if (input_[idx] == val)
return; return;
input_[idx-1] = val; input_[idx] = val;
start(sim); start(sim);
} }
@ -897,6 +897,9 @@ template <unsigned WIDTH> class vvm_pevent {
/* /*
* $Log: vvm_gates.h,v $ * $Log: vvm_gates.h,v $
* Revision 1.30 1999/12/02 16:58:58 steve
* Update case comparison (Eric Aardoom).
*
* Revision 1.29 1999/12/02 04:54:11 steve * Revision 1.29 1999/12/02 04:54:11 steve
* Handle mux sel of X, if inputs are equal. * Handle mux sel of X, if inputs are equal.
* *