Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Delay object supports real valued delays.
  • Loading branch information
steve committed Jul 8, 2006
1 parent aab6fef commit 5348ac1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
26 changes: 25 additions & 1 deletion vvp/delay.cc
Expand Up @@ -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"
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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.
*
Expand Down
11 changes: 7 additions & 4 deletions vvp/vvp_net.cc
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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.
*
Expand Down

0 comments on commit 5348ac1

Please sign in to comment.