Add support for edge sensitive spec paths.

This commit is contained in:
steve 2007-03-02 06:13:22 +00:00
parent b21390b228
commit fc9a90c9e0
18 changed files with 268 additions and 47 deletions

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: design_dump.cc,v 1.173 2007/02/01 03:14:33 steve Exp $"
#ident "$Id: design_dump.cc,v 1.174 2007/03/02 06:13:22 steve Exp $"
#endif
# include "config.h"
@ -93,7 +93,10 @@ ostream& operator << (ostream&o, ivl_variable_type_t val)
void NetDelaySrc::dump(ostream&o, unsigned ind) const
{
o << setw(ind) << "" << "specify delay src "
o << setw(ind) << "" << "specify delay";
if (posedge_) o << " posedge";
if (negedge_) o << " negedge";
o << " src "
<< "(" << transition_delays_[IVL_PE_01]
<< "," << transition_delays_[IVL_PE_10]
<< "," << transition_delays_[IVL_PE_0z]
@ -1202,6 +1205,9 @@ void Design::dump(ostream&o) const
/*
* $Log: design_dump.cc,v $
* Revision 1.174 2007/03/02 06:13:22 steve
* Add support for edge sensitive spec paths.
*
* Revision 1.173 2007/02/01 03:14:33 steve
* Detect and report arrays without index in net contexts.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: elaborate.cc,v 1.360 2007/03/01 06:19:38 steve Exp $"
#ident "$Id: elaborate.cc,v 1.361 2007/03/02 06:13:22 steve Exp $"
#endif
# include "config.h"
@ -2934,15 +2934,6 @@ void PSpecPath::elaborate(Design*des, NetScope*scope) const
}
ivl_assert(*this, conditional || (condition==0));
if (edge != 0) {
cerr << get_line() << ": sorry: Edge sensitive specify paths"
<< " are not supported." << endl;
cerr << get_line() << ": : Use -g no-specify to ignore"
<< " specify blocks." << endl;
des->errors += 1;
}
ivl_assert(*this, data_source_expression==0 || edge != 0);
ndelays = delays.size();
@ -3027,6 +3018,9 @@ void PSpecPath::elaborate(Design*des, NetScope*scope) const
src.size(), condit_sig);
path->set_line(*this);
if (edge > 0) path->set_posedge();
if (edge < 0) path->set_negedge();
switch (ndelays) {
case 12:
path->set_delays(delay_value[0], delay_value[1],
@ -3394,6 +3388,9 @@ Design* elaborate(list<perm_string>roots)
/*
* $Log: elaborate.cc,v $
* Revision 1.361 2007/03/02 06:13:22 steve
* Add support for edge sensitive spec paths.
*
* Revision 1.360 2007/03/01 06:19:38 steve
* Add support for conditional specify delay paths.
*

View File

@ -112,6 +112,8 @@ ivl_parameter_expr
ivl_path_condit
ivl_path_delay
ivl_path_source
ivl_path_source_negedge
ivl_path_source_posedge
ivl_scope_attr_cnt
ivl_scope_attr_val

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: ivl_target.h,v 1.179 2007/03/01 06:19:38 steve Exp $"
#ident "$Id: ivl_target.h,v 1.180 2007/03/02 06:13:22 steve Exp $"
#endif
# include <inttypes.h>
@ -387,15 +387,22 @@ typedef const struct ivl_attribute_s*ivl_attribute_t;
* This returns the nexus that is the source end of the delay
* path. Transitions on the source are the start of the delay time
* for this path.
*
* ivl_path_condit
* This returns the nexus that tracks the condition for the
* delay. If the delay path is unconditional, this returns nil.
*
* ivl_path_condit
* This returns the nexus that tracks the condition for the
* delay. If the delay path is unconditional, this returns nil.
*
* ivl_path_srouce_posedge
* ivl_path_source_negedge
* These functions return true if the source is edge sensitive.
*/
extern ivl_nexus_t ivl_path_source(ivl_delaypath_t obj);
extern uint64_t ivl_path_delay(ivl_delaypath_t obj, ivl_path_edge_t pt);
extern ivl_nexus_t ivl_path_condit(ivl_delaypath_t obj);
extern int ivl_path_source_posedge(ivl_delaypath_t obj);
extern int ivl_path_source_negedge(ivl_delaypath_t obj);
/* DESIGN
* When handed a design (ivl_design_t) there are a few things that you
* can do with it. The Verilog program has one design that carries the
@ -1772,6 +1779,9 @@ _END_DECL
/*
* $Log: ivl_target.h,v $
* Revision 1.180 2007/03/02 06:13:22 steve
* Add support for edge sensitive spec paths.
*
* Revision 1.179 2007/03/01 06:19:38 steve
* Add support for conditional specify delay paths.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: netlist.cc,v 1.255 2007/03/01 06:19:38 steve Exp $"
#ident "$Id: netlist.cc,v 1.256 2007/03/02 06:13:22 steve Exp $"
#endif
# include "config.h"
@ -242,6 +242,8 @@ NetDelaySrc::NetDelaySrc(NetScope*s, perm_string n,
: NetObj(s, n, npins + (condit_src?1:0))
{
condit_flag_ = false;
posedge_ = false;
negedge_ = false;
for (unsigned idx = 0 ; idx < npins ; idx += 1) {
pin(idx).set_name(perm_string::literal("I"), idx);
pin(idx).set_dir(Link::INPUT);
@ -338,6 +340,26 @@ uint64_t NetDelaySrc::get_delay(unsigned idx) const
return transition_delays_[idx];
}
void NetDelaySrc::set_posedge()
{
posedge_ = true;
}
void NetDelaySrc::set_negedge()
{
negedge_ = true;
}
bool NetDelaySrc::is_posedge() const
{
return posedge_;
}
bool NetDelaySrc::is_negedge() const
{
return negedge_;
}
unsigned NetDelaySrc::src_count() const
{
if (condit_flag_)
@ -2265,6 +2287,9 @@ const NetProc*NetTaskDef::proc() const
/*
* $Log: netlist.cc,v $
* Revision 1.256 2007/03/02 06:13:22 steve
* Add support for edge sensitive spec paths.
*
* Revision 1.255 2007/03/01 06:19:38 steve
* Add support for conditional specify delay paths.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: netlist.h,v 1.370 2007/03/01 06:19:38 steve Exp $"
#ident "$Id: netlist.h,v 1.371 2007/03/02 06:13:22 steve Exp $"
#endif
/*
@ -402,6 +402,11 @@ class NetDelaySrc : public NetObj {
uint64_t get_delay(unsigned pe) const;
void set_posedge();
void set_negedge();
bool is_posedge() const;
bool is_negedge() const;
unsigned src_count() const;
Link&src_pin(unsigned);
const Link&src_pin(unsigned) const;
@ -415,6 +420,8 @@ class NetDelaySrc : public NetObj {
private:
uint64_t transition_delays_[12];
bool condit_flag_;
bool posedge_;
bool negedge_;
private: // Not implemented
NetDelaySrc(const NetDelaySrc&);
@ -3485,6 +3492,9 @@ extern ostream& operator << (ostream&, NetNet::Type);
/*
* $Log: netlist.h,v $
* Revision 1.371 2007/03/02 06:13:22 steve
* Add support for edge sensitive spec paths.
*
* Revision 1.370 2007/03/01 06:19:38 steve
* Add support for conditional specify delay paths.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll-api.cc,v 1.141 2007/03/01 06:19:39 steve Exp $"
#ident "$Id: t-dll-api.cc,v 1.142 2007/03/02 06:13:22 steve Exp $"
#endif
# include "config.h"
@ -1259,6 +1259,16 @@ extern ivl_nexus_t ivl_path_source(ivl_delaypath_t net)
return net->src;
}
extern int ivl_path_source_posedge(ivl_delaypath_t net)
{
return net->posedge ? 1 : 0;
}
extern int ivl_path_source_negedge(ivl_delaypath_t net)
{
return net->negedge ? 1 : 0;
}
extern "C" ivl_process_type_t ivl_process_type(ivl_process_t net)
{
return net->type_;
@ -1940,6 +1950,9 @@ extern "C" ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net)
/*
* $Log: t-dll-api.cc,v $
* Revision 1.142 2007/03/02 06:13:22 steve
* Add support for edge sensitive spec paths.
*
* Revision 1.141 2007/03/01 06:19:39 steve
* Add support for conditional specify delay paths.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll.cc,v 1.165 2007/03/01 06:19:39 steve Exp $"
#ident "$Id: t-dll.cc,v 1.166 2007/03/02 06:13:22 steve Exp $"
#endif
# include "config.h"
@ -2180,6 +2180,8 @@ bool dll_target::signal_paths(const NetNet*net)
assert(nex->t_cookie());
obj->path[ptr].src = (ivl_nexus_t) nex->t_cookie();
obj->path[ptr].condit = path_condit;
obj->path[ptr].posedge = src->is_posedge();
obj->path[ptr].negedge = src->is_negedge();
for (unsigned pe = 0 ; pe < 12 ; pe += 1) {
obj->path[ptr].delay[pe] = src->get_delay(pe);
}
@ -2197,6 +2199,9 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj };
/*
* $Log: t-dll.cc,v $
* Revision 1.166 2007/03/02 06:13:22 steve
* Add support for edge sensitive spec paths.
*
* Revision 1.165 2007/03/01 06:19:39 steve
* Add support for conditional specify delay paths.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll.h,v 1.138 2007/03/01 06:19:39 steve Exp $"
#ident "$Id: t-dll.h,v 1.139 2007/03/02 06:13:22 steve Exp $"
#endif
# include "target.h"
@ -176,6 +176,8 @@ struct dll_target : public target_t, public expr_scan_t {
struct ivl_delaypath_s {
ivl_nexus_t src;
ivl_nexus_t condit;
bool posedge;
bool negedge;
uint64_t delay[12];
};
@ -667,6 +669,9 @@ struct ivl_statement_s {
/*
* $Log: t-dll.h,v $
* Revision 1.139 2007/03/02 06:13:22 steve
* Add support for edge sensitive spec paths.
*
* Revision 1.138 2007/03/01 06:19:39 steve
* Add support for conditional specify delay paths.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: stub.c,v 1.146 2007/03/01 06:19:39 steve Exp $"
#ident "$Id: stub.c,v 1.147 2007/03/02 06:13:22 steve Exp $"
#endif
/*
@ -1131,8 +1131,12 @@ static void show_signal(ivl_signal_t net)
ivl_delaypath_t path = ivl_signal_path(net,idx);
ivl_nexus_t nex = ivl_path_source(path);
ivl_nexus_t con = ivl_path_condit(path);
int posedge = ivl_path_source_posedge(path);
int negedge = ivl_path_source_negedge(path);
fprintf(out, " path %s", ivl_nexus_name(nex));
if (posedge) fprintf(out, " posedge");
if (negedge) fprintf(out, " negedge");
if (con) fprintf(out, " (if %s)", ivl_nexus_name(con));
fprintf(out, " %" PRIu64 ",%" PRIu64 ",%" PRIu64
" %" PRIu64 ",%" PRIu64 ",%" PRIu64
@ -1487,6 +1491,9 @@ int target_design(ivl_design_t des)
/*
* $Log: stub.c,v $
* Revision 1.147 2007/03/02 06:13:22 steve
* Add support for edge sensitive spec paths.
*
* Revision 1.146 2007/03/01 06:19:39 steve
* Add support for conditional specify delay paths.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: vvp_scope.c,v 1.154 2007/03/01 06:19:39 steve Exp $"
#ident "$Id: vvp_scope.c,v 1.155 2007/03/02 06:13:22 steve Exp $"
#endif
# include "vvp_priv.h"
@ -693,7 +693,10 @@ static void draw_modpath(const char*label, const char*driver,
for (idx = 0 ; idx < ivl_signal_npath(path_sig); idx += 1) {
ivl_delaypath_t path = ivl_signal_path(path_sig, idx);
fprintf(vvp_out, ",\n %s", src_drivers[idx]);
int ppos = ivl_path_source_posedge(path);
int pneg = ivl_path_source_negedge(path);
const char*edge = ppos? " +" : pneg ? " -" : "";
fprintf(vvp_out, ",\n %s%s", src_drivers[idx], edge);
fprintf(vvp_out,
" (%"PRIu64",%"PRIu64",%"PRIu64
", %"PRIu64",%"PRIu64",%"PRIu64
@ -2366,6 +2369,9 @@ int draw_scope(ivl_scope_t net, ivl_scope_t parent)
/*
* $Log: vvp_scope.c,v $
* Revision 1.155 2007/03/02 06:13:22 steve
* Add support for edge sensitive spec paths.
*
* Revision 1.154 2007/03/01 06:19:39 steve
* Add support for conditional specify delay paths.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: compile.cc,v 1.229 2007/03/01 06:19:39 steve Exp $"
#ident "$Id: compile.cc,v 1.230 2007/03/02 06:13:22 steve Exp $"
#endif
# include "arith.h"
@ -1099,22 +1099,49 @@ vvp_fun_modpath* compile_modpath(char*label, struct symb_s src)
return obj;
}
static vvp_net_t*make_modpath_src(vvp_fun_modpath*dst,
struct symb_s src,
struct numbv_s vals)
static vvp_net_t*make_modpath_src(vvp_fun_modpath*dst, char edge,
struct symb_s src, struct numbv_s vals)
{
vvp_time64_t use_delay[12];
assert(vals.cnt == 12);
for (unsigned idx = 0 ; idx < vals.cnt ; idx += 1) {
use_delay[idx] = vals.nvec[idx];
}
numbv_clear(&vals);
vvp_fun_modpath_src*obj = 0;
if (edge == 0) {
obj = new vvp_fun_modpath_src(use_delay);
} else {
bool posedge, negedge;
switch (edge) {
case 0:
posedge = false;
negedge = false;
break;
case '+':
posedge = true;
negedge = false;
break;
case '-':
posedge = false;
negedge = true;
break;
case '*':
posedge = true;
negedge = false;
break;
default:
assert(0);
}
obj = new vvp_fun_modpath_edge(use_delay, posedge, negedge);
}
vvp_net_t*net = new vvp_net_t;
vvp_fun_modpath_src*obj = new vvp_fun_modpath_src(use_delay);
net->fun = obj;
input_connect(net, 0, src.text);
@ -1123,19 +1150,18 @@ static vvp_net_t*make_modpath_src(vvp_fun_modpath*dst,
return net;
}
void compile_modpath_src(vvp_fun_modpath*dst,
struct symb_s src,
struct numbv_s vals)
void compile_modpath_src(vvp_fun_modpath*dst, char edge,
struct symb_s src, struct numbv_s vals)
{
make_modpath_src(dst, src, vals);
make_modpath_src(dst, edge, src, vals);
}
void compile_modpath_src(vvp_fun_modpath*dst,
void compile_modpath_src(vvp_fun_modpath*dst, char edge,
struct symb_s src,
struct numbv_s vals,
struct symb_s condit_src)
{
vvp_net_t*net = make_modpath_src(dst, src, vals);
vvp_net_t*net = make_modpath_src(dst, edge, src, vals);
input_connect(net, 1, condit_src.text);
}
@ -1597,6 +1623,9 @@ void compile_param_string(char*label, char*name, char*value)
/*
* $Log: compile.cc,v $
* Revision 1.230 2007/03/02 06:13:22 steve
* Add support for edge sensitive spec paths.
*
* Revision 1.229 2007/03/01 06:19:39 steve
* Add support for conditional specify delay paths.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: compile.h,v 1.86 2007/03/01 06:19:39 steve Exp $"
#ident "$Id: compile.h,v 1.87 2007/03/02 06:13:22 steve Exp $"
#endif
# include <stdio.h>
@ -164,9 +164,11 @@ extern void compile_dff(char*label,
class vvp_fun_modpath;
extern vvp_fun_modpath* compile_modpath(char*label, struct symb_s src);
extern void compile_modpath_src(vvp_fun_modpath*dst,
char edge,
struct symb_s input,
struct numbv_s d);
extern void compile_modpath_src(vvp_fun_modpath*dst,
char edge,
struct symb_s input,
struct numbv_s d,
struct symb_s condit_input);
@ -366,6 +368,9 @@ extern void compile_alias_real(char*label, char*name,
/*
* $Log: compile.h,v $
* Revision 1.87 2007/03/02 06:13:22 steve
* Add support for edge sensitive spec paths.
*
* Revision 1.86 2007/03/01 06:19:39 steve
* Add support for conditional specify delay paths.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: delay.cc,v 1.17 2007/03/01 06:19:39 steve Exp $"
#ident "$Id: delay.cc,v 1.18 2007/03/02 06:13:22 steve Exp $"
#endif
#include "delay.h"
@ -440,7 +440,8 @@ void vvp_fun_modpath_src::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit)
{
if (port.port() == 0) {
// The modpath input...
wake_time_ = schedule_simtime();
if (test_vec4(bit))
wake_time_ = schedule_simtime();
} else if (port.port() == 1) {
// The modpath condition input...
@ -451,8 +452,36 @@ void vvp_fun_modpath_src::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit)
}
}
bool vvp_fun_modpath_src::test_vec4(const vvp_vector4_t&)
{
return true;
}
vvp_fun_modpath_edge::vvp_fun_modpath_edge(vvp_time64_t del[12],
bool pos, bool neg)
: vvp_fun_modpath_src(del)
{
old_value_ = BIT4_X;
posedge_ = pos;
negedge_ = neg;
}
bool vvp_fun_modpath_edge::test_vec4(const vvp_vector4_t&bit)
{
vvp_bit4_t tmp = old_value_;
old_value_ = bit.value(0);
int edge_flag = edge(tmp, old_value_);
if (edge_flag > 0) return posedge_;
if (edge_flag < 0) return negedge_;
return false;
}
/*
* $Log: delay.cc,v $
* Revision 1.18 2007/03/02 06:13:22 steve
* Add support for edge sensitive spec paths.
*
* Revision 1.17 2007/03/01 06:19:39 steve
* Add support for conditional specify delay paths.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: delay.h,v 1.14 2007/03/01 06:19:39 steve Exp $"
#ident "$Id: delay.h,v 1.15 2007/03/02 06:13:22 steve Exp $"
#endif
/*
@ -180,12 +180,14 @@ class vvp_fun_modpath_src : public vvp_net_fun_t {
public:
vvp_fun_modpath_src(vvp_time64_t d[12]);
private:
protected:
~vvp_fun_modpath_src();
public:
void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit);
virtual bool test_vec4(const vvp_vector4_t&bit);
private:
// FIXME: Needs to be a 12-value array
vvp_time64_t delay_[12];
@ -200,8 +202,24 @@ class vvp_fun_modpath_src : public vvp_net_fun_t {
vvp_fun_modpath_src& operator = (const vvp_fun_modpath_src&);
};
class vvp_fun_modpath_edge : public vvp_fun_modpath_src {
public:
vvp_fun_modpath_edge(vvp_time64_t del[12], bool pos, bool neg);
bool test_vec4(const vvp_vector4_t&bit);
private:
vvp_bit4_t old_value_;
bool posedge_;
bool negedge_;
};
/*
* $Log: delay.h,v $
* Revision 1.15 2007/03/02 06:13:22 steve
* Add support for edge sensitive spec paths.
*
* Revision 1.14 2007/03/01 06:19:39 steve
* Add support for conditional specify delay paths.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: parse.y,v 1.88 2007/03/01 06:19:39 steve Exp $"
#ident "$Id: parse.y,v 1.89 2007/03/02 06:13:22 steve Exp $"
#endif
# include "parse_misc.h"
@ -745,9 +745,17 @@ modpath_src_list
modpath_src
: symbol '(' numbers ')'
{ compile_modpath_src(modpath_dst, $1, $3); }
{ compile_modpath_src(modpath_dst, 0, $1, $3); }
| symbol '(' numbers '?' symbol ')'
{ compile_modpath_src(modpath_dst, $1, $3, $5); }
{ compile_modpath_src(modpath_dst, 0, $1, $3, $5); }
| symbol '+' '(' numbers ')'
{ compile_modpath_src(modpath_dst, '+', $1, $4); }
| symbol '+' '(' numbers '?' symbol ')'
{ compile_modpath_src(modpath_dst, '+', $1, $4, $6); }
| symbol '-' '(' numbers ')'
{ compile_modpath_src(modpath_dst, '-', $1, $4); }
| symbol '-' '(' numbers '?' symbol ')'
{ compile_modpath_src(modpath_dst, '-', $1, $4, $6); }
;
udp_table
@ -805,6 +813,9 @@ int compile_design(const char*path)
/*
* $Log: parse.y,v $
* Revision 1.89 2007/03/02 06:13:22 steve
* Add support for edge sensitive spec paths.
*
* Revision 1.88 2007/03/01 06:19:39 steve
* Add support for conditional specify delay paths.
*

View File

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ident "$Id: vvp_net.cc,v 1.58 2007/02/05 01:08:10 steve Exp $"
#ident "$Id: vvp_net.cc,v 1.59 2007/03/02 06:13:22 steve Exp $"
# include "config.h"
# include "vvp_net.h"
@ -130,6 +130,39 @@ ostream& operator<<(ostream&out, vvp_bit4_t bit)
return out;
}
typedef unsigned short edge_t;
inline edge_t VVP_EDGE(vvp_bit4_t from, vvp_bit4_t to)
{
return 1 << ((from << 2) | to);
}
const edge_t vvp_edge_posedge
= VVP_EDGE(BIT4_0,BIT4_1)
| VVP_EDGE(BIT4_0,BIT4_X)
| VVP_EDGE(BIT4_0,BIT4_Z)
| VVP_EDGE(BIT4_X,BIT4_1)
| VVP_EDGE(BIT4_Z,BIT4_1)
;
const edge_t vvp_edge_negedge
= VVP_EDGE(BIT4_1,BIT4_0)
| VVP_EDGE(BIT4_1,BIT4_X)
| VVP_EDGE(BIT4_1,BIT4_Z)
| VVP_EDGE(BIT4_X,BIT4_0)
| VVP_EDGE(BIT4_Z,BIT4_0)
;
int edge(vvp_bit4_t from, vvp_bit4_t to)
{
edge_t mask = VVP_EDGE(from, to);
if (mask & vvp_edge_posedge)
return 1;
if (mask & vvp_edge_negedge)
return -1;
return 0;
}
void vvp_send_vec8(vvp_net_ptr_t ptr, vvp_vector8_t val)
{
while (struct vvp_net_t*cur = ptr.ptr()) {
@ -2257,6 +2290,9 @@ vvp_bit4_t compare_gtge_signed(const vvp_vector4_t&a,
/*
* $Log: vvp_net.cc,v $
* Revision 1.59 2007/03/02 06:13:22 steve
* Add support for edge sensitive spec paths.
*
* Revision 1.58 2007/02/05 01:08:10 steve
* Handle relink of continuous assignment.
*

View File

@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ident "$Id: vvp_net.h,v 1.55 2007/02/05 01:08:10 steve Exp $"
#ident "$Id: vvp_net.h,v 1.56 2007/03/02 06:13:22 steve Exp $"
# include "config.h"
# include <stddef.h>
@ -76,6 +76,10 @@ extern vvp_bit4_t operator | (vvp_bit4_t a, vvp_bit4_t b);
extern vvp_bit4_t operator ^ (vvp_bit4_t a, vvp_bit4_t b);
extern ostream& operator<< (ostream&o, vvp_bit4_t a);
/* Return >0, ==0 or <0 if the from-to transition represents a
posedge, no edge, or negedge. */
extern int edge(vvp_bit4_t from, vvp_bit4_t to);
/*
* This class represents scalar values collected into vectors. The
* vector values can be accessed individually, or treated as a
@ -1036,6 +1040,9 @@ inline void vvp_send_vec4_pv(vvp_net_ptr_t ptr, const vvp_vector4_t&val,
/*
* $Log: vvp_net.h,v $
* Revision 1.56 2007/03/02 06:13:22 steve
* Add support for edge sensitive spec paths.
*
* Revision 1.55 2007/02/05 01:08:10 steve
* Handle relink of continuous assignment.
*