1 /* Copyright (c) 2012 Massachusetts Institute of Technology
3 * Permission is hereby granted, free of charge, to any person obtaining a copy
4 * of this software and associated documentation files (the "Software"), to deal
5 * in the Software without restriction, including without limitation the rights
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 * copies of the Software, and to permit persons to whom the Software is
8 * furnished to do so, subject to the following conditions:
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 #ifndef __DSENT_MODEL_OPTICALGRAPH_OPTICALGRAPH_H__
23 #define __DSENT_MODEL_OPTICALGRAPH_OPTICALGRAPH_H__
27 #include "util/CommonType.h"
28 #include "model/optical_graph/OpticalNode.h"
33 class OpticalWavelength
;
38 // The visited number for the next timing run. This needs to be
39 // global because several timing trees may be created to evaluate
40 // a single timing path, causing problems
44 // Construct timing tree that watches over model_
45 OpticalGraph(const String
& instance_name_
, OpticalModel
* model_
);
50 const String
& getInstanceName() const;
51 // Perform datapath power optimization by balancing insertion loss and extinction
52 // ratio with modulator/receiver and laser power, returns false if there are no
53 // designs that are possible
54 bool performPowerOpt(OpticalNode
* node_
, const WavelengthGroup
& wavelengths_
, unsigned int number_detectors_
, double util_
);
55 // Recursively trace a wavelength starting from an OpticalLaser
56 // source finding all lasers, modulators and detectors that a
57 // wavelength group hits.
58 OpticalWavelength
* traceWavelength(const WavelengthGroup
& wavelengths_
, OpticalNode
* node_
);
59 OpticalWavelength
* traceWavelength(OpticalWavelength
* wavelength_
, OpticalNode
* node_
, OpticalLaser
* laser_
, OpticalModulator
* modulator_
, double loss_
);
61 OpticalModel
* getModel();
65 // Disable the use of copy constructor
66 OpticalGraph(const OpticalGraph
& graph_
);
69 // Set the sequence number of the optical graph
70 static void setTreeNum(int tree_num_
);
71 static int getTreeNum();
74 // Name of the optical graph
75 const String m_instance_name_
;
76 // A pointer to the model that contains this node
77 OpticalModel
* m_model_
;
79 }; // class OpticalGraph
82 #endif // __DSENT_MODEL_OPTICALGRAPH_OPTICALGRAPH_H__