<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://www.verific.com/faq/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Alice</id>
		<title>Verific Design Automation FAQ - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://www.verific.com/faq/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Alice"/>
		<link rel="alternate" type="text/html" href="https://www.verific.com/faq/index.php?title=Special:Contributions/Alice"/>
		<updated>2026-05-02T12:38:51Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.26.3</generator>

	<entry>
		<id>https://www.verific.com/faq/index.php?title=Main_Page&amp;diff=888</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://www.verific.com/faq/index.php?title=Main_Page&amp;diff=888"/>
				<updated>2024-02-28T05:25:55Z</updated>
		
		<summary type="html">&lt;p&gt;Alice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''General'''&lt;br /&gt;
* [[How to get best support from Verific | '''''How to get best support from Verific''''']]&lt;br /&gt;
* [[Source code customization &amp;amp; Stable release services | Source code customization &amp;amp; Stable release services]]&lt;br /&gt;
* [[How to save computer resources | How to save computer resources (memory consumption &amp;amp; runtime)]]&lt;br /&gt;
* [[Original RTL language | How do I know what language a Netlist in the netlist database comes from?]]&lt;br /&gt;
* [[Verific data structures | What are the data structures in Verific?]]&lt;br /&gt;
* [[Remove Verific data structures | How do I remove all Verific data structures in memory?]]&lt;br /&gt;
* [[Does Verific build CDFG? | Does Verific build control and data flow graph (CDFG)?]]&lt;br /&gt;
* [[Does Verific support XMR?| Does Verific support cross module references (XMR)?]]&lt;br /&gt;
* [[Compile-time/run-time flags | Are there options to control Verific software's behavior? Compile-time &amp;amp; run-time flags.]]&lt;br /&gt;
* [[Message handling | How do I downgrade/upgrade messages from Verific? How do I get messages with more details?]]&lt;br /&gt;
* [[Release version | How do I tell the version of a Verific software release? ]]&lt;br /&gt;
* [[Simulation models for Verific primitives | Where do I find simulation models for Verific primitives (VERIFIC_XOR, VERIFIC_DFFRS, ....)? ]]&lt;br /&gt;
* [[Tcl library path| How to correct building (linking) issue &amp;quot;/usr/bin/ld: cannot find -ltcl&amp;quot;]]&lt;br /&gt;
* [[LineFile data from input files | LineFile data from input files]]&lt;br /&gt;
* [[Difference between RTL and gate-level simulations - Flipflop with async set and async reset | Difference between RTL and gate-level simulations - Flipflop with async set and async reset]]&lt;br /&gt;
* [[Preserving user nets - preventing nets from being optimized away | Preserving user nets - preventing nets from being optimized away]]&lt;br /&gt;
* [[Python pretty-printer for gdb | Python pretty-printer for gdb]]&lt;br /&gt;
&lt;br /&gt;
'''Input: VHDL, Verilog (and SystemVerilog), Liberty, EDIF'''&lt;br /&gt;
* [[How to get all Verilog files being analyzed | Verilog: I'm using -v, -y, .... After Verific is done with the analysis, how do I get a list of all the files being analyzed?]]&lt;br /&gt;
* [[Included files associated with a Verilog source file | Verilog: How do I get the list of included files associated with a Verilog source file?]]&lt;br /&gt;
* [[How to get type/initial value of parameters | Verilog: How to get type/initial value of parameters.]]&lt;br /&gt;
* [[Verilog ports being renamed | Verilog: Port Expressions]]&lt;br /&gt;
* [[Design with System Verilog and Verilog 2001 files | Verilog: For a design consisting of a mixture of Verilog 2001 and SystemVerilog input files, should I parse all the files as SystemVerilog?]]&lt;br /&gt;
* [[How to get module ports from Verilog parsetree | Verilog: From the Verilog parsetree, how can I get the ports of a module?]]&lt;br /&gt;
* [[How to change name of id in Verilog parsetree | Verilog: How do I change the name of an id (VeriidDef) in Verilog parsetree?]]&lt;br /&gt;
* [[How to get library containing nested module | Verilog: How do I get nested modules and get the library that contains the nested module?]]&lt;br /&gt;
* [[How to get linefile information of macro definitions | Verilog: How do I get linefile information of macro definitions?]]&lt;br /&gt;
* [[How to find port dimensions | Verilog: How do I get port dimensions?]]&lt;br /&gt;
* [[Instance - Module binding order | Verilog: What is the order of binding modules to instances?]]&lt;br /&gt;
* [[How Verific elaborator handles blackboxes/unknown boxes | Verilog: How Verific elaborator handles blackboxes/unknown boxes]]&lt;br /&gt;
* [[Constant expression replacement | Verilog: Does Verific replace constant expressions with their respective values?]]&lt;br /&gt;
* [[Modules with '_1' '_2' suffix in their names | Verilog: After static elaboration, there are modules with &amp;quot;_1&amp;quot;, &amp;quot;_2&amp;quot;, ..., suffix in their names. Why?]]&lt;br /&gt;
* [[Defined macros become undefined - MFCU vs SFCU | SystemVerilog: Why does Verific complain about undefined macros for macros defined in a different file (Compilation Unit)?]]&lt;br /&gt;
* [[Notes on analysis | SystemVerilog: Notes on analysis]]&lt;br /&gt;
* [[How to get enums from Verilog parsetree | SystemVerilog: From the parsetree, how can I get the enums declared in a module?]]&lt;br /&gt;
* [[How to identify packages being imported into a module | SystemVerilog: How do I identify packages being imported into a module?]]&lt;br /&gt;
* [[SystemVerilog &amp;quot;std&amp;quot; package | SystemVerilog: Support for SystemVerilog semaphore/process/mailbox constructs.]]&lt;br /&gt;
* [[Top level module with interface ports | SystemVerilog: Support for SystemVerilog top level module with interface ports.]]&lt;br /&gt;
* [[Design with VHDL-1993 and VHDL-2008 files | VHDL: VHDL-1993 and VHDL-2008 each has its own IEEE library set. How do I analyze/elaborate a design with a mixture of files of different VHDL dialects (1993 and 2008)?]]&lt;br /&gt;
* [[Escaped identifiers in RTL files and in Verific data structures | Verilog/VHDL: Escaped identifiers in RTL files and in Verific data structures]]&lt;br /&gt;
* [[Prettyprint to a string | Verilog/VHDL: How to prettyprint a parsetree node to a string.]]&lt;br /&gt;
* [[Static elaboration | Verilog/VHDL: What does 'static elaboration' do?]]&lt;br /&gt;
* [[How to ignore a (not used) parameter/generic in elaboration. | Verilog/VHDL: How to ignore a (not used) parameter/generic in elaboration.]]&lt;br /&gt;
* [[What VeriModule* or VhdlPrimaryUnit* the Netlist comes from? | Verilog/VHDL: For a Netlist in the netlist database, is there a clean way to look back at what VeriModule* or VhdlPrimaryUnit* the Netlist was derived from?]]&lt;br /&gt;
* [[Cross-reference between the original RTL files and the elaborated netlist | Verilog/VHDL: Is there a way to cross-reference between the original RTL design files and the elaboration netlist?]]&lt;br /&gt;
* [[How to ignore parameters/generics in elaboration | Verilog/VHDL: Is there a way to tell the elaborator to ignore certain parameters/generics so that the unit/module is not uniquified?]]&lt;br /&gt;
* [[How to check for errors in analysis/elaboration | Verilog/VHDL: Is there a way to tell if the analysis/elaboration process has errors?]]&lt;br /&gt;
* [[Modules/design units with &amp;quot;_default&amp;quot; suffix in their names | Verilog/VHDL: After static elaboration, there are modules/design units/interfaces with &amp;quot;_default&amp;quot; suffix in their names. Why? And what are they?]]&lt;br /&gt;
* [[How to parse a string | Verilog/VHDL: How to parse a string - Example of adding a module to the parsetree]]&lt;br /&gt;
* [[Support IEEE 1735 encryption standard | Verilog/VHDL: Does Verific support IEEE 1735 encryption standard?]]&lt;br /&gt;
'''Netlist Database'''&lt;br /&gt;
* [[Logic optimization across hierarchy boundaries | Netlist Database: Does Verific perform logic optimization across hierarchy boundaries?]]&lt;br /&gt;
* [[Bit-blasting a multi-port RAM instance | Netlist Database: Bit-blasting a multi-port RAM instance]]&lt;br /&gt;
* [[System attributes | Netlist Database: System attributes]]&lt;br /&gt;
&lt;br /&gt;
'''Output'''&lt;br /&gt;
* [[Output file formats | What language formats does Verific support as output?]]&lt;br /&gt;
&lt;br /&gt;
'''Scripting languages: TCL, Perl, Python'''&lt;br /&gt;
* [[What languages can I use with Verific software? | What programming languages can I use with Verific software?]]&lt;br /&gt;
&lt;br /&gt;
'''Code examples'''&lt;br /&gt;
* [[How to use RegisterCallBackMsg() | Util/C++: How to use RegisterCallBackMsg()]]&lt;br /&gt;
* [[How to use MessageCallBackHandler Class | Util/C++: How to use MessageCallBackHandler Class]]&lt;br /&gt;
* [[How to use RegisterPragmaRefCallBack() | Util/C++: How to use RegisterPragmaRefCallBack()]]&lt;br /&gt;
* [[Write out an encrypted netlist | Database/C++: Write out an encrypted netlist]]&lt;br /&gt;
* [[Extract clock enable | Database/C++: Extract clock enable]]&lt;br /&gt;
* [[Black box, empty box, and unknown box | Database/C++: Black box, empty box, and unknown box]]&lt;br /&gt;
* [[Post processing port resolution of black boxes | Database/C++: Post processing port resolution of black boxes]]&lt;br /&gt;
* [[Finding hierarchical paths of a Netlist | Database/C++: Finding hierarchical paths of a Netlist]]&lt;br /&gt;
* [[Replacing Verific built-in primitives/operators with user implementations | Database/C++: Replacing Verific built-in primitives/operators with user implementations]]&lt;br /&gt;
* [[Hierarchy tree RTL elaboration | Database/Perl: Simple example of hierarchy tree elaboration]]&lt;br /&gt;
* [[Create a Netlist Database from scratch (not from RTL elaboration) | Database/Perl/TCL: Create a Netlist Database from scratch (not from RTL elaboration)]]&lt;br /&gt;
* [[Buffering signals and ungrouping | Database/Verilog: Buffering signals and ungrouping (flattening) in the Netlist Database]]&lt;br /&gt;
* [[Memory elements of a RamNet | Database/Verilog/C++: Memory elements of a RamNet]]&lt;br /&gt;
* [[Process -f file and explore the Netlist Database (C++)| Database/Verilog/C++: Process -f file and explore the Netlist Database]]&lt;br /&gt;
* [[Process -f file and explore the Netlist Database (py)| Database/Verilog/Python: Process -f file and explore the Netlist Database]]&lt;br /&gt;
* [[Fanout cone and grouping | Database/Verilog/Perl: Fanout cone and grouping in the Netlist Database]]&lt;br /&gt;
* [[Simple example of visitor pattern | Verilog/C++: Simple examples of visitor pattern]]&lt;br /&gt;
* [[Statically elaborate with different values of parameters | Verilog/C++: Statically elaborate with different values of parameters]]&lt;br /&gt;
* [[Prettyprint all modules in the design hierarchy | Verilog/C++: Prettyprint all modules in the design hierarchy]]&lt;br /&gt;
* [[Getting instances' parameters | Verilog/C++: Getting instances' parameters]]&lt;br /&gt;
* [[Accessing and evaluating module's parameters | Verilog/C++: Accessing and evaluating module's parameters]]&lt;br /&gt;
* [[Visiting Hierarchical References (VeriSelectedName) | Verilog/C++: Visiting Hierarchical References (VeriSelectedName)]]&lt;br /&gt;
* [[Type Range example | Verilog/C++: Type Range example  (simple)]]&lt;br /&gt;
* [[Using stream input to ignore input file | Verilog/C++: Using stream input to ignore input file]]&lt;br /&gt;
* [[How to ignore certain modules while analyzing input RTL files | Verilog/C++: How to ignore certain modules while analyzing input RTL files]]&lt;br /&gt;
* [[How to tell if a module has encrypted contents | Verilog/C++: How to tell if a module has encrypted contents]]&lt;br /&gt;
* [[Comment out a line using text based design modification and parsetree modification | Verilog/C++: Comment out a line using text-based design modification and parsetree modification]] &lt;br /&gt;
* [[Verilog/C++: How to use IsUserDeclared() : Example for port associations]]&lt;br /&gt;
* [[How to create new module in Verilog parsetree | Verilog/C++: How to create new module in Verilog parsetree]]&lt;br /&gt;
* [[In Verilog parsetree adding names to unnamed instances | Verilog/C++: In Verilog parsetree adding names to unnamed instances]]&lt;br /&gt;
* [[How to get full hierarchy ID path | Verilog/C++: How to get full hierarchy ID path]]&lt;br /&gt;
* [[How to traverse scope hierarchy | Verilog/C++: How to traverse scope hierarchy]]&lt;br /&gt;
* [[Access attributes in parsetree | Verilog/C++: How to access attributes in parsetree]]&lt;br /&gt;
* [[How to detect multiple-clock-edge condition in Verilog parsetree | Verilog/C++: How to detect multiple-clock-edge condition in Verilog parsetree]]&lt;br /&gt;
* [[How to get driving net of an instance | Verilog/C++: How to get driving net of an instance]]&lt;br /&gt;
* [[Parse select modules only and ignore the rest | Verilog/C++: Parse select modules only and ignore the rest]]&lt;br /&gt;
* [[Create DOT diagram of parse tree | Verilog/C++: Create DOT diagram of a parse tree]]&lt;br /&gt;
* [[Type Range example with multi-dimensional arrays| Verilog/C++/Perl: Type Range example with multi-dimensional arrays]]&lt;br /&gt;
* [[How to get linefile data of macros - Macro callback function | Verilog/C++/Perl/Python: How to get linefile data of macros - Macro callback function]]&lt;br /&gt;
* [[Where in RTL does it get assigned? | Verilog/C++/Perl/Python: Where in RTL does it get assigned?]]&lt;br /&gt;
* [[Access attributes of ports in parsetree | Verilog/Perl: Access attributes of ports in parsetree and from netlist]]&lt;br /&gt;
* [[Evaluate 'for-generate' loop | Verilog/C++: Evaluate 'for-generate' loop]]&lt;br /&gt;
* [[Retrieve package name for user-defined variable types | SystemVerilog/C++/Python: Retrieve package name for user-defined variable types]]&lt;br /&gt;
* [[Pretty-print a module and the packages imported by the module | SystemVerilog/C++: Pretty-print a module and the packages imported by the module]]&lt;br /&gt;
* [[How to get packed dimensions of enum | SystemVerilog/C++: How to get packed dimensions of enum]]&lt;br /&gt;
* [[Simple examples of VHDL visitor pattern | VHDL/C++: Simple examples of VHDL visitor pattern]]&lt;br /&gt;
* [[Traverse instances in parsetree | VHDL/C++: Traverse instances in parsetree]]&lt;br /&gt;
* [[Parsing from data in memory | Verilog/VHDL/C++: Parsing from data in memory]]&lt;/div&gt;</summary>
		<author><name>Alice</name></author>	</entry>

	<entry>
		<id>https://www.verific.com/faq/index.php?title=Post_processing_port_resolution_of_black_boxes&amp;diff=887</id>
		<title>Post processing port resolution of black boxes</title>
		<link rel="alternate" type="text/html" href="https://www.verific.com/faq/index.php?title=Post_processing_port_resolution_of_black_boxes&amp;diff=887"/>
				<updated>2024-02-20T00:44:21Z</updated>
		
		<summary type="html">&lt;p&gt;Alice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;C++ example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
#include &amp;quot;Map.h&amp;quot;            &lt;br /&gt;
#include &amp;quot;Message.h&amp;quot;        &lt;br /&gt;
#include &amp;quot;veri_file.h&amp;quot;      &lt;br /&gt;
#include &amp;quot;DataBase.h&amp;quot;       &lt;br /&gt;
#include &amp;quot;VeriWrite.h&amp;quot;&lt;br /&gt;
#include &amp;quot;RuntimeFlags.h&amp;quot;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#ifdef VERIFIC_NAMESPACE&lt;br /&gt;
using namespace Verific ;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char **argv)&lt;br /&gt;
{&lt;br /&gt;
    if (argc &amp;lt; 2) {&lt;br /&gt;
        Message::PrintLine(&amp;quot;Default input file: test.v. Specify command line argument to override&amp;quot;) ;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    const char *file_name = 0 ;&lt;br /&gt;
&lt;br /&gt;
    if (argc&amp;gt;1) {&lt;br /&gt;
        file_name = argv[1] ; // Set the file name as specified by the user&lt;br /&gt;
    } else {&lt;br /&gt;
        file_name = &amp;quot;test.v&amp;quot; ;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (!veri_file::Analyze(file_name, veri_file::SYSTEM_VERILOG)) return 1 ;&lt;br /&gt;
    if (!veri_file::ElaborateAll()) return 1 ;&lt;br /&gt;
&lt;br /&gt;
    Netlist *top = Netlist::PresentDesign() ;&lt;br /&gt;
&lt;br /&gt;
    VeriWrite vw ;&lt;br /&gt;
    RuntimeFlags::SetVar(&amp;quot;db_verilog_writer_write_blackboxes&amp;quot;, 2) ;&lt;br /&gt;
    vw.WriteFile (&amp;quot;netlist_before.v&amp;quot;, top) ;&lt;br /&gt;
&lt;br /&gt;
    // Lets accumulate all netlist&lt;br /&gt;
    Set netlists(POINTER_HASH) ;&lt;br /&gt;
    top-&amp;gt;Hierarchy(netlists, 0 /* bottom to top */) ;&lt;br /&gt;
&lt;br /&gt;
    Netlist *netlist ;&lt;br /&gt;
    SetIter si ;&lt;br /&gt;
&lt;br /&gt;
    unsigned changed = 0 ;&lt;br /&gt;
    unsigned pass = 1 ;&lt;br /&gt;
    do { // do this until there are no changes in port directions of 'unknown' modules&lt;br /&gt;
        std::cout &amp;lt;&amp;lt; std::endl &amp;lt;&amp;lt; &amp;quot;=&amp;gt; Pass &amp;quot; &amp;lt;&amp;lt;  pass++ &amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
        changed = 0 ;&lt;br /&gt;
        FOREACH_SET_ITEM(&amp;amp;netlists, si, &amp;amp;netlist) {&lt;br /&gt;
            if (!netlist-&amp;gt;GetAtt(&amp;quot; unknown_design&amp;quot;)) continue ; // Skip if not 'unknown'&lt;br /&gt;
            Instance *instance ;&lt;br /&gt;
            SetIter si2 ;&lt;br /&gt;
            // Iterate over all references (Instances) of this Netlist&lt;br /&gt;
            FOREACH_REFERENCE_OF_NETLIST(netlist, si2, instance) {&lt;br /&gt;
                std::cout &amp;lt;&amp;lt; &amp;quot;===&amp;gt; Instance '&amp;quot; &amp;lt;&amp;lt;  instance-&amp;gt;Name() &amp;lt;&amp;lt; &amp;quot;' of unknown module '&amp;quot;&lt;br /&gt;
                          &amp;lt;&amp;lt; netlist-&amp;gt;Owner()-&amp;gt;Name() &amp;lt;&amp;lt; &amp;quot;'&amp;quot;&amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
                MapIter mi2 ;&lt;br /&gt;
                PortRef *portref ;&lt;br /&gt;
                FOREACH_PORTREF_OF_INST(instance, mi2, portref) {&lt;br /&gt;
                    Port *port = portref-&amp;gt;GetPort() ;&lt;br /&gt;
                    if (!port-&amp;gt;IsInout()) continue ; // Only look at inout ports&lt;br /&gt;
                    unsigned dir_known = 0 ;&lt;br /&gt;
                    std::cout &amp;lt;&amp;lt; &amp;quot;===&amp;gt;     Port: '&amp;quot; &amp;lt;&amp;lt; port-&amp;gt;Name() &amp;lt;&amp;lt; &amp;quot;'&amp;quot;&amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
                    Net *net = portref-&amp;gt;GetNet() ;&lt;br /&gt;
                    if (!net) {&lt;br /&gt;
                        std::cout &amp;lt;&amp;lt; &amp;quot;===&amp;gt;     Does not connect to any Net&amp;quot; &amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
                        continue ;&lt;br /&gt;
                    }&lt;br /&gt;
                    // Is this port connected to any Port?&lt;br /&gt;
                    Port *port2 ;&lt;br /&gt;
                    SetIter si ;&lt;br /&gt;
                    FOREACH_PORT_OF_NET(net, si, port2) {&lt;br /&gt;
                        if (port2-&amp;gt;IsInput()) {&lt;br /&gt;
                            std::cout &amp;lt;&amp;lt; &amp;quot;===&amp;gt;         Connected to input port '&amp;quot; &amp;lt;&amp;lt; port2-&amp;gt;Name() &amp;lt;&amp;lt; &amp;quot;' of owning Netlist&amp;quot; &amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
                            std::cout &amp;lt;&amp;lt; &amp;quot;===&amp;gt;             Set port '&amp;quot; &amp;lt;&amp;lt; port-&amp;gt;Name() &amp;lt;&amp;lt; &amp;quot;' to input&amp;quot; &amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
                            netlist-&amp;gt;GetPort(port-&amp;gt;Name())-&amp;gt;SetDir(DIR_IN) ;&lt;br /&gt;
                            dir_known = 1 ;&lt;br /&gt;
                            changed = 1 ;&lt;br /&gt;
                        } else if (port2-&amp;gt;IsOutput()) {&lt;br /&gt;
                            if (net-&amp;gt;NumOfPortRefs() == 1 ) { // does not connected to any other instance&lt;br /&gt;
                                std::cout &amp;lt;&amp;lt; &amp;quot;===&amp;gt;         Only connected to output port '&amp;quot; &amp;lt;&amp;lt; port2-&amp;gt;Name() &amp;lt;&amp;lt; &amp;quot;' of owning Netlist&amp;quot; &amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
                                std::cout &amp;lt;&amp;lt; &amp;quot;===&amp;gt;             Set port '&amp;quot; &amp;lt;&amp;lt; port-&amp;gt;Name() &amp;lt;&amp;lt; &amp;quot;' to output&amp;quot; &amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
                                netlist-&amp;gt;GetPort(port-&amp;gt;Name())-&amp;gt;SetDir(DIR_OUT) ;&lt;br /&gt;
                                dir_known = 1 ;&lt;br /&gt;
                                changed = 1 ;&lt;br /&gt;
                            }&lt;br /&gt;
                        }&lt;br /&gt;
                    }&lt;br /&gt;
                    // If still don't know direction, check other connections&lt;br /&gt;
                    if (!dir_known) {&lt;br /&gt;
                        PortRef *portref2 ;&lt;br /&gt;
                        SetIter si2 ;&lt;br /&gt;
                        FOREACH_PORTREF_OF_NET(net, si2, portref2) {&lt;br /&gt;
                            if (portref2 == portref) continue ; // not checking self&lt;br /&gt;
                            if (portref2-&amp;gt;IsOutput()) { // connected to an output portref, must be an input port&lt;br /&gt;
                                Instance *instance2 = portref2-&amp;gt;GetInst() ;&lt;br /&gt;
                                Port *port3 = portref2-&amp;gt;GetPort() ;&lt;br /&gt;
                                std::cout &amp;lt;&amp;lt; &amp;quot;===&amp;gt;         Connected to output port '&amp;quot; &amp;lt;&amp;lt; port3-&amp;gt;Name()&lt;br /&gt;
                                          &amp;lt;&amp;lt; &amp;quot;' of instance ' &amp;quot; &amp;lt;&amp;lt; instance2-&amp;gt;Name() &amp;lt;&amp;lt; &amp;quot;'&amp;quot; &amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
                                std::cout &amp;lt;&amp;lt; &amp;quot;===&amp;gt;             Set port '&amp;quot; &amp;lt;&amp;lt; port-&amp;gt;Name() &amp;lt;&amp;lt; &amp;quot;' to input&amp;quot; &amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
                                netlist-&amp;gt;GetPort(port-&amp;gt;Name())-&amp;gt;SetDir(DIR_IN) ;&lt;br /&gt;
                                dir_known = 1 ;&lt;br /&gt;
                                changed = 1 ;&lt;br /&gt;
                                break ;&lt;br /&gt;
                            } else if (portref2-&amp;gt;IsInout()) { // connected to an inout portref, still don't know direction&lt;br /&gt;
                                break ;&lt;br /&gt;
                            } else { // all portrefs are inputs, must be an output port&lt;br /&gt;
                                std::cout &amp;lt;&amp;lt; &amp;quot;===&amp;gt;             All other PortRefs are inputs&amp;quot; &amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
                                std::cout &amp;lt;&amp;lt; &amp;quot;===&amp;gt;             Set port '&amp;quot; &amp;lt;&amp;lt; port-&amp;gt;Name() &amp;lt;&amp;lt; &amp;quot;' to output&amp;quot; &amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
                                netlist-&amp;gt;GetPort(port-&amp;gt;Name())-&amp;gt;SetDir(DIR_OUT) ;&lt;br /&gt;
                                dir_known = 1 ;&lt;br /&gt;
                                changed = 1 ;&lt;br /&gt;
                            }&lt;br /&gt;
                        }&lt;br /&gt;
                    }&lt;br /&gt;
                    if (!dir_known) { // Still clueless&lt;br /&gt;
                        std::cout &amp;lt;&amp;lt; &amp;quot;===&amp;gt;         Not enough data, remains inout&amp;quot; &amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    } while (changed) ;&lt;br /&gt;
&lt;br /&gt;
    vw.WriteFile (&amp;quot;netlist_after.v&amp;quot;, top) ;&lt;br /&gt;
&lt;br /&gt;
    return 0 ;&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
-- Default input file: test.v. Specify command line argument to override&lt;br /&gt;
-- Analyzing Verilog file 'test.v' (VERI-1482)&lt;br /&gt;
test.v(1): INFO: compiling module 'top' (VERI-1018)&lt;br /&gt;
test.v(11): INFO: compiling module 'known1' (VERI-1018)&lt;br /&gt;
test.v(14): INFO: compiling module 'known2' (VERI-1018)&lt;br /&gt;
test.v(5): WARNING: instantiating unknown module 'unknown1' (VERI-1063)&lt;br /&gt;
test.v(6): WARNING: instantiating unknown module 'unknown2' (VERI-1063)&lt;br /&gt;
-- Writing netlist 'top' to Verilog file 'netlist_before.v' (VDB-1030)&lt;br /&gt;
&lt;br /&gt;
=&amp;gt; Pass 1&lt;br /&gt;
===&amp;gt; Instance 'iu1' of unknown module 'unknown1'&lt;br /&gt;
===&amp;gt;     Port: 'p1'&lt;br /&gt;
===&amp;gt;         Connected to output port 'o' of instance ' ik1'&lt;br /&gt;
===&amp;gt;             Set port 'p1' to input&lt;br /&gt;
===&amp;gt;     Port: 'p2'&lt;br /&gt;
===&amp;gt;         Connected to input port 'i2' of owning Netlist&lt;br /&gt;
===&amp;gt;             Set port 'p2' to input&lt;br /&gt;
===&amp;gt;     Port: 'p3'&lt;br /&gt;
===&amp;gt;         Not enough data, remains inout&lt;br /&gt;
===&amp;gt;     Port: 'p4'&lt;br /&gt;
===&amp;gt;             All other PortRefs are inputs&lt;br /&gt;
===&amp;gt;             Set port 'p4' to output&lt;br /&gt;
===&amp;gt;     Port: 'p5'&lt;br /&gt;
===&amp;gt;         Only connected to output port 'o3' of owning Netlist&lt;br /&gt;
===&amp;gt;             Set port 'p5' to output&lt;br /&gt;
===&amp;gt;     Port: 'p6'&lt;br /&gt;
===&amp;gt;         Not enough data, remains inout&lt;br /&gt;
===&amp;gt;     Port: 'p7'&lt;br /&gt;
===&amp;gt;         Not enough data, remains inout&lt;br /&gt;
===&amp;gt; Instance 'iu2a' of unknown module 'unknown2'&lt;br /&gt;
===&amp;gt;     Port: 'p1'&lt;br /&gt;
===&amp;gt;         Not enough data, remains inout&lt;br /&gt;
===&amp;gt;     Port: 'p2'&lt;br /&gt;
===&amp;gt;         Not enough data, remains inout&lt;br /&gt;
===&amp;gt;     Port: 'p3'&lt;br /&gt;
===&amp;gt;         Connected to input port 'i3' of owning Netlist&lt;br /&gt;
===&amp;gt;             Set port 'p3' to input&lt;br /&gt;
===&amp;gt; Instance 'iu2b' of unknown module 'unknown2'&lt;br /&gt;
===&amp;gt;     Port: 'p1'&lt;br /&gt;
===&amp;gt;         Connected to input port 'i1' of owning Netlist&lt;br /&gt;
===&amp;gt;             Set port 'p1' to input&lt;br /&gt;
===&amp;gt;     Port: 'p2'&lt;br /&gt;
===&amp;gt;         Not enough data, remains inout&lt;br /&gt;
===&amp;gt; Instance 'iu2c' of unknown module 'unknown2'&lt;br /&gt;
===&amp;gt;     Port: 'p2'&lt;br /&gt;
===&amp;gt;         Only connected to output port 'o4' of owning Netlist&lt;br /&gt;
===&amp;gt;             Set port 'p2' to output&lt;br /&gt;
&lt;br /&gt;
=&amp;gt; Pass 2&lt;br /&gt;
===&amp;gt; Instance 'iu1' of unknown module 'unknown1'&lt;br /&gt;
===&amp;gt;     Port: 'p3'&lt;br /&gt;
===&amp;gt;         Connected to output port 'p2' of instance ' iu2a'&lt;br /&gt;
===&amp;gt;             Set port 'p3' to input&lt;br /&gt;
===&amp;gt;     Port: 'p6'&lt;br /&gt;
===&amp;gt;             All other PortRefs are inputs&lt;br /&gt;
===&amp;gt;             Set port 'p6' to output&lt;br /&gt;
===&amp;gt;     Port: 'p7'&lt;br /&gt;
===&amp;gt;         Not enough data, remains inout&lt;br /&gt;
===&amp;gt; Instance 'iu2a' of unknown module 'unknown2'&lt;br /&gt;
===&amp;gt; Instance 'iu2b' of unknown module 'unknown2'&lt;br /&gt;
===&amp;gt; Instance 'iu2c' of unknown module 'unknown2'&lt;br /&gt;
&lt;br /&gt;
=&amp;gt; Pass 3&lt;br /&gt;
===&amp;gt; Instance 'iu1' of unknown module 'unknown1'&lt;br /&gt;
===&amp;gt;     Port: 'p7'&lt;br /&gt;
===&amp;gt;         Not enough data, remains inout&lt;br /&gt;
===&amp;gt; Instance 'iu2a' of unknown module 'unknown2'&lt;br /&gt;
===&amp;gt; Instance 'iu2b' of unknown module 'unknown2'&lt;br /&gt;
===&amp;gt; Instance 'iu2c' of unknown module 'unknown2'&lt;br /&gt;
-- Writing netlist 'top' to Verilog file 'netlist_after.v' (VDB-1030)&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
netlist_before.v&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
module top (i1, i2, i3, o1, o2, o3, o4) ;   // test.v(1)&lt;br /&gt;
    input i1;   // test.v(1)&lt;br /&gt;
    input i2;   // test.v(1)&lt;br /&gt;
    input i3;   // test.v(1)&lt;br /&gt;
    output o1;   // test.v(1)&lt;br /&gt;
    output o2;   // test.v(1)&lt;br /&gt;
    output o3;   // test.v(1)&lt;br /&gt;
    output o4;   // test.v(1)&lt;br /&gt;
    &lt;br /&gt;
    wire t1;   // test.v(2)&lt;br /&gt;
    wire t2;   // test.v(2)&lt;br /&gt;
    wire t3;   // test.v(2)&lt;br /&gt;
    wire t4;   // test.v(2)&lt;br /&gt;
    wire t5;   // test.v(2)&lt;br /&gt;
    wire t6;   // test.v(2)&lt;br /&gt;
    &lt;br /&gt;
    known1 ik1 (.i1(i3), .i2(t2), .o(t3));   // test.v(3)&lt;br /&gt;
    known2 ik2 (.i1(i1), .i2(t1), .o(o2));   // test.v(4)&lt;br /&gt;
    unknown1 iu1 (.p1(t3), .p2(i2), .p3(t2), .p4(t1), .p5(o3), .p6(t4), &lt;br /&gt;
            .p7(t5));   // test.v(5)&lt;br /&gt;
    unknown2 iu2a (.p1(t4), .p2(t2), .p3(i3));   // test.v(6)&lt;br /&gt;
    unknown2 iu2b (.p1(i1), .p2(t2), .p3(i3));   // test.v(7)&lt;br /&gt;
    unknown2 iu2c (.p1(t6), .p2(o4), .p3(i3));   // test.v(8)&lt;br /&gt;
    &lt;br /&gt;
endmodule&lt;br /&gt;
&lt;br /&gt;
module known1 (i1, i2, o) ;   // test.v(11)&lt;br /&gt;
    input i1;   // test.v(11)&lt;br /&gt;
    input i2;   // test.v(11)&lt;br /&gt;
    output o;   // test.v(11)   &lt;br /&gt;
endmodule&lt;br /&gt;
&lt;br /&gt;
module known2 (i1, i2, o) ;   // test.v(14)&lt;br /&gt;
    input i1;   // test.v(14)&lt;br /&gt;
    input i2;   // test.v(14)&lt;br /&gt;
    output o;   // test.v(14)    &lt;br /&gt;
endmodule&lt;br /&gt;
&lt;br /&gt;
module unknown1 (p1, p2, p3, p4, p5, p6, p7) ;&lt;br /&gt;
    inout p1;&lt;br /&gt;
    inout p2;&lt;br /&gt;
    inout p3;&lt;br /&gt;
    inout p4;&lt;br /&gt;
    inout p5;&lt;br /&gt;
    inout p6;&lt;br /&gt;
    inout p7;&lt;br /&gt;
endmodule&lt;br /&gt;
&lt;br /&gt;
module unknown2 (p1, p2, p3) ;&lt;br /&gt;
    inout p1;&lt;br /&gt;
    inout p2;&lt;br /&gt;
    inout p3;&lt;br /&gt;
endmodule&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
netlist_after.v&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
module top (i1, i2, i3, o1, o2, o3, o4) ;   // test.v(1)&lt;br /&gt;
    input i1;   // test.v(1)&lt;br /&gt;
    input i2;   // test.v(1)&lt;br /&gt;
    input i3;   // test.v(1)&lt;br /&gt;
    output o1;   // test.v(1)&lt;br /&gt;
    output o2;   // test.v(1)&lt;br /&gt;
    output o3;   // test.v(1)&lt;br /&gt;
    output o4;   // test.v(1)&lt;br /&gt;
    &lt;br /&gt;
    wire t1;   // test.v(2)&lt;br /&gt;
    wire t2;   // test.v(2)&lt;br /&gt;
    wire t3;   // test.v(2)&lt;br /&gt;
    wire t4;   // test.v(2)&lt;br /&gt;
    wire t5;   // test.v(2)&lt;br /&gt;
    wire t6;   // test.v(2)&lt;br /&gt;
    &lt;br /&gt;
    known1 ik1 (.i1(i3), .i2(t2), .o(t3));   // test.v(3)&lt;br /&gt;
    known2 ik2 (.i1(i1), .i2(t1), .o(o2));   // test.v(4)&lt;br /&gt;
    unknown1 iu1 (.p1(t3), .p2(i2), .p3(t2), .p4(t1), .p5(o3), .p6(t4), &lt;br /&gt;
            .p7(t5));   // test.v(5)&lt;br /&gt;
    unknown2 iu2a (.p1(t4), .p2(t2), .p3(i3));   // test.v(6)&lt;br /&gt;
    unknown2 iu2b (.p1(i1), .p2(t2), .p3(i3));   // test.v(7)&lt;br /&gt;
    unknown2 iu2c (.p1(t6), .p2(o4), .p3(i3));   // test.v(8)&lt;br /&gt;
    &lt;br /&gt;
endmodule&lt;br /&gt;
&lt;br /&gt;
module known1 (i1, i2, o) ;   // test.v(11)&lt;br /&gt;
    input i1;   // test.v(11)&lt;br /&gt;
    input i2;   // test.v(11)&lt;br /&gt;
    output o;   // test.v(11)  &lt;br /&gt;
endmodule&lt;br /&gt;
&lt;br /&gt;
module known2 (i1, i2, o) ;   // test.v(14)&lt;br /&gt;
    input i1;   // test.v(14)&lt;br /&gt;
    input i2;   // test.v(14)&lt;br /&gt;
    output o;   // test.v(14)&lt;br /&gt;
endmodule&lt;br /&gt;
&lt;br /&gt;
module unknown1 (p1, p2, p3, p4, p5, p6, p7) ;&lt;br /&gt;
    input p1;&lt;br /&gt;
    input p2;&lt;br /&gt;
    input p3;&lt;br /&gt;
    output p4;&lt;br /&gt;
    output p5;&lt;br /&gt;
    output p6;&lt;br /&gt;
    inout p7;&lt;br /&gt;
endmodule&lt;br /&gt;
&lt;br /&gt;
module unknown2 (p1, p2, p3) ;&lt;br /&gt;
    input p1;&lt;br /&gt;
    output p2;&lt;br /&gt;
    input p3;&lt;br /&gt;
endmodule&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
test.v&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
module top (input i1, i2, i3, output o1, o2, o3, o4);&lt;br /&gt;
    wire t1, t2, t3, t4, t5, t6;&lt;br /&gt;
    known1 ik1 (.i1(i3), .i2(t2), .o(t3));&lt;br /&gt;
    known2 ik2 (.i1(i1), .i2(t1), .o(o2));&lt;br /&gt;
    unknown1 iu1 (.p1(t3), .p2(i2), .p3(t2), .p4(t1), .p5(o3), .p6(t4), .p7(t5));&lt;br /&gt;
    unknown2 iu2a (.p1(t4), .p2(t2), .p3(i3));&lt;br /&gt;
    unknown2 iu2b (.p1(i1), .p2(t2), .p3(i3));&lt;br /&gt;
    unknown2 iu2c (.p1(t6), .p2(o4), .p3(i3));&lt;br /&gt;
endmodule&lt;br /&gt;
&lt;br /&gt;
module known1 (input i1, i2, output o);&lt;br /&gt;
endmodule&lt;br /&gt;
&lt;br /&gt;
module known2 (input i1, i2, output o);&lt;br /&gt;
endmodule&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Alice</name></author>	</entry>

	<entry>
		<id>https://www.verific.com/faq/index.php?title=Main_Page&amp;diff=886</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://www.verific.com/faq/index.php?title=Main_Page&amp;diff=886"/>
				<updated>2024-02-18T03:59:13Z</updated>
		
		<summary type="html">&lt;p&gt;Alice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''General'''&lt;br /&gt;
* [[How to get best support from Verific | '''''How to get best support from Verific''''']]&lt;br /&gt;
* [[Source code customization &amp;amp; Stable release services | Source code customization &amp;amp; Stable release services]]&lt;br /&gt;
* [[How to save computer resources | How to save computer resources (memory consumption &amp;amp; runtime)]]&lt;br /&gt;
* [[Original RTL language | How do I know what language a Netlist in the netlist database comes from?]]&lt;br /&gt;
* [[Verific data structures | What are the data structures in Verific?]]&lt;br /&gt;
* [[Remove Verific data structures | How do I remove all Verific data structures in memory?]]&lt;br /&gt;
* [[Does Verific build CDFG? | Does Verific build control and data flow graph (CDFG)?]]&lt;br /&gt;
* [[Does Verific support XMR?| Does Verific support cross module references (XMR)?]]&lt;br /&gt;
* [[Compile-time/run-time flags | Are there options to control Verific software's behavior? Compile-time &amp;amp; run-time flags.]]&lt;br /&gt;
* [[Message handling | How do I downgrade/upgrade messages from Verific? How do I get messages with more details?]]&lt;br /&gt;
* [[Release version | How do I tell the version of a Verific software release? ]]&lt;br /&gt;
* [[Simulation models for Verific primitives | Where do I find simulation models for Verific primitives (VERIFIC_XOR, VERIFIC_DFFRS, ....)? ]]&lt;br /&gt;
* [[Tcl library path| How to correct building (linking) issue &amp;quot;/usr/bin/ld: cannot find -ltcl&amp;quot;]]&lt;br /&gt;
* [[LineFile data from input files | LineFile data from input files]]&lt;br /&gt;
* [[Difference between RTL and gate-level simulations - Flipflop with async set and async reset | Difference between RTL and gate-level simulations - Flipflop with async set and async reset]]&lt;br /&gt;
* [[Preserving user nets - preventing nets from being optimized away | Preserving user nets - preventing nets from being optimized away]]&lt;br /&gt;
* [[Python pretty-printer for gdb | Python pretty-printer for gdb]]&lt;br /&gt;
&lt;br /&gt;
'''Input: VHDL, Verilog (and SystemVerilog), Liberty, EDIF'''&lt;br /&gt;
* [[How to get all Verilog files being analyzed | Verilog: I'm using -v, -y, .... After Verific is done with the analysis, how do I get a list of all the files being analyzed?]]&lt;br /&gt;
* [[Included files associated with a Verilog source file | Verilog: How do I get the list of included files associated with a Verilog source file?]]&lt;br /&gt;
* [[How to get type/initial value of parameters | Verilog: How to get type/initial value of parameters.]]&lt;br /&gt;
* [[Verilog ports being renamed | Verilog: Port Expressions]]&lt;br /&gt;
* [[Design with System Verilog and Verilog 2001 files | Verilog: For a design consisting of a mixture of Verilog 2001 and SystemVerilog input files, should I parse all the files as SystemVerilog?]]&lt;br /&gt;
* [[How to get module ports from Verilog parsetree | Verilog: From the Verilog parsetree, how can I get the ports of a module?]]&lt;br /&gt;
* [[How to change name of id in Verilog parsetree | Verilog: How do I change the name of an id (VeriidDef) in Verilog parsetree?]]&lt;br /&gt;
* [[How to get library containing nested module | Verilog: How do I get nested modules and get the library that contains the nested module?]]&lt;br /&gt;
* [[How to get linefile information of macro definitions | Verilog: How do I get linefile information of macro definitions?]]&lt;br /&gt;
* [[How to find port dimensions | Verilog: How do I get port dimensions?]]&lt;br /&gt;
* [[Instance - Module binding order | Verilog: What is the order of binding modules to instances?]]&lt;br /&gt;
* [[How Verific elaborator handles blackboxes/unknown boxes | Verilog: How Verific elaborator handles blackboxes/unknown boxes]]&lt;br /&gt;
* [[Constant expression replacement | Verilog: Does Verific replace constant expressions with their respective values?]]&lt;br /&gt;
* [[Modules with '_1' '_2' suffix in their names | Verilog: After static elaboration, there are modules with &amp;quot;_1&amp;quot;, &amp;quot;_2&amp;quot;, ..., suffix in their names. Why?]]&lt;br /&gt;
* [[Defined macros become undefined - MFCU vs SFCU | SystemVerilog: Why does Verific complain about undefined macros for macros defined in a different file (Compilation Unit)?]]&lt;br /&gt;
* [[Notes on analysis | SystemVerilog: Notes on analysis]]&lt;br /&gt;
* [[How to get enums from Verilog parsetree | SystemVerilog: From the parsetree, how can I get the enums declared in a module?]]&lt;br /&gt;
* [[How to identify packages being imported into a module | SystemVerilog: How do I identify packages being imported into a module?]]&lt;br /&gt;
* [[SystemVerilog &amp;quot;std&amp;quot; package | SystemVerilog: Support for SystemVerilog semaphore/process/mailbox constructs.]]&lt;br /&gt;
* [[Top level module with interface ports | SystemVerilog: Support for SystemVerilog top level module with interface ports.]]&lt;br /&gt;
* [[Design with VHDL-1993 and VHDL-2008 files | VHDL: VHDL-1993 and VHDL-2008 each has its own IEEE library set. How do I analyze/elaborate a design with a mixture of files of different VHDL dialects (1993 and 2008)?]]&lt;br /&gt;
* [[Escaped identifiers in RTL files and in Verific data structures | Verilog/VHDL: Escaped identifiers in RTL files and in Verific data structures]]&lt;br /&gt;
* [[Prettyprint to a string | Verilog/VHDL: How to prettyprint a parsetree node to a string.]]&lt;br /&gt;
* [[Static elaboration | Verilog/VHDL: What does 'static elaboration' do?]]&lt;br /&gt;
* [[How to ignore a (not used) parameter/generic in elaboration. | Verilog/VHDL: How to ignore a (not used) parameter/generic in elaboration.]]&lt;br /&gt;
* [[What VeriModule* or VhdlPrimaryUnit* the Netlist comes from? | Verilog/VHDL: For a Netlist in the netlist database, is there a clean way to look back at what VeriModule* or VhdlPrimaryUnit* the Netlist was derived from?]]&lt;br /&gt;
* [[Cross-reference between the original RTL files and the elaborated netlist | Verilog/VHDL: Is there a way to cross-reference between the original RTL design files and the elaboration netlist?]]&lt;br /&gt;
* [[How to ignore parameters/generics in elaboration | Verilog/VHDL: Is there a way to tell the elaborator to ignore certain parameters/generics so that the unit/module is not uniquified?]]&lt;br /&gt;
* [[How to check for errors in analysis/elaboration | Verilog/VHDL: Is there a way to tell if the analysis/elaboration process has errors?]]&lt;br /&gt;
* [[Modules/design units with &amp;quot;_default&amp;quot; suffix in their names | Verilog/VHDL: After static elaboration, there are modules/design units/interfaces with &amp;quot;_default&amp;quot; suffix in their names. Why? And what are they?]]&lt;br /&gt;
* [[How to parse a string | Verilog/VHDL: How to parse a string - Example of adding a module to the parsetree]]&lt;br /&gt;
* [[Support IEEE 1735 encryption standard | Verilog/VHDL: Does Verific support IEEE 1735 encryption standard?]]&lt;br /&gt;
'''Netlist Database'''&lt;br /&gt;
* [[Logic optimization across hierarchy boundaries | Netlist Database: Does Verific perform logic optimization across hierarchy boundaries?]]&lt;br /&gt;
* [[Bit-blasting a multi-port RAM instance | Netlist Database: Bit-blasting a multi-port RAM instance]]&lt;br /&gt;
* [[System attributes | Netlist Database: System attributes]]&lt;br /&gt;
&lt;br /&gt;
'''Output'''&lt;br /&gt;
* [[Output file formats | What language formats does Verific support as output?]]&lt;br /&gt;
&lt;br /&gt;
'''Scripting languages: TCL, Perl, Python'''&lt;br /&gt;
* [[What languages can I use with Verific software? | What programming languages can I use with Verific software?]]&lt;br /&gt;
&lt;br /&gt;
'''Code examples'''&lt;br /&gt;
* [[How to use RegisterCallBackMsg() | Util/C++: How to use RegisterCallBackMsg()]]&lt;br /&gt;
* [[How to use MessageCallBackHandler Class | Util/C++: How to use MessageCallBackHandler Class]]&lt;br /&gt;
* [[How to use RegisterPragmaRefCallBack() | Util/C++: How to use RegisterPragmaRefCallBack()]]&lt;br /&gt;
* [[Write out an encrypted netlist | Database/C++: Write out an encrypted netlist]]&lt;br /&gt;
* [[Extract clock enable | Database/C++: Extract clock enable]]&lt;br /&gt;
* [[Black box, empty box, and unknown box | Database/C++: Black box, empty box, and unknown box]]&lt;br /&gt;
* [[Finding hierarchical paths of a Netlist | Database/C++: Finding hierarchical paths of a Netlist]]&lt;br /&gt;
* [[Replacing Verific built-in primitives/operators with user implementations | Database/C++: Replacing Verific built-in primitives/operators with user implementations]]&lt;br /&gt;
* [[Hierarchy tree RTL elaboration | Database/Perl: Simple example of hierarchy tree elaboration]]&lt;br /&gt;
* [[Create a Netlist Database from scratch (not from RTL elaboration) | Database/Perl/TCL: Create a Netlist Database from scratch (not from RTL elaboration)]]&lt;br /&gt;
* [[Buffering signals and ungrouping | Database/Verilog: Buffering signals and ungrouping (flattening) in the Netlist Database]]&lt;br /&gt;
* [[Memory elements of a RamNet | Database/Verilog/C++: Memory elements of a RamNet]]&lt;br /&gt;
* [[Process -f file and explore the Netlist Database (C++)| Database/Verilog/C++: Process -f file and explore the Netlist Database]]&lt;br /&gt;
* [[Process -f file and explore the Netlist Database (py)| Database/Verilog/Python: Process -f file and explore the Netlist Database]]&lt;br /&gt;
* [[Fanout cone and grouping | Database/Verilog/Perl: Fanout cone and grouping in the Netlist Database]]&lt;br /&gt;
* [[Simple example of visitor pattern | Verilog/C++: Simple examples of visitor pattern]]&lt;br /&gt;
* [[Statically elaborate with different values of parameters | Verilog/C++: Statically elaborate with different values of parameters]]&lt;br /&gt;
* [[Prettyprint all modules in the design hierarchy | Verilog/C++: Prettyprint all modules in the design hierarchy]]&lt;br /&gt;
* [[Getting instances' parameters | Verilog/C++: Getting instances' parameters]]&lt;br /&gt;
* [[Accessing and evaluating module's parameters | Verilog/C++: Accessing and evaluating module's parameters]]&lt;br /&gt;
* [[Visiting Hierarchical References (VeriSelectedName) | Verilog/C++: Visiting Hierarchical References (VeriSelectedName)]]&lt;br /&gt;
* [[Type Range example | Verilog/C++: Type Range example  (simple)]]&lt;br /&gt;
* [[Using stream input to ignore input file | Verilog/C++: Using stream input to ignore input file]]&lt;br /&gt;
* [[How to ignore certain modules while analyzing input RTL files | Verilog/C++: How to ignore certain modules while analyzing input RTL files]]&lt;br /&gt;
* [[How to tell if a module has encrypted contents | Verilog/C++: How to tell if a module has encrypted contents]]&lt;br /&gt;
* [[Comment out a line using text based design modification and parsetree modification | Verilog/C++: Comment out a line using text-based design modification and parsetree modification]] &lt;br /&gt;
* [[Verilog/C++: How to use IsUserDeclared() : Example for port associations]]&lt;br /&gt;
* [[How to create new module in Verilog parsetree | Verilog/C++: How to create new module in Verilog parsetree]]&lt;br /&gt;
* [[In Verilog parsetree adding names to unnamed instances | Verilog/C++: In Verilog parsetree adding names to unnamed instances]]&lt;br /&gt;
* [[How to get full hierarchy ID path | Verilog/C++: How to get full hierarchy ID path]]&lt;br /&gt;
* [[How to traverse scope hierarchy | Verilog/C++: How to traverse scope hierarchy]]&lt;br /&gt;
* [[Access attributes in parsetree | Verilog/C++: How to access attributes in parsetree]]&lt;br /&gt;
* [[How to detect multiple-clock-edge condition in Verilog parsetree | Verilog/C++: How to detect multiple-clock-edge condition in Verilog parsetree]]&lt;br /&gt;
* [[How to get driving net of an instance | Verilog/C++: How to get driving net of an instance]]&lt;br /&gt;
* [[Parse select modules only and ignore the rest | Verilog/C++: Parse select modules only and ignore the rest]]&lt;br /&gt;
* [[Create DOT diagram of parse tree | Verilog/C++: Create DOT diagram of a parse tree]]&lt;br /&gt;
* [[Type Range example with multi-dimensional arrays| Verilog/C++/Perl: Type Range example with multi-dimensional arrays]]&lt;br /&gt;
* [[How to get linefile data of macros - Macro callback function | Verilog/C++/Perl/Python: How to get linefile data of macros - Macro callback function]]&lt;br /&gt;
* [[Where in RTL does it get assigned? | Verilog/C++/Perl/Python: Where in RTL does it get assigned?]]&lt;br /&gt;
* [[Access attributes of ports in parsetree | Verilog/Perl: Access attributes of ports in parsetree and from netlist]]&lt;br /&gt;
* [[Evaluate 'for-generate' loop | Verilog/C++: Evaluate 'for-generate' loop]]&lt;br /&gt;
* [[Retrieve package name for user-defined variable types | SystemVerilog/C++/Python: Retrieve package name for user-defined variable types]]&lt;br /&gt;
* [[Pretty-print a module and the packages imported by the module | SystemVerilog/C++: Pretty-print a module and the packages imported by the module]]&lt;br /&gt;
* [[How to get packed dimensions of enum | SystemVerilog/C++: How to get packed dimensions of enum]]&lt;br /&gt;
* [[Simple examples of VHDL visitor pattern | VHDL/C++: Simple examples of VHDL visitor pattern]]&lt;br /&gt;
* [[Traverse instances in parsetree | VHDL/C++: Traverse instances in parsetree]]&lt;br /&gt;
* [[Parsing from data in memory | Verilog/VHDL/C++: Parsing from data in memory]]&lt;/div&gt;</summary>
		<author><name>Alice</name></author>	</entry>

	<entry>
		<id>https://www.verific.com/faq/index.php?title=Main_Page&amp;diff=885</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://www.verific.com/faq/index.php?title=Main_Page&amp;diff=885"/>
				<updated>2024-02-17T02:58:09Z</updated>
		
		<summary type="html">&lt;p&gt;Alice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''General'''&lt;br /&gt;
* [[How to get best support from Verific | '''''How to get best support from Verific''''']]&lt;br /&gt;
* [[Source code customization &amp;amp; Stable release services | Source code customization &amp;amp; Stable release services]]&lt;br /&gt;
* [[How to save computer resources | How to save computer resources (memory consumption &amp;amp; runtime)]]&lt;br /&gt;
* [[Original RTL language | How do I know what language a Netlist in the netlist database comes from?]]&lt;br /&gt;
* [[Verific data structures | What are the data structures in Verific?]]&lt;br /&gt;
* [[Remove Verific data structures | How do I remove all Verific data structures in memory?]]&lt;br /&gt;
* [[Does Verific build CDFG? | Does Verific build control and data flow graph (CDFG)?]]&lt;br /&gt;
* [[Does Verific support XMR?| Does Verific support cross module references (XMR)?]]&lt;br /&gt;
* [[Compile-time/run-time flags | Are there options to control Verific software's behavior? Compile-time &amp;amp; run-time flags.]]&lt;br /&gt;
* [[Message handling | How do I downgrade/upgrade messages from Verific? How do I get messages with more details?]]&lt;br /&gt;
* [[Release version | How do I tell the version of a Verific software release? ]]&lt;br /&gt;
* [[Simulation models for Verific primitives | Where do I find simulation models for Verific primitives (VERIFIC_XOR, VERIFIC_DFFRS, ....)? ]]&lt;br /&gt;
* [[Tcl library path| How to correct building (linking) issue &amp;quot;/usr/bin/ld: cannot find -ltcl&amp;quot;]]&lt;br /&gt;
* [[LineFile data from input files | LineFile data from input files]]&lt;br /&gt;
* [[Difference between RTL and gate-level simulations - Flipflop with async set and async reset | Difference between RTL and gate-level simulations - Flipflop with async set and async reset]]&lt;br /&gt;
* [[Preserving user nets - preventing nets from being optimized away | Preserving user nets - preventing nets from being optimized away]]&lt;br /&gt;
* [[Python pretty-printer for gdb | Python pretty-printer for gdb]]&lt;br /&gt;
&lt;br /&gt;
'''Input: VHDL, Verilog (and SystemVerilog), Liberty, EDIF'''&lt;br /&gt;
* [[How to get all Verilog files being analyzed | Verilog: I'm using -v, -y, .... After Verific is done with the analysis, how do I get a list of all the files being analyzed?]]&lt;br /&gt;
* [[Included files associated with a Verilog source file | Verilog: How do I get the list of included files associated with a Verilog source file?]]&lt;br /&gt;
* [[How to get type/initial value of parameters | Verilog: How to get type/initial value of parameters.]]&lt;br /&gt;
* [[Verilog ports being renamed | Verilog: Port Expressions]]&lt;br /&gt;
* [[Design with System Verilog and Verilog 2001 files | Verilog: For a design consisting of a mixture of Verilog 2001 and SystemVerilog input files, should I parse all the files as SystemVerilog?]]&lt;br /&gt;
* [[How to get module ports from Verilog parsetree | Verilog: From the Verilog parsetree, how can I get the ports of a module?]]&lt;br /&gt;
* [[How to change name of id in Verilog parsetree | Verilog: How do I change the name of an id (VeriidDef) in Verilog parsetree?]]&lt;br /&gt;
* [[How to get library containing nested module | Verilog: How do I get nested modules and get the library that contains the nested module?]]&lt;br /&gt;
* [[How to get linefile information of macro definitions | Verilog: How do I get linefile information of macro definitions?]]&lt;br /&gt;
* [[How to find port dimensions | Verilog: How do I get port dimensions?]]&lt;br /&gt;
* [[Instance - Module binding order | Verilog: What is the order of binding modules to instances?]]&lt;br /&gt;
* [[How Verific elaborator handles blackboxes/unknown boxes | Verilog: How Verific elaborator handles blackboxes/unknown boxes]]&lt;br /&gt;
* [[Constant expression replacement | Verilog: Does Verific replace constant expressions with their respective values?]]&lt;br /&gt;
* [[Modules with '_1' '_2' suffix in their names | Verilog: After static elaboration, there are modules with &amp;quot;_1&amp;quot;, &amp;quot;_2&amp;quot;, ..., suffix in their names. Why?]]&lt;br /&gt;
* [[Defined macros become undefined - MFCU vs SFCU | SystemVerilog: Why does Verific complain about undefined macros for macros defined in a different file (Compilation Unit)?]]&lt;br /&gt;
* [[Notes on analysis | SystemVerilog: Notes on analysis]]&lt;br /&gt;
* [[How to get enums from Verilog parsetree | SystemVerilog: From the parsetree, how can I get the enums declared in a module?]]&lt;br /&gt;
* [[How to identify packages being imported into a module | SystemVerilog: How do I identify packages being imported into a module?]]&lt;br /&gt;
* [[SystemVerilog &amp;quot;std&amp;quot; package | SystemVerilog: Support for SystemVerilog semaphore/process/mailbox constructs.]]&lt;br /&gt;
* [[Top level module with interface ports | SystemVerilog: Support for SystemVerilog top level module with interface ports.]]&lt;br /&gt;
* [[Design with VHDL-1993 and VHDL-2008 files | VHDL: VHDL-1993 and VHDL-2008 each has its own IEEE library set. How do I analyze/elaborate a design with a mixture of files of different VHDL dialects (1993 and 2008)?]]&lt;br /&gt;
* [[Escaped identifiers in RTL files and in Verific data structures | Verilog/VHDL: Escaped identifiers in RTL files and in Verific data structures]]&lt;br /&gt;
* [[Prettyprint to a string | Verilog/VHDL: How to prettyprint a parsetree node to a string.]]&lt;br /&gt;
* [[Static elaboration | Verilog/VHDL: What does 'static elaboration' do?]]&lt;br /&gt;
* [[How to ignore a (not used) parameter/generic in elaboration. | Verilog/VHDL: How to ignore a (not used) parameter/generic in elaboration.]]&lt;br /&gt;
* [[What VeriModule* or VhdlPrimaryUnit* the Netlist comes from? | Verilog/VHDL: For a Netlist in the netlist database, is there a clean way to look back at what VeriModule* or VhdlPrimaryUnit* the Netlist was derived from?]]&lt;br /&gt;
* [[Cross-reference between the original RTL files and the elaborated netlist | Verilog/VHDL: Is there a way to cross-reference between the original RTL design files and the elaboration netlist?]]&lt;br /&gt;
* [[How to ignore parameters/generics in elaboration | Verilog/VHDL: Is there a way to tell the elaborator to ignore certain parameters/generics so that the unit/module is not uniquified?]]&lt;br /&gt;
* [[How to check for errors in analysis/elaboration | Verilog/VHDL: Is there a way to tell if the analysis/elaboration process has errors?]]&lt;br /&gt;
* [[Modules/design units with &amp;quot;_default&amp;quot; suffix in their names | Verilog/VHDL: After static elaboration, there are modules/design units/interfaces with &amp;quot;_default&amp;quot; suffix in their names. Why? And what are they?]]&lt;br /&gt;
* [[How to parse a string | Verilog/VHDL: How to parse a string - Example of adding a module to the parsetree]]&lt;br /&gt;
* [[Support IEEE 1735 encryption standard | Verilog/VHDL: Does Verific support IEEE 1735 encryption standard?]]&lt;br /&gt;
'''Netlist Database'''&lt;br /&gt;
* [[Logic optimization across hierarchy boundaries | Netlist Database: Does Verific perform logic optimization across hierarchy boundaries?]]&lt;br /&gt;
* [[Bit-blasting a multi-port RAM instance | Netlist Database: Bit-blasting a multi-port RAM instance]]&lt;br /&gt;
* [[System attributes | Netlist Database: System attributes]]&lt;br /&gt;
&lt;br /&gt;
'''Output'''&lt;br /&gt;
* [[Output file formats | What language formats does Verific support as output?]]&lt;br /&gt;
&lt;br /&gt;
'''Scripting languages: TCL, Perl, Python'''&lt;br /&gt;
* [[What languages can I use with Verific software? | What programming languages can I use with Verific software?]]&lt;br /&gt;
&lt;br /&gt;
'''Code examples'''&lt;br /&gt;
* [[How to use RegisterCallBackMsg() | Util/C++: How to use RegisterCallBackMsg()]]&lt;br /&gt;
* [[How to use MessageCallBackHandler Class | Util/C++: How to use MessageCallBackHandler Class]]&lt;br /&gt;
* [[How to use RegisterPragmaRefCallBack() | Util/C++: How to use RegisterPragmaRefCallBack()]]&lt;br /&gt;
* [[Write out an encrypted netlist | Database/C++: Write out an encrypted netlist]]&lt;br /&gt;
* [[Extract clock enable | Database/C++: Extract clock enable]]&lt;br /&gt;
* [[Black box, empty box, and unknown box | Database/C++: Black box, empty box, and unknown box]]&lt;br /&gt;
* [[Post processing port resolution of black boxes | Database/Verilog/C++: Post processing port resolution of black boxes]]&lt;br /&gt;
* [[Finding hierarchical paths of a Netlist | Database/C++: Finding hierarchical paths of a Netlist]]&lt;br /&gt;
* [[Replacing Verific built-in primitives/operators with user implementations | Database/C++: Replacing Verific built-in primitives/operators with user implementations]]&lt;br /&gt;
* [[Hierarchy tree RTL elaboration | Database/Perl: Simple example of hierarchy tree elaboration]]&lt;br /&gt;
* [[Create a Netlist Database from scratch (not from RTL elaboration) | Database/Perl/TCL: Create a Netlist Database from scratch (not from RTL elaboration)]]&lt;br /&gt;
* [[Buffering signals and ungrouping | Database/Verilog: Buffering signals and ungrouping (flattening) in the Netlist Database]]&lt;br /&gt;
* [[Memory elements of a RamNet | Database/Verilog/C++: Memory elements of a RamNet]]&lt;br /&gt;
* [[Process -f file and explore the Netlist Database (C++)| Database/Verilog/C++: Process -f file and explore the Netlist Database]]&lt;br /&gt;
* [[Process -f file and explore the Netlist Database (py)| Database/Verilog/Python: Process -f file and explore the Netlist Database]]&lt;br /&gt;
* [[Fanout cone and grouping | Database/Verilog/Perl: Fanout cone and grouping in the Netlist Database]]&lt;br /&gt;
* [[Simple example of visitor pattern | Verilog/C++: Simple examples of visitor pattern]]&lt;br /&gt;
* [[Statically elaborate with different values of parameters | Verilog/C++: Statically elaborate with different values of parameters]]&lt;br /&gt;
* [[Prettyprint all modules in the design hierarchy | Verilog/C++: Prettyprint all modules in the design hierarchy]]&lt;br /&gt;
* [[Getting instances' parameters | Verilog/C++: Getting instances' parameters]]&lt;br /&gt;
* [[Accessing and evaluating module's parameters | Verilog/C++: Accessing and evaluating module's parameters]]&lt;br /&gt;
* [[Visiting Hierarchical References (VeriSelectedName) | Verilog/C++: Visiting Hierarchical References (VeriSelectedName)]]&lt;br /&gt;
* [[Type Range example | Verilog/C++: Type Range example  (simple)]]&lt;br /&gt;
* [[Using stream input to ignore input file | Verilog/C++: Using stream input to ignore input file]]&lt;br /&gt;
* [[How to ignore certain modules while analyzing input RTL files | Verilog/C++: How to ignore certain modules while analyzing input RTL files]]&lt;br /&gt;
* [[How to tell if a module has encrypted contents | Verilog/C++: How to tell if a module has encrypted contents]]&lt;br /&gt;
* [[Comment out a line using text based design modification and parsetree modification | Verilog/C++: Comment out a line using text-based design modification and parsetree modification]] &lt;br /&gt;
* [[Verilog/C++: How to use IsUserDeclared() : Example for port associations]]&lt;br /&gt;
* [[How to create new module in Verilog parsetree | Verilog/C++: How to create new module in Verilog parsetree]]&lt;br /&gt;
* [[In Verilog parsetree adding names to unnamed instances | Verilog/C++: In Verilog parsetree adding names to unnamed instances]]&lt;br /&gt;
* [[How to get full hierarchy ID path | Verilog/C++: How to get full hierarchy ID path]]&lt;br /&gt;
* [[How to traverse scope hierarchy | Verilog/C++: How to traverse scope hierarchy]]&lt;br /&gt;
* [[Access attributes in parsetree | Verilog/C++: How to access attributes in parsetree]]&lt;br /&gt;
* [[How to detect multiple-clock-edge condition in Verilog parsetree | Verilog/C++: How to detect multiple-clock-edge condition in Verilog parsetree]]&lt;br /&gt;
* [[How to get driving net of an instance | Verilog/C++: How to get driving net of an instance]]&lt;br /&gt;
* [[Parse select modules only and ignore the rest | Verilog/C++: Parse select modules only and ignore the rest]]&lt;br /&gt;
* [[Create DOT diagram of parse tree | Verilog/C++: Create DOT diagram of a parse tree]]&lt;br /&gt;
* [[Type Range example with multi-dimensional arrays| Verilog/C++/Perl: Type Range example with multi-dimensional arrays]]&lt;br /&gt;
* [[How to get linefile data of macros - Macro callback function | Verilog/C++/Perl/Python: How to get linefile data of macros - Macro callback function]]&lt;br /&gt;
* [[Where in RTL does it get assigned? | Verilog/C++/Perl/Python: Where in RTL does it get assigned?]]&lt;br /&gt;
* [[Access attributes of ports in parsetree | Verilog/Perl: Access attributes of ports in parsetree and from netlist]]&lt;br /&gt;
* [[Evaluate 'for-generate' loop | Verilog/C++: Evaluate 'for-generate' loop]]&lt;br /&gt;
* [[Retrieve package name for user-defined variable types | SystemVerilog/C++/Python: Retrieve package name for user-defined variable types]]&lt;br /&gt;
* [[Pretty-print a module and the packages imported by the module | SystemVerilog/C++: Pretty-print a module and the packages imported by the module]]&lt;br /&gt;
* [[How to get packed dimensions of enum | SystemVerilog/C++: How to get packed dimensions of enum]]&lt;br /&gt;
* [[Simple examples of VHDL visitor pattern | VHDL/C++: Simple examples of VHDL visitor pattern]]&lt;br /&gt;
* [[Traverse instances in parsetree | VHDL/C++: Traverse instances in parsetree]]&lt;br /&gt;
* [[Parsing from data in memory | Verilog/VHDL/C++: Parsing from data in memory]]&lt;/div&gt;</summary>
		<author><name>Alice</name></author>	</entry>

	<entry>
		<id>https://www.verific.com/faq/index.php?title=Post_processing_port_resolution_of_black_boxes&amp;diff=884</id>
		<title>Post processing port resolution of black boxes</title>
		<link rel="alternate" type="text/html" href="https://www.verific.com/faq/index.php?title=Post_processing_port_resolution_of_black_boxes&amp;diff=884"/>
				<updated>2024-02-17T02:56:29Z</updated>
		
		<summary type="html">&lt;p&gt;Alice: Created page with &amp;quot;C++ example:  &amp;lt;nowiki&amp;gt; #include &amp;quot;Map.h&amp;quot;             #include &amp;quot;Message.h&amp;quot;         #include &amp;quot;veri_file.h&amp;quot;       #include &amp;quot;DataBase.h&amp;quot;        #include &amp;quot;VeriWrite.h&amp;quot; #include &amp;quot;Run...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;C++ example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
#include &amp;quot;Map.h&amp;quot;            &lt;br /&gt;
#include &amp;quot;Message.h&amp;quot;        &lt;br /&gt;
#include &amp;quot;veri_file.h&amp;quot;      &lt;br /&gt;
#include &amp;quot;DataBase.h&amp;quot;       &lt;br /&gt;
#include &amp;quot;VeriWrite.h&amp;quot;&lt;br /&gt;
#include &amp;quot;RuntimeFlags.h&amp;quot;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#ifdef VERIFIC_NAMESPACE&lt;br /&gt;
using namespace Verific ;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char **argv)&lt;br /&gt;
{&lt;br /&gt;
    if (argc &amp;lt; 2) {&lt;br /&gt;
        Message::PrintLine(&amp;quot;Default input file: test.v. Specify command line argument to override&amp;quot;) ;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    const char *file_name = 0 ;&lt;br /&gt;
&lt;br /&gt;
    if (argc&amp;gt;1) {&lt;br /&gt;
        file_name = argv[1] ; // Set the file name as specified by the user&lt;br /&gt;
    } else {&lt;br /&gt;
        file_name = &amp;quot;test.v&amp;quot; ;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (!veri_file::Analyze(file_name, veri_file::SYSTEM_VERILOG)) return 1 ;&lt;br /&gt;
    if (!veri_file::ElaborateAll()) return 1 ;&lt;br /&gt;
&lt;br /&gt;
    Netlist *top = Netlist::PresentDesign() ;&lt;br /&gt;
&lt;br /&gt;
    VeriWrite vw ;&lt;br /&gt;
    RuntimeFlags::SetVar(&amp;quot;db_verilog_writer_write_blackboxes&amp;quot;, 2) ;&lt;br /&gt;
    vw.WriteFile (&amp;quot;netlist_before.v&amp;quot;, top) ;&lt;br /&gt;
&lt;br /&gt;
    MapIter mi ;&lt;br /&gt;
    Instance * instance ;&lt;br /&gt;
    FOREACH_INSTANCE_OF_NETLIST(top, mi, instance) {&lt;br /&gt;
        Netlist *view = instance-&amp;gt;View() ;&lt;br /&gt;
        if (!view) continue ;&lt;br /&gt;
        if (view-&amp;gt;GetAtt(&amp;quot; unknown_design&amp;quot;)) {&lt;br /&gt;
            std::cout &amp;lt;&amp;lt; &amp;quot;===&amp;gt; Instance '&amp;quot; &amp;lt;&amp;lt;  instance-&amp;gt;Name() &amp;lt;&amp;lt; &amp;quot;' is of unknown module '&amp;quot;&lt;br /&gt;
                      &amp;lt;&amp;lt; instance-&amp;gt;View()-&amp;gt;Owner()-&amp;gt;Name() &amp;lt;&amp;lt; &amp;quot;'&amp;quot;&amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
            MapIter mi2 ;&lt;br /&gt;
            PortRef *portref ;&lt;br /&gt;
            FOREACH_PORTREF_OF_INST(instance, mi2, portref) {&lt;br /&gt;
                unsigned dir_known = 0 ;&lt;br /&gt;
                Port *port = portref-&amp;gt;GetPort() ;&lt;br /&gt;
                std::cout &amp;lt;&amp;lt; &amp;quot;===&amp;gt;     Port: '&amp;quot; &amp;lt;&amp;lt; port-&amp;gt;Name() &amp;lt;&amp;lt; &amp;quot;'&amp;quot;&amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
                Net *net = portref-&amp;gt;GetNet() ;&lt;br /&gt;
                if (!net) {&lt;br /&gt;
                    std::cout &amp;lt;&amp;lt; &amp;quot;===&amp;gt;     Does not connect to any Net&amp;quot; &amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
                    continue ;&lt;br /&gt;
                }&lt;br /&gt;
                // Is this port connected to any Port?&lt;br /&gt;
                Port *port2 ;&lt;br /&gt;
                SetIter si ;&lt;br /&gt;
                FOREACH_PORT_OF_NET(net, si, port2) {&lt;br /&gt;
                    if (port2-&amp;gt;IsInput()) {&lt;br /&gt;
                        std::cout &amp;lt;&amp;lt; &amp;quot;===&amp;gt;         Connected to input port '&amp;quot; &amp;lt;&amp;lt; port2-&amp;gt;Name() &amp;lt;&amp;lt; &amp;quot;' of owning Netlist&amp;quot; &amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
                        std::cout &amp;lt;&amp;lt; &amp;quot;===&amp;gt;             Set port '&amp;quot; &amp;lt;&amp;lt; port-&amp;gt;Name() &amp;lt;&amp;lt; &amp;quot;' to input&amp;quot; &amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
                        view-&amp;gt;GetPort(port-&amp;gt;Name())-&amp;gt;SetDir(DIR_IN) ;&lt;br /&gt;
                        dir_known = 1 ;&lt;br /&gt;
                    } else if (port2-&amp;gt;IsOutput()) {&lt;br /&gt;
                        if (net-&amp;gt;NumOfPortRefs() == 1 ) { // does not connected to any other instance&lt;br /&gt;
                            std::cout &amp;lt;&amp;lt; &amp;quot;===&amp;gt;         Only connected to output port '&amp;quot; &amp;lt;&amp;lt; port2-&amp;gt;Name() &amp;lt;&amp;lt; &amp;quot;' of owning Netlist&amp;quot; &amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
                            std::cout &amp;lt;&amp;lt; &amp;quot;===&amp;gt;             Set port '&amp;quot; &amp;lt;&amp;lt; port-&amp;gt;Name() &amp;lt;&amp;lt; &amp;quot;' to output&amp;quot; &amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
                            view-&amp;gt;GetPort(port-&amp;gt;Name())-&amp;gt;SetDir(DIR_OUT) ;&lt;br /&gt;
                            dir_known = 1 ;&lt;br /&gt;
                        }&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
                // If still don't know direction, check other connections&lt;br /&gt;
                if (!dir_known) {&lt;br /&gt;
                    PortRef *portref2 ;&lt;br /&gt;
                    SetIter si2 ;&lt;br /&gt;
                    FOREACH_PORTREF_OF_NET(net, si2, portref2) {&lt;br /&gt;
                        if (portref2 == portref) continue ; // not checking self&lt;br /&gt;
                        if (portref2-&amp;gt;IsOutput()) { // connected to an output portref, must be an input port&lt;br /&gt;
                            Instance *instance2 = portref2-&amp;gt;GetInst() ;&lt;br /&gt;
                            Port *port3 = portref2-&amp;gt;GetPort() ;&lt;br /&gt;
                            std::cout &amp;lt;&amp;lt; &amp;quot;===&amp;gt;         Connected to output port '&amp;quot; &amp;lt;&amp;lt; port3-&amp;gt;Name()&lt;br /&gt;
                                      &amp;lt;&amp;lt; &amp;quot;' of instance ' &amp;quot; &amp;lt;&amp;lt; instance2-&amp;gt;Name() &amp;lt;&amp;lt; &amp;quot;'&amp;quot; &amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
                            std::cout &amp;lt;&amp;lt; &amp;quot;===&amp;gt;             Set port '&amp;quot; &amp;lt;&amp;lt; port-&amp;gt;Name() &amp;lt;&amp;lt; &amp;quot;' to input&amp;quot; &amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
                            view-&amp;gt;GetPort(port-&amp;gt;Name())-&amp;gt;SetDir(DIR_IN) ;&lt;br /&gt;
                            dir_known = 1 ;&lt;br /&gt;
                            break ;&lt;br /&gt;
                        } else if (portref2-&amp;gt;IsInout()) { // connected to an inout portref, still don't know direction&lt;br /&gt;
                            break ;&lt;br /&gt;
                        } else { // all portrefs are inputs, must be an output port&lt;br /&gt;
                            std::cout &amp;lt;&amp;lt; &amp;quot;===&amp;gt;             All other PortRefs are inputs&amp;quot; &amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
                            std::cout &amp;lt;&amp;lt; &amp;quot;===&amp;gt;             Set port '&amp;quot; &amp;lt;&amp;lt; port-&amp;gt;Name() &amp;lt;&amp;lt; &amp;quot;' to output&amp;quot; &amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
                            view-&amp;gt;GetPort(port-&amp;gt;Name())-&amp;gt;SetDir(DIR_OUT) ;&lt;br /&gt;
                            dir_known = 1 ;&lt;br /&gt;
                        }&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
                if (!dir_known) { // Still clueless&lt;br /&gt;
                    std::cout &amp;lt;&amp;lt; &amp;quot;===&amp;gt;         Not enough data, remains inout&amp;quot; &amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    vw.WriteFile (&amp;quot;netlist_after.v&amp;quot;, top) ;&lt;br /&gt;
&lt;br /&gt;
    return 0 ;&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
-- Default input file: test.v. Specify command line argument to override&lt;br /&gt;
-- Analyzing Verilog file 'test.v' (VERI-1482)&lt;br /&gt;
test.v(1): INFO: compiling module 'top' (VERI-1018)&lt;br /&gt;
test.v(9): INFO: compiling module 'known1' (VERI-1018)&lt;br /&gt;
test.v(12): INFO: compiling module 'known2' (VERI-1018)&lt;br /&gt;
test.v(5): WARNING: instantiating unknown module 'unknown1' (VERI-1063)&lt;br /&gt;
test.v(6): WARNING: instantiating unknown module 'unknown2' (VERI-1063)&lt;br /&gt;
-- Writing netlist 'top' to Verilog file 'netlist_before.v' (VDB-1030)&lt;br /&gt;
===&amp;gt; Instance 'iu1' is of unknown module 'unknown1'&lt;br /&gt;
===&amp;gt;     Port: 'p1'&lt;br /&gt;
===&amp;gt;         Connected to output port 'o' of instance ' ik1'&lt;br /&gt;
===&amp;gt;             Set port 'p1' to input&lt;br /&gt;
===&amp;gt;     Port: 'p2'&lt;br /&gt;
===&amp;gt;         Connected to input port 'i2' of owning Netlist&lt;br /&gt;
===&amp;gt;             Set port 'p2' to input&lt;br /&gt;
===&amp;gt;     Port: 'p3'&lt;br /&gt;
===&amp;gt;         Not enough data, remains inout&lt;br /&gt;
===&amp;gt;     Port: 'p4'&lt;br /&gt;
===&amp;gt;             All other PortRefs are inputs&lt;br /&gt;
===&amp;gt;             Set port 'p4' to output&lt;br /&gt;
===&amp;gt;     Port: 'p5'&lt;br /&gt;
===&amp;gt;         Only connected to output port 'o3' of owning Netlist&lt;br /&gt;
===&amp;gt;             Set port 'p5' to output&lt;br /&gt;
===&amp;gt;     Port: 'p6'&lt;br /&gt;
===&amp;gt;         Not enough data, remains inout&lt;br /&gt;
===&amp;gt;     Port: 'p7'&lt;br /&gt;
===&amp;gt;         Not enough data, remains inout&lt;br /&gt;
===&amp;gt; Instance 'iu2' is of unknown module 'unknown2'&lt;br /&gt;
===&amp;gt;     Port: 'p1'&lt;br /&gt;
===&amp;gt;         Not enough data, remains inout&lt;br /&gt;
===&amp;gt;     Port: 'p2'&lt;br /&gt;
===&amp;gt;         Not enough data, remains inout&lt;br /&gt;
===&amp;gt;     Port: 'p3'&lt;br /&gt;
===&amp;gt;         Connected to input port 'i3' of owning Netlist&lt;br /&gt;
===&amp;gt;             Set port 'p3' to input&lt;br /&gt;
-- Writing netlist 'top' to Verilog file 'netlist_after.v' (VDB-1030)&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
netlist_before.v&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
module top (i1, i2, i3, o1, o2, o3) ;   // test.v(1)&lt;br /&gt;
    input i1;   // test.v(1)&lt;br /&gt;
    input i2;   // test.v(1)&lt;br /&gt;
    input i3;   // test.v(1)&lt;br /&gt;
    output o1;   // test.v(1)&lt;br /&gt;
    output o2;   // test.v(1)&lt;br /&gt;
    output o3;   // test.v(1)&lt;br /&gt;
    &lt;br /&gt;
    wire t1;   // test.v(2)&lt;br /&gt;
    wire t2;   // test.v(2)&lt;br /&gt;
    wire t3;   // test.v(2)&lt;br /&gt;
    wire t4;   // test.v(2)&lt;br /&gt;
    wire t5;   // test.v(2)&lt;br /&gt;
    &lt;br /&gt;
    known1 ik1 (.i1(i3), .i2(t2), .o(t3));   // test.v(3)&lt;br /&gt;
    known2 ik2 (.i1(i1), .i2(t1), .o(o2));   // test.v(4)&lt;br /&gt;
    unknown1 iu1 (.p1(t3), .p2(i2), .p3(t2), .p4(t1), .p5(o3), .p6(t4), &lt;br /&gt;
            .p7(t5));   // test.v(5)&lt;br /&gt;
    unknown2 iu2 (.p1(t4), .p2(t2), .p3(i3));   // test.v(6)&lt;br /&gt;
endmodule&lt;br /&gt;
&lt;br /&gt;
module known1 (i1, i2, o) ;   // test.v(9)&lt;br /&gt;
    input i1;   // test.v(9)&lt;br /&gt;
    input i2;   // test.v(9)&lt;br /&gt;
    output o;   // test.v(9)&lt;br /&gt;
endmodule&lt;br /&gt;
&lt;br /&gt;
module known2 (i1, i2, o) ;   // test.v(12)&lt;br /&gt;
    input i1;   // test.v(12)&lt;br /&gt;
    input i2;   // test.v(12)&lt;br /&gt;
    output o;   // test.v(12)  &lt;br /&gt;
endmodule&lt;br /&gt;
&lt;br /&gt;
module unknown1 (p1, p2, p3, p4, p5, p6, p7) ;&lt;br /&gt;
    inout p1;&lt;br /&gt;
    inout p2;&lt;br /&gt;
    inout p3;&lt;br /&gt;
    inout p4;&lt;br /&gt;
    inout p5;&lt;br /&gt;
    inout p6;&lt;br /&gt;
    inout p7; &lt;br /&gt;
endmodule&lt;br /&gt;
&lt;br /&gt;
module unknown2 (p1, p2, p3) ;&lt;br /&gt;
    inout p1;&lt;br /&gt;
    inout p2;&lt;br /&gt;
    inout p3;   &lt;br /&gt;
endmodule&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
netlist_after.v&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
module top (i1, i2, i3, o1, o2, o3);   // test.v(1)&lt;br /&gt;
    input i1;   // test.v(1)&lt;br /&gt;
    input i2;   // test.v(1)&lt;br /&gt;
    input i3;   // test.v(1)&lt;br /&gt;
    output o1;   // test.v(1)&lt;br /&gt;
    output o2;   // test.v(1)&lt;br /&gt;
    output o3;   // test.v(1)&lt;br /&gt;
    &lt;br /&gt;
    wire t1;   // test.v(2)&lt;br /&gt;
    wire t2;   // test.v(2)&lt;br /&gt;
    wire t3;   // test.v(2)&lt;br /&gt;
    wire t4;   // test.v(2)&lt;br /&gt;
    wire t5;   // test.v(2)&lt;br /&gt;
    &lt;br /&gt;
    known1 ik1 (.i1(i3), .i2(t2), .o(t3));   // test.v(3)&lt;br /&gt;
    known2 ik2 (.i1(i1), .i2(t1), .o(o2));   // test.v(4)&lt;br /&gt;
    unknown1 iu1 (.p1(t3), .p2(i2), .p3(t2), .p4(t1), .p5(o3), .p6(t4), &lt;br /&gt;
            .p7(t5));   // test.v(5)&lt;br /&gt;
    unknown2 iu2 (.p1(t4), .p2(t2), .p3(i3));   // test.v(6)&lt;br /&gt;
endmodule&lt;br /&gt;
&lt;br /&gt;
module known1 (i1, i2, o) ;   // test.v(9)&lt;br /&gt;
    input i1;   // test.v(9)&lt;br /&gt;
    input i2;   // test.v(9)&lt;br /&gt;
    output o;   // test.v(9) &lt;br /&gt;
endmodule&lt;br /&gt;
&lt;br /&gt;
module known2 (i1, i2, o) ;   // test.v(12)&lt;br /&gt;
    input i1;   // test.v(12)&lt;br /&gt;
    input i2;   // test.v(12)&lt;br /&gt;
    output o;   // test.v(12)&lt;br /&gt;
endmodule&lt;br /&gt;
&lt;br /&gt;
module unknown1 (p1, p2, p3, p4, p5, p6, p7) ;&lt;br /&gt;
    input p1;&lt;br /&gt;
    input p2;&lt;br /&gt;
    inout p3;&lt;br /&gt;
    output p4;&lt;br /&gt;
    output p5;&lt;br /&gt;
    inout p6;&lt;br /&gt;
    inout p7;&lt;br /&gt;
endmodule&lt;br /&gt;
&lt;br /&gt;
module unknown2 (p1, p2, p3) ;&lt;br /&gt;
    inout p1;&lt;br /&gt;
    inout p2;&lt;br /&gt;
    input p3;&lt;br /&gt;
endmodule&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
test.v&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
module top (input i1, i2, i3, output o1, o2, o3);&lt;br /&gt;
    wire t1, t2, t3, t4, t5;&lt;br /&gt;
    known1 ik1 (.i1(i3), .i2(t2), .o(t3));&lt;br /&gt;
    known2 ik2 (.i1(i1), .i2(t1), .o(o2));&lt;br /&gt;
    unknown1 iu1 (.p1(t3), .p2(i2), .p3(t2), .p4(t1), .p5(o3), .p6(t4), .p7(t5));&lt;br /&gt;
    unknown2 iu2 (.p1(t4), .p2(t2), .p3(i3));&lt;br /&gt;
endmodule&lt;br /&gt;
&lt;br /&gt;
module known1 (input i1, i2, output o);&lt;br /&gt;
endmodule&lt;br /&gt;
&lt;br /&gt;
module known2 (input i1, i2, output o);&lt;br /&gt;
endmodule&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Alice</name></author>	</entry>

	<entry>
		<id>https://www.verific.com/faq/index.php?title=Create_a_Netlist_Database_from_scratch_(not_from_RTL_elaboration)&amp;diff=854</id>
		<title>Create a Netlist Database from scratch (not from RTL elaboration)</title>
		<link rel="alternate" type="text/html" href="https://www.verific.com/faq/index.php?title=Create_a_Netlist_Database_from_scratch_(not_from_RTL_elaboration)&amp;diff=854"/>
				<updated>2023-09-20T19:20:47Z</updated>
		
		<summary type="html">&lt;p&gt;Alice: Included equivalent python script&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Perl script:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/usr/bin/perl&lt;br /&gt;
use strict;&lt;br /&gt;
&lt;br /&gt;
push (@INC,&amp;quot;../../../extra_tests/pm&amp;quot;);&lt;br /&gt;
require &amp;quot;Verific.pm&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
# The global Libset is already at the top of the netlist database.&lt;br /&gt;
# No need to create, just get a handle to it.&lt;br /&gt;
my $libset = Verific::Libset::Global();&lt;br /&gt;
&lt;br /&gt;
# Add new library.  If RTL elaboration has been run, a library has been created&lt;br /&gt;
# already.  The default library is &amp;quot;work&amp;quot;.&lt;br /&gt;
my $lib = Verific::Library-&amp;gt;new(&amp;quot;mylib&amp;quot;);&lt;br /&gt;
$libset-&amp;gt;Add($lib);&lt;br /&gt;
&lt;br /&gt;
# Add cell to the library.  In the Verilog netlist output, the cell name is the&lt;br /&gt;
# same as the module name.&lt;br /&gt;
my $cell = Verific::Cell-&amp;gt;new(&amp;quot;mycell&amp;quot;);&lt;br /&gt;
$lib-&amp;gt;Add($cell);&lt;br /&gt;
&lt;br /&gt;
# Add netlist to cell.  In the Verilog netlist output, the netlist name doesn't matter.&lt;br /&gt;
my $netlist = Verific::Netlist-&amp;gt;new(&amp;quot;mynetlist&amp;quot;);&lt;br /&gt;
$cell-&amp;gt;Add($netlist);&lt;br /&gt;
&lt;br /&gt;
# Add ports to netlist&lt;br /&gt;
my $inport = Verific::Port-&amp;gt;new(&amp;quot;in&amp;quot;, $Verific::DIR_IN);&lt;br /&gt;
$netlist-&amp;gt;Add($inport);&lt;br /&gt;
my $outport = Verific::Port-&amp;gt;new(&amp;quot;out&amp;quot;, $Verific::DIR_OUT);&lt;br /&gt;
$netlist-&amp;gt;Add($outport);&lt;br /&gt;
&lt;br /&gt;
# Add nets (Verilog: wire) to netlist&lt;br /&gt;
my $net1 = Verific::Net-&amp;gt;new(&amp;quot;in&amp;quot;);&lt;br /&gt;
$netlist-&amp;gt;Add($net1);&lt;br /&gt;
$net1-&amp;gt;Connect($inport);&lt;br /&gt;
&lt;br /&gt;
my $net2 = Verific::Net-&amp;gt;new(&amp;quot;out&amp;quot;);&lt;br /&gt;
$netlist-&amp;gt;Add($net2);&lt;br /&gt;
$net2-&amp;gt;Connect($outport);&lt;br /&gt;
&lt;br /&gt;
my $net3 = Verific::Net-&amp;gt;new(&amp;quot;n1&amp;quot;);&lt;br /&gt;
$netlist-&amp;gt;Add($net3);&lt;br /&gt;
&lt;br /&gt;
# Add new library&lt;br /&gt;
my $primlib = Verific::Library-&amp;gt;new(&amp;quot;myprimitives&amp;quot;);&lt;br /&gt;
$libset-&amp;gt;Add($primlib);&lt;br /&gt;
# Create primitive inv&lt;br /&gt;
my $invcell = Verific::Cell-&amp;gt;new(&amp;quot;inv&amp;quot;);&lt;br /&gt;
$primlib-&amp;gt;Add($invcell);&lt;br /&gt;
my $invnetlist = Verific::Netlist-&amp;gt;new(&amp;quot;primitive&amp;quot;);&lt;br /&gt;
$invcell-&amp;gt;Add($invnetlist);&lt;br /&gt;
my $Ainport = Verific::Port-&amp;gt;new(&amp;quot;A&amp;quot;, $Verific::DIR_IN);&lt;br /&gt;
$invnetlist-&amp;gt;Add($Ainport);&lt;br /&gt;
my $Zoutport = Verific::Port-&amp;gt;new(&amp;quot;Z&amp;quot;, $Verific::DIR_OUT);&lt;br /&gt;
$invnetlist-&amp;gt;Add($Zoutport);&lt;br /&gt;
# Create primitive buff&lt;br /&gt;
my $buffcell = Verific::Cell-&amp;gt;new(&amp;quot;buff&amp;quot;);&lt;br /&gt;
$primlib-&amp;gt;Add($buffcell);&lt;br /&gt;
my $buffnetlist = Verific::Netlist-&amp;gt;new(&amp;quot;primitive&amp;quot;);&lt;br /&gt;
$buffcell-&amp;gt;Add($buffnetlist);&lt;br /&gt;
$Ainport = Verific::Port-&amp;gt;new(&amp;quot;A&amp;quot;, $Verific::DIR_IN);&lt;br /&gt;
$buffnetlist-&amp;gt;Add($Ainport);&lt;br /&gt;
$Zoutport = Verific::Port-&amp;gt;new(&amp;quot;Z&amp;quot;, $Verific::DIR_OUT);&lt;br /&gt;
$buffnetlist-&amp;gt;Add($Zoutport);&lt;br /&gt;
&lt;br /&gt;
# Instantiate inv in mynetlist&lt;br /&gt;
my $inst = $netlist-&amp;gt;Add(Verific::Instance-&amp;gt;new(&amp;quot;inv1&amp;quot;, $invnetlist));&lt;br /&gt;
if ($inst) {&lt;br /&gt;
    my $port = $invnetlist-&amp;gt;GetPort(&amp;quot;A&amp;quot;);&lt;br /&gt;
    if ($port) {$net1-&amp;gt;Connect($inst, $port);}&lt;br /&gt;
    $port = $invnetlist-&amp;gt;GetPort(&amp;quot;Z&amp;quot;);&lt;br /&gt;
    if ($port) {$net3-&amp;gt;Connect($inst, $port);}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Instantiate buff in mynetlist&lt;br /&gt;
$inst = $netlist-&amp;gt;Add(Verific::Instance-&amp;gt;new(&amp;quot;buff2&amp;quot;, $buffnetlist));&lt;br /&gt;
if ($inst) {&lt;br /&gt;
    my $port = $buffnetlist-&amp;gt;GetPort(&amp;quot;A&amp;quot;);&lt;br /&gt;
    if ($port) {$net3-&amp;gt;Connect($inst, $port);}&lt;br /&gt;
    $port = $buffnetlist-&amp;gt;GetPort(&amp;quot;Z&amp;quot;);&lt;br /&gt;
    if ($port) {$net2-&amp;gt;Connect($inst, $port);}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# write netlist&lt;br /&gt;
my $veriWriter = Verific::VeriWrite-&amp;gt;new();&lt;br /&gt;
$veriWriter-&amp;gt;WriteFile(sprintf(&amp;quot;%s.v&amp;quot;,$netlist-&amp;gt;Owner-&amp;gt;Name()), $netlist);&lt;br /&gt;
&lt;br /&gt;
exit(1);&lt;br /&gt;
&lt;br /&gt;
# moved this to a subroutine to keep above code clean,&lt;br /&gt;
# this subroutine shows how to resolve linefile information&lt;br /&gt;
sub vfcprintf {&lt;br /&gt;
   my ($format) = (@_[0]);&lt;br /&gt;
   my ($lf) = (@_[1]);&lt;br /&gt;
   my @PARAMS;&lt;br /&gt;
   for (my $i = 2; $i &amp;lt; scalar(@_); $i++) {&lt;br /&gt;
       push(@PARAMS,&amp;quot;@_[$i]&amp;quot;);&lt;br /&gt;
   }   &lt;br /&gt;
   my $lf_format = &amp;quot;&amp;quot;; &lt;br /&gt;
   if (Verific::LineFile::GetFileName($lf) &amp;amp;&amp;amp; Verific::LineFile::GetLineNo($lf)) {&lt;br /&gt;
       my $lf_format = sprintf(&amp;quot;%s(%s)&amp;quot;,Verific::LineFile::GetFileName($lf), Verific::LineFile::GetLineNo($lf));&lt;br /&gt;
       printf &amp;quot;%s: $format\n&amp;quot;,$lf_format,@PARAMS;&lt;br /&gt;
   } else {&lt;br /&gt;
       printf &amp;quot;$format\n&amp;quot;,@PARAMS;&lt;br /&gt;
   }   &lt;br /&gt;
&lt;br /&gt;
   return 0;&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Equivalent TCL script:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# The global Libset is already at the top of the netlist database.&lt;br /&gt;
# No need to create, just get a handle to it.&lt;br /&gt;
set libset [Libset_Global];&lt;br /&gt;
&lt;br /&gt;
# Add new library.  If RTL elaboration has been run, a library has been created&lt;br /&gt;
# already.  The default library is &amp;quot;work&amp;quot;.&lt;br /&gt;
set lib [new_Library &amp;quot;mylib&amp;quot;];&lt;br /&gt;
Libset_Add $libset $lib;&lt;br /&gt;
&lt;br /&gt;
# Add cell to the library.  In the Verilog netlist output, the cell name is the&lt;br /&gt;
# same as the module name.&lt;br /&gt;
set cell [new_Cell &amp;quot;newcell&amp;quot;];&lt;br /&gt;
Library_Add $lib $cell;&lt;br /&gt;
&lt;br /&gt;
# Add netlist to cell.  In the Verilog netlist output, the netlist name doesn't matter.&lt;br /&gt;
set netlist [new_Netlist &amp;quot;mynetlist&amp;quot;];&lt;br /&gt;
Cell_Add $cell $netlist;&lt;br /&gt;
&lt;br /&gt;
# Set the new netlist as present design&lt;br /&gt;
Netlist_SetPresentDesign $netlist;&lt;br /&gt;
&lt;br /&gt;
# Add ports to netlist&lt;br /&gt;
set inport [new_Port &amp;quot;in&amp;quot; $DIR_IN];&lt;br /&gt;
Netlist_Add $netlist $inport;&lt;br /&gt;
set outport [new_Port &amp;quot;out&amp;quot; $DIR_OUT];&lt;br /&gt;
Netlist_Add $netlist $outport;&lt;br /&gt;
&lt;br /&gt;
# Add nets (Verilog: wire) to netlist&lt;br /&gt;
set net1 [new_Net &amp;quot;in&amp;quot;];&lt;br /&gt;
Netlist_Add $netlist $net1;&lt;br /&gt;
Net_Connect $net1 $inport;&lt;br /&gt;
&lt;br /&gt;
set net2 [new_Net &amp;quot;out&amp;quot;];&lt;br /&gt;
Netlist_Add $netlist $net2;&lt;br /&gt;
Net_Connect $net2 $outport;&lt;br /&gt;
&lt;br /&gt;
set net3 [new_Net &amp;quot;n1&amp;quot;];&lt;br /&gt;
Netlist_Add $netlist $net3;&lt;br /&gt;
&lt;br /&gt;
# Add new library&lt;br /&gt;
set primlib [new_Library &amp;quot;myprimitives&amp;quot;];&lt;br /&gt;
Libset_Add $libset $primlib;&lt;br /&gt;
&lt;br /&gt;
# Create primitive inv&lt;br /&gt;
set invcell [new_Cell &amp;quot;inv&amp;quot;];&lt;br /&gt;
Library_Add $primlib $invcell;&lt;br /&gt;
set invnetlist [new_Netlist &amp;quot;primitive&amp;quot;]&lt;br /&gt;
Cell_Add $invcell $invnetlist;&lt;br /&gt;
set Ainport [new_Port &amp;quot;A&amp;quot; $DIR_IN];&lt;br /&gt;
Netlist_Add $invnetlist $Ainport&lt;br /&gt;
set Zinport [new_Port &amp;quot;Z&amp;quot; $DIR_OUT];&lt;br /&gt;
Netlist_Add $invnetlist $Zinport&lt;br /&gt;
&lt;br /&gt;
# Create primitive buff&lt;br /&gt;
set buffcell [new_Cell &amp;quot;buff&amp;quot;];&lt;br /&gt;
Library_Add $primlib $buffcell;&lt;br /&gt;
set buffnetlist [new_Netlist &amp;quot;primitive&amp;quot;];&lt;br /&gt;
Cell_Add $buffcell $buffnetlist&lt;br /&gt;
set Ainport [new_Port &amp;quot;A&amp;quot; $DIR_IN];&lt;br /&gt;
Netlist_Add $buffnetlist $Ainport&lt;br /&gt;
set Zinport [new_Port &amp;quot;Z&amp;quot; $DIR_OUT];&lt;br /&gt;
Netlist_Add $buffnetlist $Zinport&lt;br /&gt;
&lt;br /&gt;
# Instantiate inv in mynetlist&lt;br /&gt;
set inst [Netlist_Add $netlist [new_Instance &amp;quot;inv1&amp;quot; $invnetlist]];&lt;br /&gt;
if {$inst!=0} {&lt;br /&gt;
    set port [Netlist_GetPort $invnetlist &amp;quot;A&amp;quot;];&lt;br /&gt;
    if {$port!=0} {Net_Connect $net1 $inst $port};&lt;br /&gt;
    set port [Netlist_GetPort $invnetlist &amp;quot;Z&amp;quot;];&lt;br /&gt;
    if {$port!=0} {Net_Connect $net3 $inst $port};&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Instantiate buff in mynetlist&lt;br /&gt;
set inst [Netlist_Add $netlist [new_Instance &amp;quot;buff2&amp;quot; $buffnetlist]];&lt;br /&gt;
if {$inst!=0} {&lt;br /&gt;
    set port [Netlist_GetPort $buffnetlist &amp;quot;A&amp;quot;];&lt;br /&gt;
    if {$port!=0} {Net_Connect $net3 $inst $port};&lt;br /&gt;
    set port [Netlist_GetPort $buffnetlist &amp;quot;Z&amp;quot;];&lt;br /&gt;
    if {$port!=0} {Net_Connect $net2 $inst $port};&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Write output netlist&lt;br /&gt;
set cellname [DesignObj_Name [Netlist_Owner $netlist]];&lt;br /&gt;
set outfilename [append cellname &amp;quot;.v&amp;quot;];&lt;br /&gt;
write -format verilog $outfilename;&lt;br /&gt;
&lt;br /&gt;
exit;&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Equivalent Python script:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/usr/bin/python&lt;br /&gt;
&lt;br /&gt;
import sys&lt;br /&gt;
sys.path.append('../py')&lt;br /&gt;
&lt;br /&gt;
import Verific&lt;br /&gt;
&lt;br /&gt;
# The global Libset is already at the top of the netlist database.&lt;br /&gt;
# No need to create, just get a handle to it.&lt;br /&gt;
libset = Verific.Libset_Global()&lt;br /&gt;
&lt;br /&gt;
# Add library.  If RTL elaboration has been run, a library has been created&lt;br /&gt;
# already.  The default library is &amp;quot;work&amp;quot;.&lt;br /&gt;
lib = Verific.Library(&amp;quot;mylib&amp;quot;)&lt;br /&gt;
lib.thisown = 0&lt;br /&gt;
libset.Add(lib)&lt;br /&gt;
&lt;br /&gt;
# Add cell to the library.  In the Verilog netlist output, the cell name is the&lt;br /&gt;
# same as the module name.&lt;br /&gt;
cell = Verific.Cell(&amp;quot;mycell&amp;quot;)&lt;br /&gt;
cell.thisown = 0&lt;br /&gt;
lib.Add(cell)&lt;br /&gt;
&lt;br /&gt;
# Add netlist to cell.  In the Verilog netlist output, the netlist name doesn't matter.&lt;br /&gt;
netlist = Verific.Netlist(&amp;quot;mynetlist&amp;quot;)&lt;br /&gt;
netlist.thisown = 0&lt;br /&gt;
cell.Add(netlist)&lt;br /&gt;
&lt;br /&gt;
# Add ports to netlist&lt;br /&gt;
inport = Verific.Port(&amp;quot;in&amp;quot;, Verific.DIR_IN)&lt;br /&gt;
inport.thisown = 0&lt;br /&gt;
netlist.Add(inport)&lt;br /&gt;
outport = Verific.Port(&amp;quot;out&amp;quot;, Verific.DIR_OUT)&lt;br /&gt;
outport.thisown = 0&lt;br /&gt;
netlist.Add(outport)&lt;br /&gt;
&lt;br /&gt;
# Add nets (Verilog: wire) to netlist&lt;br /&gt;
net1 = Verific.Net(&amp;quot;in&amp;quot;)&lt;br /&gt;
net1.thisown = 0&lt;br /&gt;
netlist.Add(net1)&lt;br /&gt;
net1.Connect(inport)&lt;br /&gt;
&lt;br /&gt;
net2 = Verific.Net(&amp;quot;out&amp;quot;)&lt;br /&gt;
net2.thisown = 0&lt;br /&gt;
netlist.Add(net2)&lt;br /&gt;
net2.Connect(outport)&lt;br /&gt;
&lt;br /&gt;
net3 = Verific.Net(&amp;quot;n1&amp;quot;)&lt;br /&gt;
net3.thisown = 0&lt;br /&gt;
netlist.Add(net3)&lt;br /&gt;
&lt;br /&gt;
# Add library&lt;br /&gt;
primlib = Verific.Library(&amp;quot;myprimitives&amp;quot;)&lt;br /&gt;
primlib.thisown = 0&lt;br /&gt;
libset.Add(primlib)&lt;br /&gt;
&lt;br /&gt;
# Create primitive inv&lt;br /&gt;
invcell = Verific.Cell(&amp;quot;inv&amp;quot;)&lt;br /&gt;
invcell.thisown = 0&lt;br /&gt;
primlib.Add(invcell)&lt;br /&gt;
invnetlist = Verific.Netlist(&amp;quot;primitive&amp;quot;)&lt;br /&gt;
invnetlist.thisown = 0&lt;br /&gt;
invcell.Add(invnetlist)&lt;br /&gt;
Ainport = Verific.Port(&amp;quot;A&amp;quot;, Verific.DIR_IN)&lt;br /&gt;
Ainport.thisown = 0&lt;br /&gt;
invnetlist.Add(Ainport)&lt;br /&gt;
Zoutport = Verific.Port(&amp;quot;Z&amp;quot;, Verific.DIR_OUT)&lt;br /&gt;
Zoutport.thisown = 0&lt;br /&gt;
invnetlist.Add(Zoutport)&lt;br /&gt;
&lt;br /&gt;
# Create primitive buff&lt;br /&gt;
buffcell = Verific.Cell(&amp;quot;buff&amp;quot;)&lt;br /&gt;
buffcell.thisown = 0&lt;br /&gt;
primlib.Add(buffcell)&lt;br /&gt;
buffnetlist = Verific.Netlist(&amp;quot;primitive&amp;quot;)&lt;br /&gt;
buffnetlist.thisown = 0&lt;br /&gt;
buffcell.Add(buffnetlist)&lt;br /&gt;
Ainport = Verific.Port(&amp;quot;A&amp;quot;, Verific.DIR_IN)&lt;br /&gt;
Ainport.thisown = 0&lt;br /&gt;
buffnetlist.Add(Ainport)&lt;br /&gt;
Zoutport = Verific.Port(&amp;quot;Z&amp;quot;, Verific.DIR_OUT)&lt;br /&gt;
Zoutport.thisown = 0&lt;br /&gt;
buffnetlist.Add(Zoutport)&lt;br /&gt;
&lt;br /&gt;
# Instantiate inv in mynetlist&lt;br /&gt;
inst = Verific.Instance(&amp;quot;inv1&amp;quot;, invnetlist)&lt;br /&gt;
inst.thisown = 0&lt;br /&gt;
netlist.Add(inst)&lt;br /&gt;
if (inst) :&lt;br /&gt;
    port = invnetlist.GetPort(&amp;quot;A&amp;quot;)&lt;br /&gt;
    if (port) :&lt;br /&gt;
        net1.Connect(inst, port)&lt;br /&gt;
    port = invnetlist.GetPort(&amp;quot;Z&amp;quot;)&lt;br /&gt;
    if (port) :&lt;br /&gt;
        net3.Connect(inst, port)&lt;br /&gt;
&lt;br /&gt;
# Instantiate buff in mynetlist&lt;br /&gt;
inst = Verific.Instance(&amp;quot;buff2&amp;quot;, buffnetlist)&lt;br /&gt;
inst.thisown = 0&lt;br /&gt;
netlist.Add(inst)&lt;br /&gt;
if (inst) :&lt;br /&gt;
    port = buffnetlist.GetPort(&amp;quot;A&amp;quot;)&lt;br /&gt;
    if (port) :&lt;br /&gt;
        net3.Connect(inst, port)&lt;br /&gt;
    port = buffnetlist.GetPort(&amp;quot;Z&amp;quot;)&lt;br /&gt;
    if (port) :&lt;br /&gt;
        net2.Connect(inst, port)&lt;br /&gt;
&lt;br /&gt;
# write netlist&lt;br /&gt;
veriWriter = Verific.VeriWrite()&lt;br /&gt;
veriWriter.thisown = 0&lt;br /&gt;
veriWriter.WriteFile(netlist.Owner().Name()+&amp;quot;.v&amp;quot;, netlist)&lt;br /&gt;
&lt;br /&gt;
sys.exit(0)&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Output netlist:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
//&lt;br /&gt;
// Verific Verilog Description of module newcell&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
module newcell (in, out);&lt;br /&gt;
    input in;&lt;br /&gt;
    output out;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    wire n1;&lt;br /&gt;
&lt;br /&gt;
    inv inv1 (in, n1);&lt;br /&gt;
    buff buff2 (n1, out);&lt;br /&gt;
&lt;br /&gt;
endmodule&lt;br /&gt;
&lt;br /&gt;
//&lt;br /&gt;
// Verific Verilog Description of module inv&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
module inv (A, Z);&lt;br /&gt;
    input A;&lt;br /&gt;
    output Z;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
endmodule&lt;br /&gt;
&lt;br /&gt;
//&lt;br /&gt;
// Verific Verilog Description of module buff&lt;br /&gt;
//&lt;br /&gt;
&lt;br /&gt;
module buff (A, Z);&lt;br /&gt;
    input A;&lt;br /&gt;
    output Z;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
endmodule&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Alice</name></author>	</entry>

	<entry>
		<id>https://www.verific.com/faq/index.php?title=Static_elaboration&amp;diff=853</id>
		<title>Static elaboration</title>
		<link rel="alternate" type="text/html" href="https://www.verific.com/faq/index.php?title=Static_elaboration&amp;diff=853"/>
				<updated>2023-09-14T21:55:18Z</updated>
		
		<summary type="html">&lt;p&gt;Alice: Reorganize for clarity&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Q: What does 'static elaboration' do?'''&lt;br /&gt;
&lt;br /&gt;
Static elaboration runs after analysis. It modifies the parsetree. During static elaboration:&lt;br /&gt;
&lt;br /&gt;
* Identify top-level modules and tree of instantiations under this.&lt;br /&gt;
* Defparam statements and module instantiations are processed to calculate the parameter values of the modules for every instantiation.&lt;br /&gt;
* Hierarchical names are checked for their validity and usage. These hierarchical names remain in designs.&lt;br /&gt;
* Generate statements are processed. For generate unrolled, if/case generate selects the correct concurrent statements to be present in the module.&lt;br /&gt;
* Instance arrays are flattened.&lt;br /&gt;
* Depending on hierarchical name usage and defparam values the same module gets different signatures. They are replicated and proper values are passed within them hierarchically before attaching them to the corresponding instantiations.&lt;br /&gt;
* In each module, parameter values are replaced with constant values by evaluating the constant expression assigned to them. Constant expressions include constant function calls, some system function calls AMS function calls and all operators.&lt;br /&gt;
* Function and task calls are checked for their validity (if they are defined in higher level of hierarchy and used in lower level).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sequential code, blocking assignments, tasks and functions are left as is because they are not part of any static context. Only exception are constant function calls - they are replaced with their return values.&lt;br /&gt;
&lt;br /&gt;
If the purpose of the application is to synthesize the design (RTL elaboration), static elaboration is not needed.&lt;br /&gt;
&lt;br /&gt;
Runtime flag 'veri_replace_const_exprs' when set to 1 is to replace following constant expressions with literals:&lt;br /&gt;
&lt;br /&gt;
* Bounds of packed and unpacked ranges in all data declarations.&lt;br /&gt;
* Default values of all declared objects if those are constant.&lt;br /&gt;
* Delay values&lt;br /&gt;
* Reject and error limits of VeriPathPulse values.&lt;br /&gt;
* Indexed expressions only if the indexed expression is a bit-select on the LHS of a continuous assignment or output/inout port of module or gate instantiation.&lt;br /&gt;
&lt;br /&gt;
Using 'veri_replace_const_exprs' makes an extra pass on the elaborated parsetree, increasing total time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are other runtime flags controlling static elaboration process, e.g.&lt;br /&gt;
&lt;br /&gt;
 veri_cleanup_base_modules&lt;br /&gt;
 veri_copy_top_before_static_elab&lt;br /&gt;
 veri_do_not_uniquify_interface_instances&lt;br /&gt;
 veri_preserve_array_instances&lt;br /&gt;
 veri_preserve_interface_array_instances&lt;br /&gt;
 vhdl_uniquify_all_instances&lt;br /&gt;
 vhdl_copy_top_before_static_elab&lt;br /&gt;
 vhdl_replace_const_exprs&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Please see vhdl/VhdlRuntimeFlags.h and verilog/VeriRuntimeFlags.h for a complete list and for more details.&lt;/div&gt;</summary>
		<author><name>Alice</name></author>	</entry>

	</feed>