diff options
| author | Clément Zrounba <clement.zrounba@ec-lyon.fr> | 2023-11-23 18:49:56 +0000 |
|---|---|---|
| committer | Clément Zrounba <clement.zrounba@ec-lyon.fr> | 2023-11-23 18:56:41 +0000 |
| commit | 36505655a3f8e709b2ea91d43f08b32485d0659f (patch) | |
| tree | b656760f99f682ff0c08d6b2387eba07ade5dfed /src/devices/pcm_device.h | |
| parent | 7a6345e2a4068de676e879e79f8c31965ecd0771 (diff) | |
| download | specs-36505655a3f8e709b2ea91d43f08b32485d0659f.tar.gz specs-36505655a3f8e709b2ea91d43f08b32485d0659f.zip | |
update PCM device and add parameters to parser
Diffstat (limited to 'src/devices/pcm_device.h')
| -rw-r--r-- | src/devices/pcm_device.h | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/src/devices/pcm_device.h b/src/devices/pcm_device.h index 4510591..f746ace 100644 --- a/src/devices/pcm_device.h +++ b/src/devices/pcm_device.h @@ -24,33 +24,46 @@ public: typedef pair<double,double> pulse_sample_t; // Member variables - double m_meltEnergy; - int m_state; - int m_nStates; - double m_transmission = 1; - double influence_time_ns = 1; + double m_Tc = 0; /* Transmission (power) in initial (fully crystalline) state */ + double m_Ta = 1; /* Transmission (power) in final (fully amorphous) state */ + double m_meltEnergy; /* Programming threshold*/ + int m_nStates; /* Total number of states */ + double m_influence_time_ns = 1; /* Duration for which energy is maintained (hard threshold for representing thermal losses)*/ + double m_speed = 3; /* Parameter affecting the transmission curve and how fast transmission saturates */ + + int m_stateCurrent = 0; /* Current state */ + double m_Tcurrent = 0; /* Current transmission (power) */ + double m_Tcurrent_field = 0; /* Current transmission (field) */ /** Current information about the optical input, before any attenuation and phase shift. */ - double m_last_pulse_power; + double m_last_pulse_power = 0; std::map<uint32_t,OpticalSignal::field_type> m_memory_in; - // Processes void on_input_changed(); + + // Member functions bool phase_change(const vector<pulse_sample_t> &vec, const bool &local); void update_transmission_local(); - // Constructor PCMElement(sc_module_name name, double meltEnergy = 0, int nStates = 0, - int state = 0) + int state = 0, + double Tc = 0, + double Ta = 0, + double influence_window_ns = 1, + double speed = 3) : spx_module(name) , m_out_writer("out_delayed_writer", p_out) + , m_Tc(Tc) + , m_Ta(Ta) , m_meltEnergy(meltEnergy) - , m_state(state) , m_nStates(nStates) + , m_influence_time_ns(influence_window_ns) + , m_speed(speed) + , m_stateCurrent(state) { SC_HAS_PROCESS(PCMElement); |
