1998-11-04 00:28:49 +01:00
|
|
|
/*
|
1999-07-18 00:01:13 +02:00
|
|
|
* Copyright (c) 1999 Stephen Williams (steve@icarus.com)
|
1998-11-04 00:28:49 +01:00
|
|
|
*
|
|
|
|
|
* This source code is free software; you can redistribute it
|
|
|
|
|
* and/or modify it in source code form under the terms of the GNU
|
|
|
|
|
* General Public License as published by the Free Software
|
|
|
|
|
* Foundation; either version 2 of the License, or (at your option)
|
|
|
|
|
* any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
|
|
|
|
*/
|
|
|
|
|
#if !defined(WINNT)
|
1999-12-17 07:18:15 +01:00
|
|
|
#ident "$Id: functor.cc,v 1.7 1999/12/17 06:18:16 steve Exp $"
|
1998-11-04 00:28:49 +01:00
|
|
|
#endif
|
|
|
|
|
|
1999-07-18 00:01:13 +02:00
|
|
|
# include "functor.h"
|
1998-11-04 00:28:49 +01:00
|
|
|
# include "netlist.h"
|
|
|
|
|
|
1999-07-18 00:01:13 +02:00
|
|
|
functor_t::~functor_t()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void functor_t::signal(class Design*, class NetNet*)
|
|
|
|
|
{
|
|
|
|
|
}
|
1998-11-04 00:28:49 +01:00
|
|
|
|
1999-07-18 00:01:13 +02:00
|
|
|
void functor_t::process(class Design*, class NetProcTop*)
|
1998-11-04 00:28:49 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
1999-12-17 07:18:15 +01:00
|
|
|
void functor_t::lpm_const(class Design*, class NetConst*)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
1999-11-01 03:07:40 +01:00
|
|
|
void functor_t::lpm_ff(class Design*, class NetFF*)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
1999-12-17 07:18:15 +01:00
|
|
|
void functor_t::lpm_logic(class Design*, class NetLogic*)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
1999-07-18 00:01:13 +02:00
|
|
|
void Design::functor(functor_t*fun)
|
|
|
|
|
{
|
|
|
|
|
// apply to signals
|
|
|
|
|
if (signals_) {
|
|
|
|
|
NetNet*cur = signals_->sig_next_;
|
|
|
|
|
do {
|
1999-11-18 04:52:19 +01:00
|
|
|
NetNet*tmp = cur->sig_next_;
|
1999-07-18 00:01:13 +02:00
|
|
|
fun->signal(this, cur);
|
1999-11-18 04:52:19 +01:00
|
|
|
cur = tmp;
|
1999-07-18 00:01:13 +02:00
|
|
|
} while (cur != signals_->sig_next_);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// apply to processes
|
1999-07-18 07:52:46 +02:00
|
|
|
procs_idx_ = procs_;
|
|
|
|
|
while (procs_idx_) {
|
|
|
|
|
NetProcTop*idx = procs_idx_;
|
|
|
|
|
procs_idx_ = idx->next_;
|
1999-07-18 00:01:13 +02:00
|
|
|
fun->process(this, idx);
|
1999-07-18 07:52:46 +02:00
|
|
|
}
|
1999-11-01 03:07:40 +01:00
|
|
|
|
|
|
|
|
// apply to nodes
|
|
|
|
|
if (nodes_) {
|
|
|
|
|
NetNode*cur = nodes_->node_next_;
|
|
|
|
|
do {
|
|
|
|
|
NetNode*tmp = cur->node_next_;
|
|
|
|
|
cur->functor_node(this, fun);
|
|
|
|
|
cur = tmp;
|
|
|
|
|
} while (cur != nodes_->node_next_);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void NetNode::functor_node(Design*, functor_t*)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
1999-12-17 07:18:15 +01:00
|
|
|
void NetConst::functor_node(Design*des, functor_t*fun)
|
|
|
|
|
{
|
|
|
|
|
fun->lpm_const(des, this);
|
|
|
|
|
}
|
|
|
|
|
|
1999-11-01 03:07:40 +01:00
|
|
|
void NetFF::functor_node(Design*des, functor_t*fun)
|
|
|
|
|
{
|
|
|
|
|
fun->lpm_ff(des, this);
|
1999-07-18 00:01:13 +02:00
|
|
|
}
|
|
|
|
|
|
1999-12-17 07:18:15 +01:00
|
|
|
void NetLogic::functor_node(Design*des, functor_t*fun)
|
|
|
|
|
{
|
|
|
|
|
fun->lpm_logic(des, this);
|
|
|
|
|
}
|
|
|
|
|
|
1999-12-01 07:06:16 +01:00
|
|
|
proc_match_t::~proc_match_t()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int NetProc::match_proc(proc_match_t*that)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int proc_match_t::assign(NetAssign*)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int NetAssign::match_proc(proc_match_t*that)
|
|
|
|
|
{
|
|
|
|
|
return that->assign(this);
|
|
|
|
|
}
|
|
|
|
|
|
1999-12-05 03:24:08 +01:00
|
|
|
int proc_match_t::assign_mem(NetAssignMem*)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int NetAssignMem::match_proc(proc_match_t*that)
|
|
|
|
|
{
|
|
|
|
|
return that->assign_mem(this);
|
|
|
|
|
}
|
|
|
|
|
|
1999-12-01 07:06:16 +01:00
|
|
|
int proc_match_t::condit(NetCondit*)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int NetCondit::match_proc(proc_match_t*that)
|
|
|
|
|
{
|
|
|
|
|
return that->condit(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int proc_match_t::pevent(NetPEvent*)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int NetPEvent::match_proc(proc_match_t*that)
|
|
|
|
|
{
|
|
|
|
|
return that->pevent(this);
|
|
|
|
|
}
|
|
|
|
|
|
1998-11-04 00:28:49 +01:00
|
|
|
/*
|
1999-07-18 00:01:13 +02:00
|
|
|
* $Log: functor.cc,v $
|
1999-12-17 07:18:15 +01:00
|
|
|
* Revision 1.7 1999/12/17 06:18:16 steve
|
|
|
|
|
* Rewrite the cprop functor to use the functor_t interface.
|
|
|
|
|
*
|
1999-12-05 03:24:08 +01:00
|
|
|
* Revision 1.6 1999/12/05 02:24:08 steve
|
|
|
|
|
* Synthesize LPM_RAM_DQ for writes into memories.
|
|
|
|
|
*
|
1999-12-01 07:06:16 +01:00
|
|
|
* Revision 1.5 1999/12/01 06:06:16 steve
|
|
|
|
|
* Redo synth to use match_proc_t scanner.
|
|
|
|
|
*
|
1999-11-18 04:52:19 +01:00
|
|
|
* Revision 1.4 1999/11/18 03:52:19 steve
|
|
|
|
|
* Turn NetTmp objects into normal local NetNet objects,
|
|
|
|
|
* and add the nodangle functor to clean up the local
|
|
|
|
|
* symbols generated by elaboration and other steps.
|
|
|
|
|
*
|
1999-11-01 03:07:40 +01:00
|
|
|
* Revision 1.3 1999/11/01 02:07:40 steve
|
|
|
|
|
* Add the synth functor to do generic synthesis
|
|
|
|
|
* and add the LPM_FF device to handle rows of
|
|
|
|
|
* flip-flops.
|
|
|
|
|
*
|
1999-07-18 07:52:46 +02:00
|
|
|
* Revision 1.2 1999/07/18 05:52:46 steve
|
|
|
|
|
* xnfsyn generates DFF objects for XNF output, and
|
|
|
|
|
* properly rewrites the Design netlist in the process.
|
|
|
|
|
*
|
1999-07-18 00:01:13 +02:00
|
|
|
* Revision 1.1 1999/07/17 22:01:13 steve
|
|
|
|
|
* Add the functor interface for functor transforms.
|
1998-11-04 00:28:49 +01:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|