Delay object supports real valued delays.
This commit is contained in:
parent
aab6fefd8a
commit
5348ac14a5
26
vvp/delay.cc
26
vvp/delay.cc
|
|
@ -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.12 2006/01/02 05:32:07 steve Exp $"
|
||||
#ident "$Id: delay.cc,v 1.13 2006/07/08 21:48:00 steve Exp $"
|
||||
#endif
|
||||
|
||||
#include "delay.h"
|
||||
|
|
@ -220,6 +220,27 @@ void vvp_fun_delay::recv_vec8(vvp_net_ptr_t port, vvp_vector8_t bit)
|
|||
|
||||
void vvp_fun_delay::recv_real(vvp_net_ptr_t port, double bit)
|
||||
{
|
||||
if (port.port() > 0) {
|
||||
/* If the port is not 0, then this is a delay value that
|
||||
should be rounded and converted to an integer delay. */
|
||||
unsigned long long val = 0;
|
||||
if (bit > 0)
|
||||
val = (unsigned long long) (bit+0.5);
|
||||
|
||||
switch (port.port()) {
|
||||
case 1:
|
||||
delay_.set_rise(val);
|
||||
return;
|
||||
case 2:
|
||||
delay_.set_fall(val);
|
||||
return;
|
||||
case 3:
|
||||
delay_.set_decay(val);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (cur_real_ == bit)
|
||||
return;
|
||||
|
||||
|
|
@ -258,6 +279,9 @@ void vvp_fun_delay::run_run_real_()
|
|||
|
||||
/*
|
||||
* $Log: delay.cc,v $
|
||||
* Revision 1.13 2006/07/08 21:48:00 steve
|
||||
* Delay object supports real valued delays.
|
||||
*
|
||||
* Revision 1.12 2006/01/02 05:32:07 steve
|
||||
* Require explicit delay node from source.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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.53 2006/06/18 04:15:50 steve Exp $"
|
||||
#ident "$Id: vvp_net.cc,v 1.54 2006/07/08 21:48:00 steve Exp $"
|
||||
|
||||
# include "config.h"
|
||||
# include "vvp_net.h"
|
||||
|
|
@ -1296,10 +1296,10 @@ void vvp_net_fun_t::recv_vec8(vvp_net_ptr_t port, vvp_vector8_t bit)
|
|||
recv_vec4(port, reduce4(bit));
|
||||
}
|
||||
|
||||
void vvp_net_fun_t::recv_real(vvp_net_ptr_t, double)
|
||||
void vvp_net_fun_t::recv_real(vvp_net_ptr_t, double bit)
|
||||
{
|
||||
fprintf(stderr, "internal error: %s: recv_real not implemented\n",
|
||||
typeid(*this).name());
|
||||
fprintf(stderr, "internal error: %s: recv_real(%f) not implemented\n",
|
||||
typeid(*this).name(), bit);
|
||||
assert(0);
|
||||
}
|
||||
|
||||
|
|
@ -2193,6 +2193,9 @@ vvp_bit4_t compare_gtge_signed(const vvp_vector4_t&a,
|
|||
|
||||
/*
|
||||
* $Log: vvp_net.cc,v $
|
||||
* Revision 1.54 2006/07/08 21:48:00 steve
|
||||
* Delay object supports real valued delays.
|
||||
*
|
||||
* Revision 1.53 2006/06/18 04:15:50 steve
|
||||
* Add support for system functions in continuous assignments.
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue