Coolquest, Inc. | Home | Products | Support | About | Contact | |||
|
Design Home | << File View >> | Class View | Output (partial) | Parts Library | Examples Home |
/* *\ Copyright (C) 2007 Coolquest, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. For more about the CBOLD framework and Coolquest, Inc., see www.cbold.com. \* */ // file simple.cpp: example simple design file #include "cb_base.h" #include "cb_views.h" #include "cb_xconstraints.h" // include FPGA pin location constraint file generator if used #include "cb_netlist_al3p.h" // include desired netlist generators #include "cb_netlist_pp.h" // include design's main header file #include "simple.h" // <=== change this to match the name of your design's main header file -- be sure the included file's directory is in your compiler's include path // This is the design's main file. <=== // No changes are required below unless you want to change/add output functionality. <=== // See also simple.h and simple_sub.h. <=== #pragma argsused int main( int argc, char* argv[] ) { try { TLogStatus Log( cout ); CM_Root Root; // CM_Root is always the highest-level module of a project //Root.VerboseNetList = false; // false --> speed execution, but Root's TNetList will not contain PinSpec's for Module and Bundle Ports Log << "Registering"; reg( Root ); // register highest-level module Log << "Assigning reference designators"; // read in previously assigned designators, if any #if 0 ifstream DSrce; OpenFileI( DSrce, DESIGN_NAME "_old_designators.txt" ); Root.ReadReferenceDesignators( DSrce ); DSrce.close(); #endif Root.AssignReferenceDesignators(); Root.CheckReferenceDesignators(); // check for duplicates #if 1 // >>> write out all designators before layout commences // write out designators for possible future use ofstream DDest; OpenFileO( DDest, OUTPUT_BASE "_new_designators.txt" ); Root.WriteReferenceDesignators( DDest ); DDest.close(); #endif Log << "Connecting"; Root.ConnectAll(); // wire up hierarchy Log << "Post-Connecting"; Root.PostConnectAll(); // perform any user-specified post-connect processing Log << "Creating CAD netlists"; ofstream NetDest; OpenFileO( NetDest, OUTPUT_BASE "_3P.net" ); OutputCad3P( &Root, NetDest, true ); // output in standard format NetDest.close(); OpenFileO( NetDest, OUTPUT_BASE "_PP.net" ); OutputCadPP( &Root, NetDest, true ); // output in standard format NetDest.close(); Log << "Creating bill of materials"; ofstream BOM_Dest; OpenFileO( BOM_Dest, OUTPUT_BASE "_bom.txt" ); Root.OutputBOM( BOM_Dest ); // output bill of materials BOM_Dest.close(); #if 0 Log << "Creating constraint files"; // output constraint files TXConstraints Constraints; // ... // See the IROD example design for examples of constraint file generation. #endif // device files are rarely used #if 0 // **** warning **** the specified device file directory must already exist Log << "Creating device files"; MakeDeviceFiles( &Root, "DeviceFiles" ); #endif Log << "Creating symbolic netlist"; ofstream View1_Dest; OpenFileO( View1_Dest, OUTPUT_BASE "_SymNetlist.txt" ); TViewSymbolicNetlist View1; View1.ShowAllPins = true; View1.SetBriefNetLimit( 4 ); // output entire net if less than 4 connections, else output net name only #if 0 // list some nets in non-verbose format -- no longer needed -- see TViewSymbolicNetlist::SetBriefNetLimit View1.AddBriefNet( "/NC", "GND", "VCC5", "VCC3" ); #endif View1.Dump( View1_Dest, &Root ); // ouput symbolic netlist view: parts and nets View1_Dest.close(); OpenFileO( View1_Dest, OUTPUT_BASE "_SymNets.txt" ); View1.DumpNets( View1_Dest, &Root ); // ouput symbolic view: nets only View1_Dest.close(); OpenFileO( View1_Dest, OUTPUT_BASE "_SymBriefNets.txt" ); View1.DumpBriefNets( View1_Dest, &Root ); // ouput symbolic view: brief nets only View1_Dest.close(); OpenFileO( View1_Dest, OUTPUT_BASE "_SymParts.txt" ); View1.DumpParts( View1_Dest, &Root ); // ouput symbolic view: parts only View1_Dest.close(); OpenFileO( View1_Dest, OUTPUT_BASE "_SymModules.txt" ); View1.DumpModules( View1_Dest, &Root ); // ouput symbolic view: modules only View1_Dest.close(); //View1.SetBriefPathChar( '_' ); // enable brief paths in part connection lists OpenFileO( View1_Dest, OUTPUT_BASE "_SymNetlist.html" ); View1.DumpHTML( View1_Dest, &Root ); // ouput symbolic view: HTML version View1_Dest.close(); #if 0 Log << "Creating layout script files"; // output script (.do) files TGenLayoutScript LayoutScript; LayoutScript.GenerateScriptFile( &Root ); #endif Log << "Creating netlist dump"; ofstream NetDumpDest; OpenFileO( NetDumpDest, OUTPUT_BASE "_NetlistDump.txt" ); Root.DumpSortedNetList( NetDumpDest, true ); // true --> dump all, including PinSpec's for non-part ports NetDumpDest.close(); Log << "Creating database dump"; ofstream Dest; OpenFileO( Dest, OUTPUT_BASE "_DatabaseDump.txt" ); Root.DumpGlobals( Dest ); Root.DumpAll( Dest ); Root.DumpNetList( Dest ); TSubBusList NonListed; Root.AddNonListedPortRanges( &NonListed ); Dest << "\n\nThe entire range of all ports should be listed (i.e., connected):"; Dest << "\n Ports of TParts and TModules should be listed in the Part/Module's Owner's SubBusList or the Global SubBusList."; Dest << "\n Ports of TModules should also be listed in the Module's SubBusList, unless they are listed in the Global SubBusList."; Dest << "\n Ports of TBundle's are similar to ports of their ultimate owner TModule."; Dest << "\n\nTotal nonconforming port ranges: " << NonListed.GetSubBusCount(); if ( NonListed.GetSubBusCount() ) { Dest << " (listed below).\n"; NonListed.DumpAll( Dest ); } TNet NonWired; // form net containing all non-wired pins Root.AddNonWiredPins( &NonWired ); Dest << "\n\nNon-wired pins:"; NonWired.DumpAsPortRanges( Dest ); // dump as PortRange's (rather than PinSpec's) for readability Dest << "\n\nSingle-node nets:"; int SingleNodeNets = Root.DumpSingleNodeNets( Dest ); Dest << "\n\nNo-connect net (" << NoConnect << "):"; int NoConnects = Root.DumpNoConnectNet( Dest ); Dest << "\n"; Dest << "\nTotal nonconforming port ranges: " << NonListed.GetSubBusCount() << "."; Dest << "\nTotal non-wired PinSpecs: " << NonWired.GetPinSpecCount() << "."; Dest << "\nTotal single-node nets: " << SingleNodeNets << "."; Dest << "\nTotal PinSpecs in no-connect net: " << NoConnects << "."; Dest << "\nTotal Nets: " << Root.GetNetCount() << "."; Dest << "\n\nEnd of Dump\n"; Dest.close(); Log.End(); cout << "\nTotal nonconforming port ranges: " << NonListed.GetSubBusCount() << "."; cout << "\nTotal non-wired PinSpecs: " << NonWired.GetPinSpecCount() << "."; cout << "\nTotal single-node nets: " << SingleNodeNets << "."; cout << "\nTotal PinSpecs in no-connect net: " << NoConnects << "."; cout << "\nTotal Nets: " << Root.GetNetCount() << "."; cout << "\n"; if ( argc == 1 ) { // any command line argument disables the terminal user prompt cout << "\nPress Enter to continue.\n" << flush; cin.get(); } } // end of try block catch ( string& aString ) { cout << "\n\nError: " << aString << '\n'; MessageIfError( cout, TModPar::RegisteringModPar, "registering" ); MessageIfError( cout, TModPar::PostConnectingModPar, "post-connecting" ); MessageIfError( cout, TModule::ConnectingModule, "connecting" ); cin.get(); return 1; // error } return 0; // no error }
Design Home | << File View >> | Class View | Output (partial) | Parts Library | Examples Home |
Legal | Copyright © 2007 by Coolquest, Inc. | Contact |