Remove peek_out() access to the vvp_net_t out member.

Fix up the last bits of code that accessed the ->out member of the
vvp_net_t class. Now the out member is only accessed by send_* methods.
This commit is contained in:
Stephen Williams 2009-04-06 21:47:21 -07:00
parent 6d34b41dce
commit 6f8b229646
4 changed files with 42 additions and 2 deletions

View File

@ -257,6 +257,27 @@ void assign_array_word_s::operator delete(void*ptr)
unsigned long count_assign_aword_pool(void) { return array_w_heap.pool; }
/*
* This class supports the propagation of vec4 outputs from a
* vvp_net_t object.
*/
struct propagate_vector4_event_s : public event_s {
propagate_vector4_event_s(const vvp_vector4_t&that, unsigned adr, unsigned wid)
: val(that,adr,wid) { }
/* Propagate the output of this net. */
vvp_net_t*net;
/* value to propagate */
vvp_vector4_t val;
/* Action */
void run_run(void);
};
void propagate_vector4_event_s::run_run(void)
{
net->send_vec4(val, 0);
}
struct generic_event_s : public event_s {
vvp_gen_event_t obj;
bool delete_obj_when_done;
@ -595,6 +616,17 @@ void schedule_assign_plucked_vector(vvp_net_ptr_t ptr,
schedule_event_(cur, delay, SEQ_NBASSIGN);
}
void schedule_propagate_plucked_vector(vvp_net_t*net,
vvp_time64_t delay,
const vvp_vector4_t&src,
unsigned adr, unsigned wid)
{
struct propagate_vector4_event_s*cur
= new struct propagate_vector4_event_s(src,adr,wid);
cur->net = net;
schedule_event_(cur, delay, SEQ_NBASSIGN);
}
void schedule_assign_array_word(vvp_array_t mem,
unsigned word_addr,
unsigned off,

View File

@ -57,6 +57,15 @@ extern void schedule_assign_array_word(vvp_array_t mem,
unsigned off,
vvp_vector4_t val,
vvp_time64_t delay);
/*
* Create an event to propagate the output of a net.
*/
extern void schedule_propagate_plucked_vector(vvp_net_t*ptr,
vvp_time64_t delay,
const vvp_vector4_t&val,
unsigned adr, unsigned wid);
/*
* This is very similar to schedule_assign_vector, but generates an
* event in the active queue. It is used at link time to assign a

View File

@ -3289,7 +3289,7 @@ void vvp_wide_fun_core::propagate_vec4(const vvp_vector4_t&bit,
vvp_time64_t delay)
{
if (delay)
schedule_assign_plucked_vector(ptr_->peek_out(), delay, bit, 0, bit.size());
schedule_propagate_plucked_vector(ptr_, delay, bit, 0, bit.size());
else
ptr_->send_vec4(bit, 0);
}

View File

@ -973,7 +973,6 @@ class vvp_net_t {
vvp_net_ptr_t port[4];
vvp_net_fun_t*fun;
vvp_net_ptr_t peek_out() const { return out_; }
public:
// Connect the port to the output from this net.
void link(vvp_net_ptr_t port);