⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 port.pm

📁 Verilog Parser in Perl
💻 PM
字号:
# Verilog - Verilog Perl Interface# See copyright, etc in below POD section.######################################################################package Verilog::Netlist::Port;use Class::Struct;use Verilog::Netlist;use Verilog::Netlist::Subclass;use vars qw($VERSION @ISA);use strict;@ISA = qw(Verilog::Netlist::Port::Struct	Verilog::Netlist::Subclass);$VERSION = '3.120';structs('new',	'Verilog::Netlist::Port::Struct'	=>[name     	=> '$', #'	# Name of the port	   filename 	=> '$', #'	# Filename this came from	   lineno	=> '$', #'	# Linenumber this came from	   userdata	=> '%',		# User information	   attributes	=> '%', #'	# Misc attributes for systemperl or other processors	   #	   direction	=> '$', #'	# Direction (in/out/inout)	   type	 	=> '$', #'	# C++ Type (bool/int)	   comment	=> '$', #'	# Comment provided by user	   array	=> '$', #'	# Vectorization	   module	=> '$', #'	# Module entity belongs to	   # below only after links()	   net		=> '$', #'	# Net port connects	   # below only after autos()	   sp_autocreated	=> '$', #'	# Created by /*AUTOINOUT*/	   ]);sub delete {    my $self = shift;    my $h = $self->module->_ports;    delete $h->{$self->name};    return undef;}######################################################################sub netlist { return $_[0]->module->netlist; }sub _link {    my $self = shift;    if (!$self->net) {	my $net = $self->module->find_net ($self->name);	if (!$net) {	    $net = $self->module->new_net		(name=>$self->name,		 filename=>$self->filename, lineno=>$self->lineno,		 type=>$self->type, array=>$self->array,		 comment=>undef,		 );	    $net->attributes($self->attributes);  # Copy attributes across	}	if ($net && $net->port && $net->port != $self) {	    $self->error ("Port redeclares existing port: ",$self->name,"\n");	}	$self->net($net);	$self->net->port($self);	# A input to the module is actually a "source" or thus "out" of the net.	$self->net->_used_in_inc()    if ($self->direction() eq 'out');	$self->net->_used_out_inc()   if ($self->direction() eq 'in');	$self->net->_used_inout_inc() if ($self->direction() eq 'inout');    }}sub lint {}sub verilog_text {    my $self = shift;    return $self->name;}sub dump {    my $self = shift;    my $indent = shift||0;    print " "x$indent,"Port:",$self->name(),"  Dir:",$self->direction()	,"  Type:",$self->type(),"  Array:",$self->array()||"","\n";}########################################################################## Package return1;__END__=pod=head1 NAMEVerilog::Netlist::Port - Port for a Verilog Module=head1 SYNOPSIS  use Verilog::Netlist;  ...  my $port = $module->find_port ('pinname');  print $port->name;=head1 DESCRIPTIONA Verilog::Netlist::Port object is created by Verilog::Netlist::Module forevery port connection in the module.=head1 ACCESSORSSee also Verilog::Netlist::Subclass for additional accessors and methods.=over 4=item $self->arrayAny array declaration for the port.  This only applies to Verilog 1995style ports which can declare port bits independently from the signaldeclarations.  When using Verilog 2001 style ports, see the matching netdeclaration's lsb and msb methods instead, for exampleC<$module->find_net($port->name)->msb>.=item $self->commentReturns any comments following the definition.  keep_comments=>1 must bepassed to Verilog::Netlist::new for comments to be retained.=item $self->directionThe direction of the port: "in", "out", or "inout".=item $self->moduleReference to the Verilog::Netlist::Module the port is in.=item $self->nameThe name of the port.=item $self->netReference to the Verilog::Netlist::Net the port connects to.  Only validafter the netlist is linked.=item $self->typeThe C++ type of the port.=back=head1 MEMBER FUNCTIONSSee also Verilog::Netlist::Subclass for additional accessors and methods.=over 4=item $self->dumpPrints debugging information for this port.=back=head1 DISTRIBUTIONVerilog-Perl is part of the L<http://www.veripool.org/> free Verilog EDAsoftware tool suite.  The latest version is available from CPAN and fromL<http://www.veripool.org/verilog-perl>.Copyright 2000-2009 by Wilson Snyder.  This package is free software; youcan redistribute it and/or modify it under the terms of either the GNULesser General Public License or the Perl Artistic License.=head1 AUTHORSWilson Snyder <wsnyder@wsnyder.org>=head1 SEE ALSOL<Verilog-Perl>,L<Verilog::Netlist::Subclass>L<Verilog::Netlist>=cut

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -