From ff9b8bb838ecdfbfc1dc81038fcf3b2a87636982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Zrounba?= <6691770+clement-z@users.noreply.github.com> Date: Sat, 30 Sep 2023 23:06:01 +0200 Subject: Initial release --- src/devices/octane_cell.h | 61 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 src/devices/octane_cell.h (limited to 'src/devices/octane_cell.h') diff --git a/src/devices/octane_cell.h b/src/devices/octane_cell.h new file mode 100644 index 0000000..aadcd20 --- /dev/null +++ b/src/devices/octane_cell.h @@ -0,0 +1,61 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +/** The minimal octane cell composed of merger, waveguides, PCM and a detector. */ +/** For now, all photonic parameters will be internal and constant. The only */ +/** one that can be changed is the PCM levels.*/ + +//TODO: pass element's characteristics as argument, for instance, pass an example of waveguide, +// or an example of DC, PCM such that it copies. Requires: constructors in each element to build +// by copying. + +class OctaneCell : public sc_module { +public: + // Ports + /** The optical input ports. */ + sc_port> p_in_r, p_in_c; + /** The electrical output port. */ + sc_out p_readout; + + // Member variables + double m_meltEnergy; + bool m_isCompact; + int m_nStates; + + // Wires + sc_signal m_merg_in1, m_merg_in2, m_merg_out, m_pcm_in, m_pcm_out, m_pd_in; + + // Member submodules + unique_ptr m_wg1, m_wg2, m_wg3, m_wg4; + unique_ptr m_merger; + unique_ptr m_pcm; + unique_ptr m_pd; + + // This function should be called right after + // Instantiation (either declaration or make_shared or new) + void init(); + void init_compact(); + void init_full(); + + /** Constructor for Waveguide + * + * @param name name of the module + * @param meltEnergy energy needed to amorphize by one step + * @param nStates number of internal states supported by the PCM + * */ + OctaneCell(sc_module_name name, double meltEnergy = 10e-12, int nStates = 63, bool isCompact = false) + : sc_module(name) + , m_meltEnergy(meltEnergy) + , m_isCompact(isCompact) + , m_nStates(nStates) + { + } + +}; -- cgit v1.2.3