in reply to Problem with storing values
Looking at the source code, dump_drivers prints to STDOUT. So, to capture its output into a variable, you'd probably have to use select. But, I don't think that's worth it.
The reason you see 0 but true is because that is the return value of the last statement executed by sub dump_drivers:
flush STDOUT;
You should gather all the info you need for each pin as you descend through the Verilog module hierarchy.
UPDATE: Again, I don't recommend it, but to capture the STDOUT, you could do something like:
my $fh; my $out; my $old_stdout; open $fh, '>', \$out; $old_stdout = select $fh; my $x = $pin->net->dump_drivers(); select $old_stdout; close $fh; print $out; # This has the output you want
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem with storing values (Verilog::Netlist::Net)
by mavericknik (Sexton) on Apr 16, 2015 at 19:58 UTC | |
by toolic (Bishop) on Apr 16, 2015 at 20:21 UTC |