browsing the model hierarchy with pli routines

M

mk

Guest
Hi,
I am working on a waveform dump tool using the pli library. The
minimal functionality works (ie I can dump wires, regs in the current
module) so now I have to deal with hierachical references. When I want
to dump all nodes hierarchically I am not sure how to browse the
hierarchy. I am trying to reduce the number of unique waveforms so I
am trying to detect duplicates. So for an input node which goes down,
I just want to add the top level waveform and then mark all nodes down
the hierarchy as duplicates of this one which suggests for top-down
browsing. For outputs I need to go all the way down where the initial
drivers are and then mark all the ones above as duplicates. Does this
make sense? Another issue is that for duplicates I don't want to call
acc_vcl_add either. Will this work? I can't seem to find any good
samples of doing multi-level hierarchical pli code.
I'd appreciate any comments.
 
mk wrote:
Hi,
....

For outputs I need to go all the way down where the initial
drivers are and then mark all the ones above as duplicates. Does this
make sense? Another issue is that for duplicates I don't want to call
acc_vcl_add either. Will this work?
sort of. Note that if there is a cross module reference based
assign/force along the path then the duplicates are not really
duplicates. if there are multiple drivers at multiple levels then the
notion of duplicates has to be considered carefully.

there is a pli call that might provide you with the notion of
duplicates you are looking for; if you take the handle of a net and
extract its simulated net then two nets that are "duplicates" will
produce the same simulated net. the level of "duplicates" analysis thru
this API is not defined by the LRM so it is up to the simulator as to
what level of alias analysis it provides.

Example:

simnet = acc_handle_simulated_net(net_handle);
simname = acc_fetch_fullname(simnet);

if two nets are "duplicates" then the corresponding simname should be
identical.

I can't seem to find any good
samples of doing multi-level hierarchical pli code.
I'd appreciate any comments.
Here is a rough sketch -

while(topmods = acc_next_topmod(topmods)) {
walk_tree(topmods);
}

void walk_tree(handle modinst) {

<do the work for net/reg in this inst>;

while(child = acc_next_child(modinst, child)) {
walk_tree(child);
}
}
 

Welcome to EDABoard.com

Sponsor

Back
Top