diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2014-10-11 15:02:23 -0500 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2014-10-11 15:02:23 -0500 |
commit | e8ed7b1d1b5bef31e9874f679a5797c2e00d06f1 (patch) | |
tree | 421c9c50377aa664958685914f5504c4c019e21f /ext/dsent/model/optical_graph/OpticalWavelength.h | |
parent | a098fad174d8559037602b248b8e6f7f46bfebbb (diff) | |
download | gem5-e8ed7b1d1b5bef31e9874f679a5797c2e00d06f1.tar.xz |
ext: add the source code for DSENT
This patch adds a tool called DSENT to the ext/ directory. DSENT
is a tool that models power and area for on-chip networks. The next
patch adds a script for using the tool.
Diffstat (limited to 'ext/dsent/model/optical_graph/OpticalWavelength.h')
-rw-r--r-- | ext/dsent/model/optical_graph/OpticalWavelength.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/ext/dsent/model/optical_graph/OpticalWavelength.h b/ext/dsent/model/optical_graph/OpticalWavelength.h new file mode 100644 index 000000000..6a5f31e9a --- /dev/null +++ b/ext/dsent/model/optical_graph/OpticalWavelength.h @@ -0,0 +1,57 @@ +#ifndef __DSENT_MODEL_OPTICALGRAPH_OPTICALWAVELENGTH_H__ +#define __DSENT_MODEL_OPTICALGRAPH_OPTICALWAVELENGTH_H__ + +#include "model/OpticalModel.h" +#include "util/CommonType.h" + +namespace DSENT +{ + // Optical datapath structure storing a detector table consisting of a + // detector, the loss to that detector, and the modulator driving + // the wavelength for that detector + struct OpticalDataPath + { + OpticalLaser* laser; + OpticalModulator* modulator; + vector<OpticalDetector*> detectors; + vector<double> losses; + + OpticalDataPath(OpticalLaser* laser_, OpticalModulator* modulator_, OpticalDetector* detector_, double loss_) + : laser(laser_), modulator(modulator_), detectors(1, detector_), losses(1, loss_) {} + }; + + class OpticalWavelength + { + // A data structure of a wavelength (or a group of wavelengths). This + // keeps track of all lasers sources, modulators, and detectors that + // the wavelength hits. + public: + OpticalWavelength(const String& instance_name_, const WavelengthGroup& wavelengths_); + ~OpticalWavelength(); + + public: + // Get tree name + const String& getInstanceName() const; + // Get wavelength groups + WavelengthGroup getWavelengths() const; + // Add a datapath for this wavelength + void addDataPath(OpticalLaser* laser_, OpticalModulator* modulator_, OpticalDetector* detector_, double loss_); + const vector<OpticalDataPath>* getDataPaths() const; + // Calculate required wavelength power to reach some number of detectors + // If number_detectors < the number of total detectors this wavelength hits then + // it simply returns the laser power required to reach the worst-case detectors + double getLaserPower(unsigned int number_detectors_) const; + + private: + // Name of the wavelength + const String m_instance_name_; + // Keeps track of the wavelengths + const WavelengthGroup m_wavelengths_; + // Keeps track of a table of laser, detector, modulator mappings + vector<OpticalDataPath>* m_data_paths_; + }; + +} // namespace DSENT + +#endif // __DSENT_MODEL_OPTICALGRAPH_OPTICALWAVEGUIDE_H__ + |