<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>vrq: How to Build a Plugin</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td width="180"><a href="index.html"><img src="vrq.png" width="150" height="100" border="0" alt="vrq"></a></td> <td background="top_bg.png" align="right" width="100%"> <img src="glyth.png" width="500" height="100" border="0" alt=""> </td> </tr> <tr> <td background="#FFFFFF" align="right" width="50" height="4"></td> </tr> </table> </head><body> <!-- Generated by Doxygen 1.7.1 --> <div class="navigation" id="top"> <div class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li class="current"><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> </div> <div class="header"> <div class="headertitle"> <h1>How to Build a Plugin </h1> </div> </div> <div class="contents"> <p>Vrq plugins are independently compiled as standalone DLLs.</p> <p>A detail description of how to create plugins can be found in the following sections:</p> <ul> <li><a class="el" href="plugin_info.html#plugin_api">Plugin API</a></li> <li><a class="el" href="plugin_info.html#building_a_plugin">Building a Plugin</a></li> <li><a class="el" href="plugin_info.html#installing_a_plugin">Installing a Plugin</a></li> </ul> <h2><a class="anchor" id="plugin_api"></a> Plugin API</h2> <p>Vrq plugins are created by creating a subclass of type <a class="el" href="classCBackend.html">CBackend</a>. This class should then be compiled in a standalone dll and placed in the the plugin directory.</p> <p>The input to a plugin is a vector of <a class="el" href="classCElement.html" title="An element of compilation passed to and from plugins.">CElement</a>. Each <a class="el" href="classCElement.html" title="An element of compilation passed to and from plugins.">CElement</a> represents a unit of compilation. Each unit can be as trivial as a module, the code in a file or the entire design.</p> <p>The output of a plugin is a vector of <a class="el" href="classCElement.html" title="An element of compilation passed to and from plugins.">CElement</a>. Each <a class="el" href="classCElement.html" title="An element of compilation passed to and from plugins.">CElement</a> again represents a unit of compilation. Note the number of input elements need not match the number of output elements. If a plugin does not modify the compilation units the plugin output may have no elements. In this case the input vector is passed to the next plugin in the processing pipeline.</p> <p>A code in a compilation unit is represented by a tree of <a class="el" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>. Each node of the tree represents a statement or operation. Short cut constructors should be used to create nodes. A list of node types can be found in <a class="el" href="parse_tree_node.html">Parse Tree Nodes</a> . A list of constructors can be found in <a class="el" href="group__node__constructors.html">Node Constructors</a> . A list of utility routines for operating on <a class="el" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a> can be found in <a class="el" href="group__node__utilities.html">Node Utilities</a> . A list of general purpose function can be found here: <a class="el" href="group__utilities.html">Utility Routines</a> .</p> <p>Parse tree nodes may point to auxillary objects that represent elements of the parsed code such as variables, etc. See the following list of classes:</p> <ul> <li><a class="el" href="classCAttr.html" title="Declaration object for holding lists of verilog attributes and their corresponding expressions...">CAttr</a></li> <li><a class="el" href="classCBlock.html" title="Declaration class for block constructs.">CBlock</a></li> <li><a class="el" href="classCObject.html" title="Base class for vrq objects.">CObject</a></li> <li><a class="el" href="classCDecl.html" title="Base class for describing declaration objects.">CDecl</a></li> <li><a class="el" href="classCFref.html" title="Forward reference declaration.">CFref</a></li> <li><a class="el" href="classCGenvar.html" title="Declaration object for genvars.">CGenvar</a></li> <li><a class="el" href="classCVar.html" title="Declaration object for variables.">CVar</a></li> <li><a class="el" href="classCNet.html" title="Declaration object for nets.">CNet</a></li> <li><a class="el" href="classCGate.html" title="Gate declaration object.">CGate</a></li> <li><a class="el" href="classCMacro.html" title="Declaration object for preprocessor macros.">CMacro</a></li> <li><a class="el" href="classCSpecify.html" title="Declaration object for specify blocks.">CSpecify</a></li> <li><a class="el" href="classCPort.html" title="Declaration object for module/function/task ports.">CPort</a></li> <li><a class="el" href="classCInstance.html" title="Declaration object for module and gate instances.">CInstance</a></li> <li><a class="el" href="classCPortDir.html" title="Declaration object for input/output/inout statements.">CPortDir</a></li> <li><a class="el" href="classCParam.html" title="Declaration object for parameters.">CParam</a></li> <li><a class="el" href="classCFunction.html" title="Declaration object for functions and tasks.">CFunction</a></li> <li><a class="el" href="classCModule.html">CModule</a></li> <li><a class="el" href="classCVector.html" title="Bit vector class for implementing 4 state verilog signed and unsigned arithmetic.">CVector</a></li> <li><a class="el" href="classCDataType.html" title="Base class for describing data types.">CDataType</a></li> <li><a class="el" href="classCSimpleType.html" title="class for describing simple builtin data types">CSimpleType</a></li> <li>CTypedef</li> <li>CStructType</li> <li>CClassType</li> <li>CEnumType</li> <li>CProxyType</li> </ul> <p>Additionally these class provide support functions for object info:</p> <ul> <li><a class="el" href="classCUInt.html" title="Infinite precision unsigned arithmetic class Storage within object will be used whenever possible...">CUInt</a></li> <li><a class="el" href="classCObstack.html" title="Bulk object allocation object.">CObstack</a></li> <li><a class="el" href="classCSymbol.html" title="Holder for character strings.">CSymbol</a></li> <li><a class="el" href="classCSymtab.html" title="Aux class used to create symbol table scoping.">CSymtab</a></li> <li><a class="el" href="classMessage.html" title="Plugin's should need these.">Message</a></li> <li><a class="el" href="classSystask.html" title="Class method to query systask info.">Systask</a></li> <li><a class="el" href="classExternal.html" title="This class is a stub that will be used to create linkages for external references.">External</a></li> </ul> <p>The plugin pipeline is specified on the command line using the on the command line. The output of one plugin is applied to the next.</p> <p>In the case that a plugin produces an output vector but there are no remaining plugins to process the output, the dump tool is invoked to convert the parse trees back to textual verilog.</p> <h2><a class="anchor" id="building_a_plugin"></a> Building a Plugin</h2> <p>Example plugins can be found here:</p> <ul> <li><a class="el" href="example1.html">Example Plugin</a></li> <li><a class="el" href="example2.html">Example Plugin</a></li> </ul> <h2><a class="anchor" id="installing_a_plugin"></a> Installing a Plugin</h2> <p>This class should then be compiled in a standalone dll and placed in the default plugin directory. The default plugin directory configured at vrq build time can be determined by executing: vrq --pkglibdir</p> <p>Alternately the plugin directory can be overriden by setting the environment variable PLUGIN_DIR with a ':' seperated list of paths to search. </p> </div> <hr class="footer"/><address class="footer"><small>Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address> </body> </html>