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/OpticalModulator.cc | |
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/OpticalModulator.cc')
-rw-r--r-- | ext/dsent/model/optical_graph/OpticalModulator.cc | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/ext/dsent/model/optical_graph/OpticalModulator.cc b/ext/dsent/model/optical_graph/OpticalModulator.cc new file mode 100644 index 000000000..662560341 --- /dev/null +++ b/ext/dsent/model/optical_graph/OpticalModulator.cc @@ -0,0 +1,54 @@ + +#include "model/optical_graph/OpticalModulator.h" +#include "model/optical_graph/OpticalTransmitter.h" + +namespace DSENT +{ + OpticalModulator::OpticalModulator(const String& instance_name_, OpticalModel* model_, const WavelengthGroup& wavelengths_, bool opt_loss_, OpticalTransmitter* transmitter_) + : OpticalNode(OpticalNode::MODULATOR, instance_name_, model_, wavelengths_), m_transmitter_(transmitter_), m_insertion_loss_(0), m_extinction_ratio_(0), m_opt_loss_(opt_loss_) + { + + } + + OpticalModulator::~OpticalModulator() + { + + } + + bool OpticalModulator::canOptimizeLoss() const + { + return m_opt_loss_; + } + + void OpticalModulator::setLosses(double IL_dB_, double ER_dB_) + { + m_insertion_loss_ = IL_dB_; + m_extinction_ratio_ = ER_dB_; + + return; + } + + bool OpticalModulator::setModulatorSpec(double IL_dB_, double ER_dB_) + { + // Ask the transmitter to design to those specs, returns success or fail + return m_transmitter_->setTransmitterSpec(IL_dB_, ER_dB_); + } + + double OpticalModulator::getPower(double util_) const + { + return m_transmitter_->getPower(util_); + } + + double OpticalModulator::getInsertionLoss() const + { + return m_insertion_loss_; + } + + double OpticalModulator::getExtinctionRatio() const + { + return m_extinction_ratio_; + } + +} // namespace DSENT + + |