<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://www.verific.com/faq/index.php?action=history&amp;feed=atom&amp;title=Why_are_the_ports</id>
		<title>Why are the ports - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://www.verific.com/faq/index.php?action=history&amp;feed=atom&amp;title=Why_are_the_ports"/>
		<link rel="alternate" type="text/html" href="https://www.verific.com/faq/index.php?title=Why_are_the_ports&amp;action=history"/>
		<updated>2026-05-02T12:45:35Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.3</generator>

	<entry>
		<id>https://www.verific.com/faq/index.php?title=Why_are_the_ports&amp;diff=139&amp;oldid=prev</id>
		<title>74.95.193.145: Created page with &quot;'''Q: Why are the ports in original Verilog file renamed to p1, p2, ....?'''  Input file:     module foo ( datain[0],  datain[0] /* same net into multiple port expression */,...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.verific.com/faq/index.php?title=Why_are_the_ports&amp;diff=139&amp;oldid=prev"/>
				<updated>2016-07-09T00:15:04Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;Q: Why are the ports in original Verilog file renamed to p1, p2, ....?&amp;#039;&amp;#039;&amp;#039;  Input file:     module foo ( datain[0],  datain[0] ‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;same net into multiple port expression: &lt;/span&gt;,...&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''Q: Why are the ports in original Verilog file renamed to p1, p2, ....?'''&lt;br /&gt;
&lt;br /&gt;
Input file:&lt;br /&gt;
    module foo ( datain[0],  datain[0] /* same net into multiple port expression */,&lt;br /&gt;
                 datain[2:1]  /* part-select  port expression */,&lt;br /&gt;
                 /* empty port expression */,&lt;br /&gt;
                 {datain[2],datain[1], datain[1]} /* concatenation in port expression */&lt;br /&gt;
                ) ;&lt;br /&gt;
        input [2:0] datain ;&lt;br /&gt;
        ...&lt;br /&gt;
    endmodule&lt;br /&gt;
&lt;br /&gt;
Output netlist:&lt;br /&gt;
    module foo (p1, p2, p3, , p7);   // test.v(1[8:11])&lt;br /&gt;
        input p1;   // test.v(6[17:23])&lt;br /&gt;
        input p2;   // test.v(6[17:23])&lt;br /&gt;
        input [1:0]p3;&lt;br /&gt;
        input [2:0]p7;&lt;br /&gt;
        ...     &lt;br /&gt;
    endmodule&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The items in the () after the module name are not &amp;quot;port names,&amp;quot; rather, they are &amp;quot;port expressions.&amp;quot; Verilog defines that the port expressions on this module CANNOT be accessed by name (only by order). This means you cannot rely on the port names to be one thing or another. &lt;br /&gt;
&lt;br /&gt;
Verific chose to not adjust to any particular naming scheme for complex port expressions, which also allows us to error out if named port instantiation occurs where the language disallows it.&lt;br /&gt;
&lt;br /&gt;
The original port expression of the renamed port is saved as attributes &amp;quot; orig_port_name&amp;quot; attached to the port.&lt;br /&gt;
&lt;br /&gt;
    key: &amp;quot; orig_port_name&amp;quot;, value: port expression&lt;br /&gt;
&lt;br /&gt;
For the testcase above:&lt;br /&gt;
&lt;br /&gt;
    input p1 /* verific  orig_port_name=datain[0] */ ;&lt;br /&gt;
    input p2 /* verific  orig_port_name=datain[0] */ ;&lt;br /&gt;
    input [1:0]p3 /* verific  orig_port_name=datain[2] datain[1] */ ;&lt;br /&gt;
    input [2:0]p7 /* verific  orig_port_name=datain[2] datain[1] datain[1] */ ;&lt;/div&gt;</summary>
		<author><name>74.95.193.145</name></author>	</entry>

	</feed>