<!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: /net/fileserver/nas/home/mdh/vrq/src/cblock.h Source File</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.5.5 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><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 class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <h1>/net/fileserver/nas/home/mdh/vrq/src/cblock.h</h1><a href="cblock_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*****************************************************************************</span> <a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 1997-2007, Mark Hummel</span> <a name="l00003"></a>00003 <span class="comment"> * This file is part of Vrq.</span> <a name="l00004"></a>00004 <span class="comment"> *</span> <a name="l00005"></a>00005 <span class="comment"> * Vrq is free software; you can redistribute it and/or</span> <a name="l00006"></a>00006 <span class="comment"> * modify it under the terms of the GNU General Public</span> <a name="l00007"></a>00007 <span class="comment"> * License as published by the Free Software Foundation; either</span> <a name="l00008"></a>00008 <span class="comment"> * version 2 of the License, or (at your option) any later version.</span> <a name="l00009"></a>00009 <span class="comment"> *</span> <a name="l00010"></a>00010 <span class="comment"> * Vrq is distributed in the hope that it will be useful,</span> <a name="l00011"></a>00011 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00012"></a>00012 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span> <a name="l00013"></a>00013 <span class="comment"> * General Public License for more details.</span> <a name="l00014"></a>00014 <span class="comment"> *</span> <a name="l00015"></a>00015 <span class="comment"> * You should have received a copy of the GNU General Public</span> <a name="l00016"></a>00016 <span class="comment"> * License along with this library; if not, write to the Free Software</span> <a name="l00017"></a>00017 <span class="comment"> * Foundation, Inc., 51 Franklin Street, Fifth Floor, </span> <a name="l00018"></a>00018 <span class="comment"> * Boston, MA 02110-1301 USA</span> <a name="l00019"></a>00019 <span class="comment"> *****************************************************************************</span> <a name="l00020"></a>00020 <span class="comment"> */</span> <a name="l00021"></a>00021 <span class="comment">/******************************************************************************</span> <a name="l00022"></a>00022 <span class="comment"> *</span> <a name="l00023"></a>00023 <span class="comment"> *</span> <a name="l00024"></a>00024 <span class="comment"> * cblock.hpp</span> <a name="l00025"></a>00025 <span class="comment"> * - class definition of blocks </span> <a name="l00026"></a>00026 <span class="comment"> *</span> <a name="l00027"></a>00027 <span class="comment"> ******************************************************************************</span> <a name="l00028"></a>00028 <span class="comment"> */</span> <a name="l00029"></a>00029 <a name="l00030"></a>00030 <span class="preprocessor">#ifndef CBLOCK_HPP</span> <a name="l00031"></a>00031 <span class="preprocessor"></span><span class="preprocessor">#define CBLOCK_HPP</span> <a name="l00032"></a>00032 <span class="preprocessor"></span> <a name="l00033"></a>00033 <span class="preprocessor">#include <vector></span> <a name="l00034"></a>00034 <span class="preprocessor">#include "<a class="code" href="glue_8h.html">glue.h</a>"</span> <a name="l00035"></a>00035 <span class="preprocessor">#include "<a class="code" href="cdecl_8h.html">cdecl.h</a>"</span> <a name="l00036"></a>00036 <span class="preprocessor">#include "<a class="code" href="csymtab_8h.html">csymtab.h</a>"</span> <a name="l00037"></a>00037 <a name="l00038"></a>00038 <a name="l00039"></a>00039 <span class="keyword">class </span><a class="code" href="classCParam.html" title="Declaration object for parameters.">CParam</a>; <a name="l00040"></a>00040 <span class="keyword">class </span><a class="code" href="classCReg.html" title="Declaration object for registers.">CReg</a>; <a name="l00041"></a>00041 <span class="keyword">class </span><a class="code" href="classCReal.html" title="Declaration object for real variables.">CReal</a>; <a name="l00042"></a>00042 <span class="keyword">class </span><a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>; <a name="l00043"></a>00043 <span class="keyword">class </span><a class="code" href="classCNet.html" title="Declaration object for net types:eWIREeTRIeWANDeTRIANDeWOReTRIOReTRI1eTRI0eTRIREGeSUPPLY0eSUPPLY1...">CNet</a>; <a name="l00044"></a>00044 <span class="keyword">class </span><a class="code" href="classCFref.html" title="Forward reference declaration.">CFref</a>; <a name="l00045"></a>00045 <span class="keyword">class </span><a class="code" href="classCInstance.html" title="Declaration object for module and gate instances.">CInstance</a>; <a name="l00046"></a>00046 <span class="keyword">class </span><a class="code" href="classCEvent.html" title="Event declaration.">CEvent</a>; <a name="l00047"></a>00047 <span class="keyword">class </span><a class="code" href="classCGenvar.html" title="Declaration object for genvars.">CGenvar</a>; <a name="l00048"></a>00048 <span class="keyword">class </span><a class="code" href="classCPortDir.html" title="Declaration object for input/output/inout statements.">CPortDir</a>; <a name="l00049"></a>00049 <a name="l00050"></a>00050 <a name="l00054"></a><a class="code" href="classCBlock.html">00054</a> <span class="keyword">class </span><a class="code" href="classCBlock.html" title="Declaration class for block constructs.">CBlock</a>: <span class="keyword">public</span> <a class="code" href="classCDecl.html" title="Base class for describing declaration objects.">CDecl</a> <a name="l00055"></a>00055 { <a name="l00056"></a>00056 <span class="keyword">protected</span>: <a name="l00057"></a><a class="code" href="classCBlock.html#87dcd3110454cac2d4d5d9208cfe1ef5">00057</a> vector<CParam*> <a class="code" href="classCBlock.html#87dcd3110454cac2d4d5d9208cfe1ef5">paramList</a>; <a name="l00058"></a><a class="code" href="classCBlock.html#d228107b3cc3749afb18adfb9e95b7b1">00058</a> vector<CEvent*> <a class="code" href="classCBlock.html#d228107b3cc3749afb18adfb9e95b7b1">eventList</a>; <a name="l00059"></a><a class="code" href="classCBlock.html#8311f18a7a2ccace0432cba82dc7a158">00059</a> vector<CReg*> <a class="code" href="classCBlock.html#8311f18a7a2ccace0432cba82dc7a158">regList</a>; <a name="l00060"></a><a class="code" href="classCBlock.html#f96d4e6b35b47798fe6cf60954e214e9">00060</a> vector<CReal*> <a class="code" href="classCBlock.html#f96d4e6b35b47798fe6cf60954e214e9">realList</a>; <a name="l00061"></a><a class="code" href="classCBlock.html#08d48576743d4da3bf39b3863cca81ab">00061</a> vector<CGenvar*> <a class="code" href="classCBlock.html#08d48576743d4da3bf39b3863cca81ab">genvarList</a>; <a name="l00062"></a><a class="code" href="classCBlock.html#7ab505f0ec937c1bef72fe9458e36ed1">00062</a> vector<CFref*> <a class="code" href="classCBlock.html#7ab505f0ec937c1bef72fe9458e36ed1">frefList</a>; <a name="l00063"></a><a class="code" href="classCBlock.html#80b4c4efaa0ac82e84377b666ef780ec">00063</a> vector<CNet*> <a class="code" href="classCBlock.html#80b4c4efaa0ac82e84377b666ef780ec">netList</a>; <a name="l00064"></a><a class="code" href="classCBlock.html#ce74e9fcf42750c02327a5ceab686ff8">00064</a> <a class="code" href="classCBlock.html" title="Declaration class for block constructs.">CBlock</a>* <a class="code" href="classCBlock.html#ce74e9fcf42750c02327a5ceab686ff8">parent</a>; <a name="l00065"></a><a class="code" href="classCBlock.html#5d3f9c58a7728195954f3252a42a535a">00065</a> vector<CBlock*> <a class="code" href="classCBlock.html#5d3f9c58a7728195954f3252a42a535a">children</a>; <a name="l00066"></a><a class="code" href="classCBlock.html#e3e5968ce31846451f6e2babcdaa868b">00066</a> <a class="code" href="classCSymtab.html" title="Aux class used to create symbol table scoping.">CSymtab<CDecl></a> <a class="code" href="classCBlock.html#e3e5968ce31846451f6e2babcdaa868b">symtab</a>; <a name="l00067"></a>00067 <span class="keyword">private</span>: <a name="l00068"></a>00068 <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* codeList; <a name="l00069"></a>00069 <span class="keywordtype">int</span> rebalance; <a name="l00070"></a>00070 <span class="keyword">public</span>: <a name="l00076"></a>00076 <a class="code" href="classCBlock.html#7cb0efb333d8def4b6b0e0c189b06bc2" title="Constructor for BLOCK declarations.">CBlock</a>( <a class="code" href="classCSymbol.html" title="Holder for character strings.">CSymbol</a>* name, <a class="code" href="structCoord__t.html" title="Structure to hold file coordinates.">Coord_t</a>* aLoc ); <a name="l00083"></a>00083 <a class="code" href="classCBlock.html#7cb0efb333d8def4b6b0e0c189b06bc2" title="Constructor for BLOCK declarations.">CBlock</a>( <a class="code" href="classCSymbol.html" title="Holder for character strings.">CSymbol</a>* name, <a class="code" href="structCoord__t.html" title="Structure to hold file coordinates.">Coord_t</a>* aLoc, <a class="code" href="cdecl_8h.html#2079c5562904beb3c6648c13117153a0" title="Declaration types.">Decl_t</a> dtype ); <a name="l00087"></a><a class="code" href="classCBlock.html#072ddbd4b88ddc5bb4e0e698582be765">00087</a> <span class="keyword">virtual</span> <a class="code" href="classCBlock.html#072ddbd4b88ddc5bb4e0e698582be765" title="Object destructor.">~CBlock</a>() {} <a name="l00096"></a>00096 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCBlock.html#28d0319a58da46b4255f3534f895a211">Add</a>( <a class="code" href="classCInstance.html" title="Declaration object for module and gate instances.">CInstance</a>* instance ); <a name="l00105"></a>00105 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCBlock.html#28d0319a58da46b4255f3534f895a211">Add</a>( <a class="code" href="classCParam.html" title="Declaration object for parameters.">CParam</a>* param ); <a name="l00114"></a>00114 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCBlock.html#28d0319a58da46b4255f3534f895a211">Add</a>( <a class="code" href="classCNet.html" title="Declaration object for net types:eWIREeTRIeWANDeTRIANDeWOReTRIOReTRI1eTRI0eTRIREGeSUPPLY0eSUPPLY1...">CNet</a>* net ); <a name="l00123"></a>00123 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCBlock.html#28d0319a58da46b4255f3534f895a211">Add</a>( <a class="code" href="classCReg.html" title="Declaration object for registers.">CReg</a>* reg ); <a name="l00132"></a>00132 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCBlock.html#28d0319a58da46b4255f3534f895a211">Add</a>( <a class="code" href="classCEvent.html" title="Event declaration.">CEvent</a>* event ); <a name="l00141"></a>00141 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCBlock.html#28d0319a58da46b4255f3534f895a211">Add</a>( <a class="code" href="classCReal.html" title="Declaration object for real variables.">CReal</a>* real ); <a name="l00150"></a>00150 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCBlock.html#28d0319a58da46b4255f3534f895a211">Add</a>( <a class="code" href="classCBlock.html" title="Declaration class for block constructs.">CBlock</a>* child ); <a name="l00159"></a>00159 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCBlock.html#28d0319a58da46b4255f3534f895a211">Add</a>( <a class="code" href="classCFref.html" title="Forward reference declaration.">CFref</a>* fref ); <a name="l00168"></a>00168 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCBlock.html#28d0319a58da46b4255f3534f895a211">Add</a>( <a class="code" href="classCGenvar.html" title="Declaration object for genvars.">CGenvar</a>* genvar ); <a name="l00173"></a>00173 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCBlock.html#28d0319a58da46b4255f3534f895a211">Add</a>( <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* code ); <a name="l00178"></a>00178 <span class="keywordtype">void</span> <a class="code" href="classCBlock.html#347f0f6d7491b95340d38b7757e5b927" title="Set this block&#39;s parent block.">SetParent</a>( <a class="code" href="classCBlock.html" title="Declaration class for block constructs.">CBlock</a>* <a class="code" href="classCBlock.html#ce74e9fcf42750c02327a5ceab686ff8">parent</a> ); <a name="l00183"></a>00183 <a class="code" href="classCBlock.html" title="Declaration class for block constructs.">CBlock</a>* <a class="code" href="classCBlock.html#bb1d93afd9bc0949ee8d6389cf60dba5" title="Get this block&#39;s parent block.">GetParent</a>( <span class="keywordtype">void</span> ); <a name="l00188"></a>00188 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCBlock.html#06c61b6d755889abb23a7de8e18a80c3" title="Dump information about block to a file.">Dump</a>( FILE* f ); <a name="l00193"></a>00193 vector<CNet*>* <a class="code" href="classCBlock.html#514fa63d65eb792e2c835170a98d2254" title="Get list of object&#39;s nets.">GetNetList</a>(); <a name="l00198"></a>00198 vector<CReg*>* <a class="code" href="classCBlock.html#70400c9d4717435212317f45e1dff09b" title="Get list of object&#39;s registers.">GetRegList</a>(); <a name="l00203"></a>00203 vector<CParam*>* <a class="code" href="classCBlock.html#bd58778b6d540ee8dec30e3088bbec79" title="Get list of object&#39;s parameters.">GetParamList</a>(); <a name="l00208"></a>00208 vector<CReal*>* <a class="code" href="classCBlock.html#77af38121183acc36f78f77ee43aa68b" title="Get list of object&#39;s reals.">GetRealList</a>(); <a name="l00213"></a>00213 vector<CGenvar*>* <a class="code" href="classCBlock.html#179b208bf543a24b81f21dc218362ce5" title="Get list of object&#39;s genvars.">GetGenvarList</a>(); <a name="l00218"></a>00218 <span class="keyword">virtual</span> <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* <a class="code" href="classCBlock.html#609154b76dfad784e4d53d8cd03f232f" title="Get blocks parse tree.">GetCodeList</a>(); <a name="l00223"></a>00223 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCBlock.html#1384c2c58407756956aeb073865eac62" title="Set block&#39;s parse tree.">SetCodeList</a>( <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* list ); <a name="l00228"></a>00228 vector<CBlock*>* <a class="code" href="classCBlock.html#e9ba7423fbda625ed443792a59d3d87c" title="Get list of block&#39;s child blocks.">GetChildList</a>(); <a name="l00233"></a><a class="code" href="classCBlock.html#6793d204098d1dbfd7d7acae2d44a150">00233</a> <span class="keyword">virtual</span> vector<CPortDir*>* <a class="code" href="classCBlock.html#6793d204098d1dbfd7d7acae2d44a150" title="Get list of block&#39;s port declarations.">GetPortDirList</a>() <a name="l00234"></a>00234 { <span class="keyword">static</span> vector<CPortDir*> nullList; <span class="keywordflow">return</span> &nullList;} <a name="l00239"></a>00239 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCBlock.html#ebf3a390fea8f2748d9d253a7bc936e7" title="Set block&#39;s symbol table.">SetSymtab</a>( <a class="code" href="classCSymtab.html" title="Aux class used to create symbol table scoping.">CSymtab<CDecl></a>& <a class="code" href="classCBlock.html#e3e5968ce31846451f6e2babcdaa868b">symtab</a> ); <a name="l00244"></a><a class="code" href="classCBlock.html#b3c8fb804aebc1f5f418f769bd079ae0">00244</a> <span class="keyword">virtual</span> <a class="code" href="classCSymtab.html" title="Aux class used to create symbol table scoping.">CSymtab<CDecl></a>& <a class="code" href="classCBlock.html#b3c8fb804aebc1f5f418f769bd079ae0" title="Get block&#39;s symbol table.">GetSymtab</a>() { <span class="keywordflow">return</span> <a class="code" href="classCBlock.html#e3e5968ce31846451f6e2babcdaa868b">symtab</a>; } <a name="l00249"></a>00249 <span class="keywordtype">void</span> <a class="code" href="classCDecl.html#a5ecfff625616b81a4de3fce4e6d0cb3">PreVisit1</a>( <span class="keywordtype">int</span> (*func)(<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*,<span class="keywordtype">void</span>*), <span class="keywordtype">void</span>* data ); <a name="l00250"></a>00250 <span class="keywordtype">void</span> <a class="code" href="classCDecl.html#e71ba72ce0fc7e32db9cd38d6f738a44">PostVisit1</a>( <span class="keywordtype">void</span> (*func)(<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*, <span class="keywordtype">void</span>*), <span class="keywordtype">void</span>* data ); <a name="l00251"></a>00251 <span class="keywordtype">void</span> <a class="code" href="classCDecl.html#e6e0d93143738a4d226cca8314a92cfe">PostSubVisit1</a>( <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>* (*func)(<a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a>*, <span class="keywordtype">void</span>*), <span class="keywordtype">void</span>* data ); <a name="l00252"></a>00252 <span class="keyword">protected</span>: <a name="l00253"></a>00253 <span class="keyword">static</span> <span class="keywordtype">void</span> Reconnect( <a class="code" href="classCNode.html" title="Primary data structure representing parse tree nodes.">CNode</a> *n ); <a name="l00254"></a>00254 <span class="keywordtype">void</span> RedeclarePorts(); <a name="l00255"></a>00255 <span class="keywordtype">void</span> LinkFrefs( <a class="code" href="classCSymtab.html" title="Aux class used to create symbol table scoping.">CSymtab<CDecl></a>& <a class="code" href="main_8cc.html#51c09f837941ecd89bb076d0dea4dd31">portSymtab</a>, <a name="l00256"></a>00256 <a class="code" href="classCSymtab.html" title="Aux class used to create symbol table scoping.">CSymtab<CDecl></a>& <a class="code" href="main_8cc.html#bcc83f183d512ccc33536918f7a299e6">moduleSymtab</a>, <a name="l00257"></a>00257 vector<CFref*>& <a class="code" href="classCBlock.html#7ab505f0ec937c1bef72fe9458e36ed1">frefList</a>, <a name="l00258"></a>00258 <span class="keywordtype">int</span> <a class="code" href="main_8cc.html#3deee65292b7f2ddfe674f4f63fcb3f9">inferVectors</a> ); <a name="l00259"></a>00259 <span class="keyword">virtual</span> <span class="keywordtype">void</span> CodeListChanged() {} <a name="l00260"></a>00260 <span class="keyword">private</span>: <a name="l00261"></a>00261 <span class="keywordtype">void</span> LinkPortFref( <a class="code" href="classCSymtab.html" title="Aux class used to create symbol table scoping.">CSymtab<CDecl></a>* symtab1, <a name="l00262"></a>00262 <a class="code" href="classCSymtab.html" title="Aux class used to create symbol table scoping.">CSymtab<CDecl></a>* symtab2, <a name="l00263"></a>00263 <a class="code" href="classCFref.html" title="Forward reference declaration.">CFref</a>* fref ); <a name="l00264"></a>00264 <span class="keywordtype">void</span> InferFref( <a class="code" href="classCSymtab.html" title="Aux class used to create symbol table scoping.">CSymtab<CDecl></a>* symtab1, <a name="l00265"></a>00265 <a class="code" href="classCFref.html" title="Forward reference declaration.">CFref</a>* fref, <a name="l00266"></a>00266 <span class="keywordtype">int</span> inferVector ); <a name="l00267"></a>00267 <span class="keywordtype">void</span> LinkFref( <a class="code" href="classCSymtab.html" title="Aux class used to create symbol table scoping.">CSymtab<CDecl></a>* <a class="code" href="classCBlock.html#e3e5968ce31846451f6e2babcdaa868b">symtab</a>, <a name="l00268"></a>00268 <a class="code" href="classCFref.html" title="Forward reference declaration.">CFref</a>* fref, <span class="keywordtype">int</span> inferVector ); <a name="l00272"></a>00272 }; <a name="l00273"></a>00273 <a name="l00277"></a>00277 <span class="keyword">typedef</span> <a class="code" href="classCBlock.html" title="Declaration class for block constructs.">CBlock</a> <a class="code" href="classCBlock.html" title="Declaration class for block constructs.">CScope</a>; <a name="l00278"></a>00278 <a name="l00279"></a>00279 <a name="l00280"></a>00280 <span class="preprocessor">#endif // CBLOCK_HPP</span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Wed Oct 21 18:05:32 2009 for vrq by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address> </body> </html>