add th t-dll functions for net_const, net_bufz and processes.

This commit is contained in:
steve 2000-08-14 04:39:56 +00:00
parent 3ae4d2cf91
commit 9abd84952b
11 changed files with 258 additions and 74 deletions

69
emit.cc
View File

@ -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.50 2000/08/09 03:43:45 steve Exp $"
#ident "$Id: emit.cc,v 1.51 2000/08/14 04:39:56 steve Exp $"
#endif
/*
@ -29,99 +29,116 @@
# include <typeinfo>
# include <cassert>
void NetNode::emit_node(struct target_t*tgt) const
bool NetNode::emit_node(struct target_t*tgt) const
{
cerr << "EMIT: Gate type? " << typeid(*this).name() << endl;
return false;
}
void NetLogic::emit_node(struct target_t*tgt) const
bool NetLogic::emit_node(struct target_t*tgt) const
{
tgt->logic(this);
return true;
}
void NetUDP_COMB::emit_node(struct target_t*tgt) const
bool NetUDP_COMB::emit_node(struct target_t*tgt) const
{
tgt->udp_comb(this);
return true;
}
void NetUDP::emit_node(struct target_t*tgt) const
bool NetUDP::emit_node(struct target_t*tgt) const
{
tgt->udp(this);
return true;
}
void NetAddSub::emit_node(struct target_t*tgt) const
bool NetAddSub::emit_node(struct target_t*tgt) const
{
tgt->lpm_add_sub(this);
return true;
}
void NetAssign::emit_node(struct target_t*tgt) const
bool NetAssign::emit_node(struct target_t*tgt) const
{
tgt->net_assign(this);
return true;
}
void NetAssignNB::emit_node(struct target_t*tgt) const
bool NetAssignNB::emit_node(struct target_t*tgt) const
{
tgt->net_assign_nb(this);
return true;
}
void NetCaseCmp::emit_node(struct target_t*tgt) const
bool NetCaseCmp::emit_node(struct target_t*tgt) const
{
tgt->net_case_cmp(this);
return true;
}
void NetCAssign::emit_node(struct target_t*tgt) const
bool NetCAssign::emit_node(struct target_t*tgt) const
{
tgt->net_cassign(this);
return true;
}
void NetCLShift::emit_node(struct target_t*tgt) const
bool NetCLShift::emit_node(struct target_t*tgt) const
{
tgt->lpm_clshift(this);
return true;
}
void NetCompare::emit_node(struct target_t*tgt) const
bool NetCompare::emit_node(struct target_t*tgt) const
{
tgt->lpm_compare(this);
return true;
}
void NetConst::emit_node(struct target_t*tgt) const
bool NetConst::emit_node(struct target_t*tgt) const
{
tgt->net_const(this);
return tgt->net_const(this);
}
void NetDivide::emit_node(struct target_t*tgt) const
bool NetDivide::emit_node(struct target_t*tgt) const
{
tgt->lpm_divide(this);
return true;
}
void NetFF::emit_node(struct target_t*tgt) const
bool NetFF::emit_node(struct target_t*tgt) const
{
tgt->lpm_ff(this);
return true;
}
void NetForce::emit_node(struct target_t*tgt) const
bool NetForce::emit_node(struct target_t*tgt) const
{
tgt->net_force(this);
return true;
}
void NetMult::emit_node(struct target_t*tgt) const
bool NetMult::emit_node(struct target_t*tgt) const
{
tgt->lpm_mult(this);
return true;
}
void NetMux::emit_node(struct target_t*tgt) const
bool NetMux::emit_node(struct target_t*tgt) const
{
tgt->lpm_mux(this);
return true;
}
void NetRamDq::emit_node(struct target_t*tgt) const
bool NetRamDq::emit_node(struct target_t*tgt) const
{
tgt->lpm_ram_dq(this);
return true;
}
void NetBUFZ::emit_node(struct target_t*tgt) const
bool NetBUFZ::emit_node(struct target_t*tgt) const
{
tgt->bufz(this);
return tgt->bufz(this);
}
bool NetProcTop::emit(struct target_t*tgt) const
@ -266,9 +283,10 @@ void NetCondit::emit_recurse_else(struct target_t*tgt) const
else_->emit_proc(tgt);
}
void NetEvProbe::emit_node(struct target_t*tgt) const
bool NetEvProbe::emit_node(struct target_t*tgt) const
{
tgt->net_probe(this);
return true;
}
bool NetEvTrig::emit_proc(struct target_t*tgt) const
@ -366,7 +384,7 @@ bool Design::emit(struct target_t*tgt) const
if (nodes_) {
NetNode*cur = nodes_->node_next_;
do {
cur->emit_node(tgt);
rc = rc && cur->emit_node(tgt);
cur = cur->node_next_;
} while (cur != nodes_->node_next_);
}
@ -463,6 +481,9 @@ bool emit(const Design*des, const char*type)
/*
* $Log: emit.cc,v $
* Revision 1.51 2000/08/14 04:39:56 steve
* add th t-dll functions for net_const, net_bufz and processes.
*
* Revision 1.50 2000/08/09 03:43:45 steve
* Move all file manipulation out of target class.
*

View File

@ -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.1 2000/08/12 16:34:37 steve Exp $"
#ident "$Id: ivl_target.h,v 1.2 2000/08/14 04:39:56 steve Exp $"
#endif
#ifdef __cplusplus
@ -45,6 +45,9 @@ _BEGIN_DECL
requesting an operation that affects the entire netlist. */
typedef struct ivl_design_s *ivl_design_t;
typedef struct ivl_net_bufz_s *ivl_net_bufz_t;
typedef struct ivl_net_const_s*ivl_net_const_t;
typedef struct ivl_process_s *ivl_process_t;
/* This function returns the string value of the named flag. The key
is used to select the flag. If the key does not exist or the flag
@ -59,7 +62,7 @@ extern const char* ivl_get_flag(ivl_design_t, const char*key);
The "target_start_design" function is called once before
any other functions in order to start the processing of the
netlist. The function returns a value <0 if there is an error. */
typedef int (*start_design_f)(ivl_design_t);
typedef int (*start_design_f)(ivl_design_t des);
/* target_end_design (required)
@ -67,13 +70,42 @@ typedef int (*start_design_f)(ivl_design_t);
The target_end_design function in the loaded module is called once
to clean up (for example to close files) from handling of the
netlist. */
typedef void (*end_design_f)(ivl_design_t);
typedef void (*end_design_f)(ivl_design_t des);
/* target_net_bufz
The "target_net_bufz" function is called for all the BUFZ devices
in the netlist. */
typedef int (*net_bufz_f)(const char*name, ivl_net_bufz_t net);
/* target_net_const
The "target_net_const" function is called for structural constant
values that appear in the design. the DLL is expected to return 0
for success, or <0 for some sort of error. If this function is not
implemented by the DLL, ivl will generate an error when a constant
is detected in the design. */
typedef int (*net_const_f)(const char*name, ivl_net_const_t net);
/* target_process
The "target_process" function is called for each always and initial
block in the design. In principle, the target creates a thread for
each process in the Verilog original.
XXXX I have not yet decided if it it up to the target to scan the
process statements, or if I will do that myself. Hmm... */
typedef int (*process_f)(ivl_process_t net);
_END_DECL
/*
* $Log: ivl_target.h,v $
* Revision 1.2 2000/08/14 04:39:56 steve
* add th t-dll functions for net_const, net_bufz and processes.
*
* Revision 1.1 2000/08/12 16:34:37 steve
* Start stub for loadable targets.
*

View File

@ -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.155 2000/08/09 03:43:45 steve Exp $"
#ident "$Id: netlist.h,v 1.156 2000/08/14 04:39:57 steve Exp $"
#endif
/*
@ -263,7 +263,7 @@ class NetNode : public NetObj {
// connected to the same of my own pins.
NetNode*next_node();
virtual void emit_node(struct target_t*) const;
virtual bool emit_node(struct target_t*) const;
virtual void dump_node(ostream&, unsigned) const;
// This is used to scan a modifiable netlist, one node at a time.
@ -388,7 +388,7 @@ class NetAddSub : public NetNode {
const Link& pin_Result(unsigned idx) const;
virtual void dump_node(ostream&, unsigned ind) const;
virtual void emit_node(struct target_t*) const;
virtual bool emit_node(struct target_t*) const;
virtual void functor_node(Design*des, functor_t*fun);
};
@ -419,7 +419,7 @@ class NetCLShift : public NetNode {
const Link& pin_Distance(unsigned idx) const;
virtual void dump_node(ostream&, unsigned ind) const;
virtual void emit_node(struct target_t*) const;
virtual bool emit_node(struct target_t*) const;
private:
unsigned width_;
@ -467,7 +467,7 @@ class NetCompare : public NetNode {
virtual void functor_node(Design*, functor_t*);
virtual void dump_node(ostream&, unsigned ind) const;
virtual void emit_node(struct target_t*) const;
virtual bool emit_node(struct target_t*) const;
private:
unsigned width_;
@ -502,7 +502,7 @@ class NetDivide : public NetNode {
const Link& pin_Result(unsigned idx) const;
virtual void dump_node(ostream&, unsigned ind) const;
virtual void emit_node(struct target_t*) const;
virtual bool emit_node(struct target_t*) const;
virtual void functor_node(Design*des, functor_t*fun);
private:
@ -541,7 +541,7 @@ class NetFF : public NetNode {
const Link& pin_Q(unsigned) const;
virtual void dump_node(ostream&, unsigned ind) const;
virtual void emit_node(struct target_t*) const;
virtual bool emit_node(struct target_t*) const;
virtual void functor_node(Design*des, functor_t*fun);
};
@ -638,7 +638,7 @@ class NetMult : public NetNode {
const Link& pin_Sum(unsigned idx) const;
virtual void dump_node(ostream&, unsigned ind) const;
virtual void emit_node(struct target_t*) const;
virtual bool emit_node(struct target_t*) const;
virtual void functor_node(Design*des, functor_t*fun);
private:
@ -684,7 +684,7 @@ class NetMux : public NetNode {
const Link& pin_Sel(unsigned) const;
virtual void dump_node(ostream&, unsigned ind) const;
virtual void emit_node(struct target_t*) const;
virtual bool emit_node(struct target_t*) const;
virtual void functor_node(Design*des, functor_t*fun);
private:
@ -727,7 +727,7 @@ class NetRamDq : public NetNode {
const Link& pin_Q(unsigned idx) const;
virtual void dump_node(ostream&, unsigned ind) const;
virtual void emit_node(struct target_t*) const;
virtual bool emit_node(struct target_t*) const;
// Use this method to absorb other NetRamDq objects that are
// connected to the same memory, and have compatible pin
@ -849,7 +849,7 @@ class NetBUFZ : public NetNode {
~NetBUFZ();
virtual void dump_node(ostream&, unsigned ind) const;
virtual void emit_node(struct target_t*) const;
virtual bool emit_node(struct target_t*) const;
};
/*
@ -870,7 +870,7 @@ class NetCaseCmp : public NetNode {
~NetCaseCmp();
virtual void dump_node(ostream&, unsigned ind) const;
virtual void emit_node(struct target_t*) const;
virtual bool emit_node(struct target_t*) const;
};
/*
@ -890,7 +890,7 @@ class NetConst : public NetNode {
verinum::V value(unsigned idx) const;
virtual void emit_node(struct target_t*) const;
virtual bool emit_node(struct target_t*) const;
virtual void functor_node(Design*, functor_t*);
virtual void dump_node(ostream&, unsigned ind) const;
@ -919,7 +919,7 @@ class NetLogic : public NetNode {
TYPE type() const { return type_; }
virtual void dump_node(ostream&, unsigned ind) const;
virtual void emit_node(struct target_t*) const;
virtual bool emit_node(struct target_t*) const;
virtual void functor_node(Design*, functor_t*);
private:
@ -985,7 +985,7 @@ class NetUDP : public NetNode {
public:
explicit NetUDP(const string&n, unsigned pins, bool sequ =false);
virtual void emit_node( struct target_t*) const;
virtual bool emit_node( struct target_t*) const;
virtual void dump_node(ostream&, unsigned ind) const;
/* return false if the entry conflicts with an existing
@ -1045,7 +1045,7 @@ class NetUDP_COMB : public NetNode {
public:
explicit NetUDP_COMB(const string&n, unsigned pins);
virtual void emit_node(struct target_t*) const;
virtual bool emit_node(struct target_t*) const;
virtual void dump_node(ostream&, unsigned ind) const;
/* append a new truth table row. */
@ -1153,7 +1153,7 @@ class NetAssign : public NetAssign_ {
~NetAssign();
virtual bool emit_proc(struct target_t*) const;
virtual void emit_node(struct target_t*) const;
virtual bool emit_node(struct target_t*) const;
virtual int match_proc(struct proc_match_t*);
virtual void dump(ostream&, unsigned ind) const;
virtual void dump_node(ostream&, unsigned ind) const;
@ -1173,7 +1173,7 @@ class NetAssignNB : public NetAssign_ {
virtual bool emit_proc(struct target_t*) const;
virtual void emit_node(struct target_t*) const;
virtual bool emit_node(struct target_t*) const;
virtual int match_proc(struct proc_match_t*);
virtual void dump(ostream&, unsigned ind) const;
virtual void dump_node(ostream&, unsigned ind) const;
@ -1336,7 +1336,7 @@ class NetCAssign : public NetProc, public NetNode {
virtual void dump(ostream&, unsigned ind) const;
virtual bool emit_proc(struct target_t*) const;
virtual void dump_node(ostream&, unsigned ind) const;
virtual void emit_node(struct target_t*) const;
virtual bool emit_node(struct target_t*) const;
private:
NetNet*lval_;
@ -1580,7 +1580,7 @@ class NetEvProbe : public NetNode {
NetEvent* event();
const NetEvent* event() const;
virtual void emit_node(struct target_t*) const;
virtual bool emit_node(struct target_t*) const;
virtual void dump_node(ostream&, unsigned ind) const;
private:
@ -1611,7 +1611,7 @@ class NetForce : public NetProc, public NetNode {
virtual void dump(ostream&, unsigned ind) const;
virtual bool emit_proc(struct target_t*) const;
virtual void dump_node(ostream&, unsigned ind) const;
virtual void emit_node(struct target_t*) const;
virtual bool emit_node(struct target_t*) const;
private:
NetNet*lval_;
@ -2722,6 +2722,9 @@ extern ostream& operator << (ostream&, NetNet::Type);
/*
* $Log: netlist.h,v $
* Revision 1.156 2000/08/14 04:39:57 steve
* add th t-dll functions for net_const, net_bufz and processes.
*
* Revision 1.155 2000/08/09 03:43:45 steve
* Move all file manipulation out of target class.
*

View File

@ -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.1 2000/08/12 16:34:37 steve Exp $"
#ident "$Id: t-dll.cc,v 1.2 2000/08/14 04:39:57 steve Exp $"
#endif
# include "target.h"
@ -28,6 +28,14 @@ struct ivl_design_s {
const Design*des_;
};
struct ivl_net_const_s {
const NetConst*con_;
};
struct ivl_process_s {
const NetProcTop*top_;
};
/*
* The DLL target type loads a named object file to handle the process
* of scanning the netlist. When it is time to start the design, I
@ -40,21 +48,33 @@ struct dll_target : public target_t {
bool start_design(const Design*);
void end_design(const Design*);
bool bufz(const NetBUFZ*);
bool net_const(const NetConst*);
bool process(const NetProcTop*);
void*dll_;
string dll_path_;
struct ivl_design_s ivl_des;
start_design_f start_design_;
end_design_f end_design_;
net_bufz_f net_bufz_;
net_const_f net_const_;
process_f process_;
} dll_target_obj;
bool dll_target::start_design(const Design*des)
{
dll_ = dlopen(des->get_flag("DLL").c_str(), RTLD_NOW);
dll_path_ = des->get_flag("DLL");
dll_ = dlopen(dll_path_.c_str(), RTLD_NOW);
if (dll_ == 0) {
cerr << des->get_flag("DLL") << ": " << dlerror() << endl;
cerr << dll_path_ << ": " << dlerror() << endl;
return false;
}
@ -62,6 +82,10 @@ bool dll_target::start_design(const Design*des)
start_design_ = (start_design_f)dlsym(dll_, "target_start_design");
end_design_ = (end_design_f) dlsym(dll_, "target_end_design");
net_bufz_ = (net_bufz_f) dlsym(dll_, "target_net_bufz");
net_const_ = (net_const_f) dlsym(dll_, "target_net_const");
process_ = (process_f) dlsym(dll_, "target_process");
(start_design_)(&ivl_des);
return true;
}
@ -72,6 +96,59 @@ void dll_target::end_design(const Design*)
dlclose(dll_);
}
bool dll_target::bufz(const NetBUFZ*net)
{
if (net_bufz_) {
int rc = (net_bufz_)(net->name().c_str(), 0);
return rc == 0;
} else {
cerr << dll_path_ << ": internal error: target DLL lacks "
<< "target_net_bufz function." << endl;
return false;
}
return false;
}
bool dll_target::net_const(const NetConst*net)
{
struct ivl_net_const_s obj;
obj.con_ = net;
if (net_const_) {
int rc = (net_const_)(net->name().c_str(), &obj);
return rc == 0;
} else {
cerr << dll_path_ << ": internal error: target DLL lacks "
<< "target_net_const function." << endl;
return false;
}
return false;
}
bool dll_target::process(const NetProcTop*net)
{
struct ivl_process_s obj;
obj.top_ = net;
if (process_) {
int rc = (process_)(&obj);
return rc == 0;
} else {
cerr << dll_path_ << ": internal error: target DLL lacks "
<< "target_process function." << endl;
return false;
}
return false;
}
extern const struct target tgt_dll = { "dll", &dll_target_obj };
@ -84,6 +161,9 @@ extern "C" const char*ivl_get_flag(ivl_design_t des, const char*key)
/*
* $Log: t-dll.cc,v $
* Revision 1.2 2000/08/14 04:39:57 steve
* add th t-dll functions for net_const, net_bufz and processes.
*
* Revision 1.1 2000/08/12 16:34:37 steve
* Start stub for loadable targets.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: t-null.cc,v 1.15 2000/08/09 03:43:45 steve Exp $"
#ident "$Id: t-null.cc,v 1.16 2000/08/14 04:39:57 steve Exp $"
#endif
# include "netlist.h"
@ -31,14 +31,14 @@ static class target_null_t : public target_t {
public:
bool start_design(const Design*) { return true; }
void bufz(const NetBUFZ*) { }
bool bufz(const NetBUFZ*) { return true; }
void event(const NetEvent*) { }
void func_def(const NetFuncDef*) { }
void memory(const NetMemory*) { }
void task_def(const NetTaskDef*) { }
void net_assign(const NetAssign*) { }
void net_assign_nb(const NetAssignNB*) { }
void net_const(const NetConst*) { }
bool net_const(const NetConst*) { return true; }
void net_probe(const NetEvProbe*) { }
bool proc_block(const NetBlock*) { return true; }
void proc_condit(const NetCondit*) { }
@ -54,6 +54,9 @@ static class target_null_t : public target_t {
extern const struct target tgt_null = { "null", &target_null_obj };
/*
* $Log: t-null.cc,v $
* Revision 1.16 2000/08/14 04:39:57 steve
* add th t-dll functions for net_const, net_bufz and processes.
*
* Revision 1.15 2000/08/09 03:43:45 steve
* Move all file manipulation out of target class.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: t-verilog.cc,v 1.13 2000/08/09 03:43:45 steve Exp $"
#ident "$Id: t-verilog.cc,v 1.14 2000/08/14 04:39:57 steve Exp $"
#endif
/*
@ -41,7 +41,7 @@ class target_verilog : public target_t {
virtual bool start_design(const Design*);
virtual void signal(const NetNet*);
virtual void logic(const NetLogic*);
virtual void bufz(const NetBUFZ*);
virtual bool bufz(const NetBUFZ*);
virtual bool process(const NetProcTop*);
virtual bool proc_block(const NetBlock*);
@ -132,7 +132,7 @@ void target_verilog::logic(const NetLogic*net)
out << ");" << endl;
}
void target_verilog::bufz(const NetBUFZ*net)
bool target_verilog::bufz(const NetBUFZ*net)
{
assert( net->pin_count() == 2 );
out << " assign ";
@ -143,6 +143,7 @@ void target_verilog::bufz(const NetBUFZ*net)
sig = find_link_signal(net, 1, sidx);
out << mangle(sig->name()) << "[" << sidx << "];" << endl;
return true;
}
bool target_verilog::process(const NetProcTop*top)
@ -264,6 +265,9 @@ const struct target tgt_verilog = {
/*
* $Log: t-verilog.cc,v $
* Revision 1.14 2000/08/14 04:39:57 steve
* add th t-dll functions for net_const, net_bufz and processes.
*
* Revision 1.13 2000/08/09 03:43:45 steve
* Move all file manipulation out of target class.
*

View File

@ -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.167 2000/08/09 03:43:45 steve Exp $"
#ident "$Id: t-vvm.cc,v 1.168 2000/08/14 04:39:57 steve Exp $"
#endif
# include <iostream>
@ -162,14 +162,14 @@ class target_vvm : public target_t {
virtual void lpm_ram_dq(const NetRamDq*);
virtual void logic(const NetLogic*);
virtual void bufz(const NetBUFZ*);
virtual bool bufz(const NetBUFZ*);
virtual void udp(const NetUDP*);
virtual void udp_comb(const NetUDP_COMB*);
void udp_sequ_(ostream&os, const NetUDP*);
virtual void net_assign_nb(const NetAssignNB*);
virtual void net_case_cmp(const NetCaseCmp*);
virtual bool net_cassign(const NetCAssign*);
virtual void net_const(const NetConst*);
virtual bool net_const(const NetConst*);
virtual bool net_force(const NetForce*);
virtual void net_probe(const NetEvProbe*);
virtual bool process(const NetProcTop*);
@ -1808,7 +1808,7 @@ void target_vvm::logic(const NetLogic*gate)
}
}
void target_vvm::bufz(const NetBUFZ*gate)
bool target_vvm::bufz(const NetBUFZ*gate)
{
string mname = mangle(gate->name());
string nexus;
@ -1849,6 +1849,7 @@ void target_vvm::bufz(const NetBUFZ*gate)
init_code << " nexus_wire_table["<<ncode<<"].connect(&" <<
mname << ",0);" << endl;
return true;
}
void target_vvm::udp_comb(const NetUDP_COMB*gate)
@ -2034,7 +2035,7 @@ bool target_vvm::net_cassign(const NetCAssign*dev)
* has its input connected to nothing but is initialized to the
* desired constant value.
*/
void target_vvm::net_const(const NetConst*gate)
bool target_vvm::net_const(const NetConst*gate)
{
const string mname = mangle(gate->name());
@ -2055,6 +2056,7 @@ void target_vvm::net_const(const NetConst*gate)
<< val_str << ");" << endl;
}
return true;
}
@ -3115,6 +3117,9 @@ extern const struct target tgt_vvm = {
};
/*
* $Log: t-vvm.cc,v $
* Revision 1.168 2000/08/14 04:39:57 steve
* add th t-dll functions for net_const, net_bufz and processes.
*
* Revision 1.167 2000/08/09 03:43:45 steve
* Move all file manipulation out of target class.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: t-xnf.cc,v 1.34 2000/08/09 03:43:45 steve Exp $"
#ident "$Id: t-xnf.cc,v 1.35 2000/08/14 04:39:57 steve Exp $"
#endif
/* XNF BACKEND
@ -108,9 +108,9 @@ class target_xnf : public target_t {
void lpm_mux(const NetMux*);
void lpm_ram_dq(const NetRamDq*);
void net_const(const NetConst*);
bool net_const(const NetConst*);
void logic(const NetLogic*);
void bufz(const NetBUFZ*);
bool bufz(const NetBUFZ*);
void udp(const NetUDP*);
private:
@ -748,7 +748,7 @@ void target_xnf::lpm_ram_dq(const NetRamDq*ram)
}
}
void target_xnf::net_const(const NetConst*c)
bool target_xnf::net_const(const NetConst*c)
{
for (unsigned idx = 0 ; idx < c->pin_count() ; idx += 1) {
verinum::V v=c->value(idx);
@ -761,6 +761,8 @@ void target_xnf::net_const(const NetConst*c)
out_ << " PWR, " << v << ", " << choose_sig_name(&lnk) << endl;
}
return true;
}
/*
@ -848,7 +850,7 @@ void target_xnf::logic(const NetLogic*net)
out_ << "END" << endl;
}
void target_xnf::bufz(const NetBUFZ*net)
bool target_xnf::bufz(const NetBUFZ*net)
{
static int warned_once=0;
if (!warned_once) {
@ -861,6 +863,8 @@ void target_xnf::bufz(const NetBUFZ*net)
draw_pin(out_, "O", net->pin(0));
draw_pin(out_, "I", net->pin(1));
out_ << "END" << endl;
return true;
}
void target_xnf::udp(const NetUDP*net)
@ -883,6 +887,9 @@ extern const struct target tgt_xnf = { "xnf", &target_xnf_obj };
/*
* $Log: t-xnf.cc,v $
* Revision 1.35 2000/08/14 04:39:57 steve
* add th t-dll functions for net_const, net_bufz and processes.
*
* Revision 1.34 2000/08/09 03:43:45 steve
* Move all file manipulation out of target class.
*

View File

@ -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.43 2000/08/09 03:43:45 steve Exp $"
#ident "$Id: target.cc,v 1.44 2000/08/14 04:39:57 steve Exp $"
#endif
# include "target.h"
@ -63,10 +63,11 @@ void target_t::logic(const NetLogic*)
{
}
void target_t::bufz(const NetBUFZ*)
bool target_t::bufz(const NetBUFZ*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled continuous assign (BUFZ)." << endl;
return false;
}
void target_t::udp(const NetUDP*)
@ -152,10 +153,11 @@ bool target_t::net_cassign(const NetCAssign*dev)
return false;
}
void target_t::net_const(const NetConst*)
bool target_t::net_const(const NetConst*)
{
cerr << "target (" << typeid(*this).name() << "): "
"Unhandled CONSTANT node." << endl;
return false;
}
bool target_t::net_force(const NetForce*dev)
@ -394,6 +396,9 @@ void expr_scan_t::expr_binary(const NetEBinary*ex)
/*
* $Log: target.cc,v $
* Revision 1.44 2000/08/14 04:39:57 steve
* add th t-dll functions for net_const, net_bufz and processes.
*
* Revision 1.43 2000/08/09 03:43:45 steve
* Move all file manipulation out of target class.
*

View File

@ -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.42 2000/08/09 03:43:45 steve Exp $"
#ident "$Id: target.h,v 1.43 2000/08/14 04:39:57 steve Exp $"
#endif
# include "netlist.h"
@ -84,14 +84,14 @@ struct target_t {
/* Output a gate (called for each gate) */
virtual void logic(const NetLogic*);
virtual void bufz(const NetBUFZ*);
virtual bool bufz(const NetBUFZ*);
virtual void udp(const NetUDP*);
virtual void udp_comb(const NetUDP_COMB*);
virtual void net_assign(const NetAssign*);
virtual void net_assign_nb(const NetAssignNB*);
virtual void net_case_cmp(const NetCaseCmp*);
virtual bool net_cassign(const NetCAssign*);
virtual void net_const(const NetConst*);
virtual bool net_const(const NetConst*);
virtual bool net_force(const NetForce*);
virtual void net_probe(const NetEvProbe*);
@ -160,6 +160,9 @@ extern const struct target *target_table[];
/*
* $Log: target.h,v $
* Revision 1.43 2000/08/14 04:39:57 steve
* add th t-dll functions for net_const, net_bufz and processes.
*
* Revision 1.42 2000/08/09 03:43:45 steve
* Move all file manipulation out of target class.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: stub.c,v 1.1 2000/08/12 16:34:37 steve Exp $"
#ident "$Id: stub.c,v 1.2 2000/08/14 04:39:57 steve Exp $"
#endif
# include <ivl_target.h>
@ -48,8 +48,29 @@ void target_end_design(ivl_design_t des)
fclose(out);
}
int target_net_bufz(const char*name, ivl_net_bufz_t net)
{
fprintf(out, "STUB: %s: BUFZ\n", name);
return 0;
}
int target_net_const(const char*name, ivl_net_const_t net)
{
fprintf(out, "STUB: %s: constant\n", name);
return 0;
}
int target_process(ivl_process_t net)
{
fprintf(out, "STUB: process\n");
return 0;
}
/*
* $Log: stub.c,v $
* Revision 1.2 2000/08/14 04:39:57 steve
* add th t-dll functions for net_const, net_bufz and processes.
*
* Revision 1.1 2000/08/12 16:34:37 steve
* Start stub for loadable targets.
*