How to create new pin/port ?
Added by Mike Z almost 2 years ago
trying to add a connection from the top level down thru several levels.
So its a matter of walking down the hierarchy and - add a port to module "foo" - add the pin to its cell "bar"
I see the functions $cell->new_pin $module->new_port
but I am not sure how to create the pin/port data structures that I would pass to these functions?
And/or is there a bunch of example code I should be looking at, from which I could glean this info? (I'm very willing to try to teach myself)
thanks, Mike
Replies (2)
RE: How to create new pin/port ? - Added by Wilson Snyder almost 2 years ago
In the tar.gz file, see the t/44_create.t test. The arguments are the same as the accessor names specified under each Verilog::Netlist::{object} manpage.
my $moda = $nl->new_module (name=>'a', @fl);
{
my $x = $moda->new_port (name=>'x', @fl, direction=>'input', data_type=>'[2:0]',);
my $y = $moda->new_port (name=>'y', @fl, direction=>'output', data_type=>'[2:0]',);
my $b = $moda->new_cell (name=>'i_b', submodname=>'b', @fl);
{
$b->new_pin(name=>'z', portname=>'z', pinnamed=>1, netname=>'x', @fl);
$b->new_pin(name=>'w', portname=>'w', pinnamed=>1, netname=>'y', @fl);
}
}
RE: How to create new pin/port ? - Added by Mike Z almost 2 years ago
ah .. that makes total sense.. thanks!
(1-2/2)
![[logo]](/img/veripool_small.png)