Skip to content

Commit

Permalink
Generate fake adder code in vvm.
Browse files Browse the repository at this point in the history
  • Loading branch information
steve committed Sep 4, 1999
1 parent 41a1c6b commit 555d447
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
10 changes: 9 additions & 1 deletion netlist.cc
Expand Up @@ -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.56 1999/09/03 04:28:38 steve Exp $" #ident "$Id: netlist.cc,v 1.57 1999/09/04 01:57:15 steve Exp $"
#endif #endif


# include <cassert> # include <cassert>
Expand Down Expand Up @@ -329,6 +329,11 @@ NetAddSub::~NetAddSub()
{ {
} }


unsigned NetAddSub::width()const
{
return (pin_count() - 6) / 3;
}

NetObj::Link& NetAddSub::pin_DataA(unsigned idx) NetObj::Link& NetAddSub::pin_DataA(unsigned idx)
{ {
idx = 6 + idx*3; idx = 6 + idx*3;
Expand Down Expand Up @@ -1749,6 +1754,9 @@ NetNet* Design::find_signal(bool (*func)(const NetNet*))


/* /*
* $Log: netlist.cc,v $ * $Log: netlist.cc,v $
* Revision 1.57 1999/09/04 01:57:15 steve
* Generate fake adder code in vvm.
*
* Revision 1.56 1999/09/03 04:28:38 steve * Revision 1.56 1999/09/03 04:28:38 steve
* elaborate the binary plus operator. * elaborate the binary plus operator.
* *
Expand Down
15 changes: 14 additions & 1 deletion t-vvm.cc
Expand Up @@ -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.37 1999/09/01 20:46:19 steve Exp $" #ident "$Id: t-vvm.cc,v 1.38 1999/09/04 01:57:15 steve Exp $"
#endif #endif


# include <iostream> # include <iostream>
Expand All @@ -44,6 +44,9 @@ class target_vvm : public target_t {
virtual void memory(ostream&os, const NetMemory*); virtual void memory(ostream&os, const NetMemory*);
virtual void task_def(ostream&os, const NetTaskDef*); virtual void task_def(ostream&os, const NetTaskDef*);
virtual void func_def(ostream&os, const NetFuncDef*); virtual void func_def(ostream&os, const NetFuncDef*);

virtual void lpm_add_sub(ostream&os, const NetAddSub*);

virtual void logic(ostream&os, const NetLogic*); virtual void logic(ostream&os, const NetLogic*);
virtual void bufz(ostream&os, const NetBUFZ*); virtual void bufz(ostream&os, const NetBUFZ*);
virtual void udp(ostream&os, const NetUDP*); virtual void udp(ostream&os, const NetUDP*);
Expand Down Expand Up @@ -607,6 +610,13 @@ void target_vvm::emit_gate_outputfun_(const NetNode*gate)
delayed << "}" << endl; delayed << "}" << endl;
} }


void target_vvm::lpm_add_sub(ostream&os, const NetAddSub*gate)
{
os << "#error \"adders not yet supported in vvm.\"" << endl;
os << "static vvm_add_sub<" << gate->width() << "> " <<
mangle(gate->name()) << ";" << endl;
}

void target_vvm::logic(ostream&os, const NetLogic*gate) void target_vvm::logic(ostream&os, const NetLogic*gate)
{ {
os << "static void " << mangle(gate->name()) << os << "static void " << mangle(gate->name()) <<
Expand Down Expand Up @@ -1401,6 +1411,9 @@ extern const struct target tgt_vvm = {
}; };
/* /*
* $Log: t-vvm.cc,v $ * $Log: t-vvm.cc,v $
* Revision 1.38 1999/09/04 01:57:15 steve
* Generate fake adder code in vvm.
*
* Revision 1.37 1999/09/01 20:46:19 steve * Revision 1.37 1999/09/01 20:46:19 steve
* Handle recursive functions and arbitrary function * Handle recursive functions and arbitrary function
* references to other functions, properly pass * references to other functions, properly pass
Expand Down

0 comments on commit 555d447

Please sign in to comment.