@@ -475,15 +475,15 @@ inline void set_{{ variable.get_name() }}(const {{ declarations.print_variable_t
475475 * Update internal state (``S_``) of the synapse according to the dynamical equations defined in the model and the statements in the ``update`` block.
476476 **/
477477 inline void
478- update_internal_state_(double t_start, double timestep, const {{synapseName}}CommonSynapseProperties& cp);
478+ update_internal_state_(double t_start, double timestep, const {{ synapseName }}CommonSynapseProperties& cp);
479479
480480 void recompute_internal_variables();
481481
482482 std::string get_name() const;
483483
484484public:
485485 // this line determines which common properties to use
486- typedef {{synapseName}}CommonSynapseProperties CommonPropertiesType;
486+ typedef {{ synapseName }}CommonSynapseProperties CommonPropertiesType;
487487
488488 typedef Connection< targetidentifierT > ConnectionBase;
489489
@@ -846,7 +846,7 @@ void get_entry_from_continuous_variable_history(double t,
846846{#- post spike based: grab the entry from the post spiking history buffer #}
847847{% - if continuous_state_buffering_method == "post_spike_based" %}
848848{% - for var_name in paired_neuron .state_vars_that_need_continuous_buffering %}
849- {% - set var_name_post = utils .get_var_name_tuples_of_neuron_synapse_pair (continuous_post_ports , var_name ) %}
849+ {% - set var_name_post = utils .get_var_name_tuples_of_neuron_synapse_pair (continuous_post_ports , var_name ) %}
850850 const double __{{ var_name }} = start->{{ var_name }}_;
851851{% - endfor %}
852852{% - endif %}
@@ -930,7 +930,7 @@ void get_entry_from_continuous_variable_history(double t,
930930 * update synapse internal state from `t_lastspike_` to `__t_spike`
931931 **/
932932{% - if vt_ports is defined and vt_ports |length > 0 %}
933- {% - set vt_port = vt_ports [0] %}
933+ {% - set vt_port = vt_ports [0] %}
934934 process_{{vt_port}}_spikes_( vt_spikes, t_lastspike_, __t_spike, cp );
935935{% - endif %}
936936
@@ -1058,16 +1058,32 @@ constexpr ConnectionModelProperties {{synapseName}}< targetidentifierT >::proper
10581058{% - endif %}
10591059{% - if vt_ports is defined and vt_ports |length > 0 %}
10601060{% - set vt_port = vt_ports [0] %}
1061+
1062+ /**
1063+ * Handler for volume transmitter spikes
1064+ **/
10611065template < typename targetidentifierT >
10621066void
1063- {{synapseName}}< targetidentifierT >::process_{{vt_port}}_spikes_( const std::vector< spikecounter >& vt_spikes,
1067+ {{synapseName}}< targetidentifierT >::process_{{ vt_port }}_spikes_( const std::vector< spikecounter >& vt_spikes,
10641068 double t0,
10651069 double t1,
10661070 const {{synapseName}}CommonSynapseProperties& cp )
10671071{
10681072#ifdef DEBUG
10691073 std::cout << "[synapse " << this << "] {{ synapseName }}::process_{{ vt_port }}_spikes_(): t0 = " << t0 << ", t1 = " << t1 << "\n";
10701074#endif
1075+
1076+ const size_t tid = kernel().vp_manager.get_thread_id();
1077+ {% - if paired_neuron_name is not none and paired_neuron_name |length > 0 %}
1078+ typedef {{ paired_neuron_name }} post_neuron_t;
1079+ {{ paired_neuron_name }}* __target = static_cast< {{ paired_neuron_name }}* >(get_target(tid));
1080+ assert(__target);
1081+ {% for var_name in paired_neuron .state_vars_that_need_continuous_buffering %}
1082+ {% - set var_name_post = utils .get_var_name_tuples_of_neuron_synapse_pair (continuous_post_ports , var_name ) %}
1083+ const double __{{ var_name }} = ((post_neuron_t*)(__target))->get_{{ var_name_post }}();
1084+ {% - endfor %}
1085+ {% - endif %}
1086+
10711087 // process dopa spikes in (t0, t1]
10721088 // propagate weight from t0 to t1
10731089 if ( ( vt_spikes.size() > vt_spikes_idx_ + 1 )
@@ -1529,8 +1545,9 @@ inline void
15291545}
15301546
15311547{% - if vt_ports is defined and vt_ports |length > 0 %}
1548+
15321549/**
1533- * Update to end of timestep ``t_trig``, while processing vt spikes and post spikes
1550+ * Update synapse internal state to end of timestep ``t_trig``, while processing vt spikes and post spikes
15341551**/
15351552template < typename targetidentifierT >
15361553{% - if not (nest_version .startswith ("v2" ) or nest_version .startswith ("v3.0" ) or nest_version .startswith ("v3.1" ) or nest_version .startswith ("v3.2" ) or nest_version .startswith ("v3.3" ) or nest_version .startswith ("v3.4" )) %}
@@ -1554,8 +1571,15 @@ inline void
15541571
15551572 const size_t tid = kernel().vp_manager.get_thread_id();
15561573{% - if paired_neuron_name is not none and paired_neuron_name |length > 0 %}
1574+ typedef {{ paired_neuron_name }} post_neuron_t;
15571575 {{ paired_neuron_name }}* __target = static_cast< {{ paired_neuron_name }}* >(get_target(tid));
15581576 assert(__target);
1577+
1578+ {% for var_name in paired_neuron .state_vars_that_need_continuous_buffering %}
1579+ {% - set var_name_post = utils .get_var_name_tuples_of_neuron_synapse_pair (continuous_post_ports , var_name ) %}
1580+ const double __{{ var_name }} = ((post_neuron_t*)(__target))->get_{{ var_name_post }}();
1581+ {% - endfor %}
1582+
15591583{% - else %}
15601584 Node* __target = get_target( tid );
15611585{% - endif %}
@@ -1602,7 +1626,7 @@ inline void
16021626{#- post spike based: grab the entry from the post spiking history buffer #}
16031627{% - if continuous_state_buffering_method == "post_spike_based" %}
16041628{% - for var_name in paired_neuron .state_vars_that_need_continuous_buffering %}
1605- {% - set var_name_post = utils .get_var_name_tuples_of_neuron_synapse_pair (continuous_post_ports , var_name ) %}
1629+ {% - set var_name_post = utils .get_var_name_tuples_of_neuron_synapse_pair (continuous_post_ports , var_name ) %}
16061630 const double __{{ var_name }} = start->{{ var_name }}_;
16071631{% - endfor %}
16081632{% - endif %}
@@ -1616,14 +1640,16 @@ inline void
16161640{% - filter indent (6, True ) %}
16171641{% - if post_ports is defined %}
16181642{% - for post_port in spiking_post_ports %}
1643+ {% - set dynamics = synapse .get_on_receive_block (post_port ) %}
1644+ {% - if dynamics is not none %}
16191645 /**
1620- * NESTML generated onReceive code block for postsynaptic port "{{post_port}}" begins here!
1646+ * NESTML generated onReceive code block for postsynaptic port "{{ post_port }}" begins here!
16211647 **/
16221648
1623- {% - set dynamics = synapse . get_on_receive_block ( post_port ) %}
1624- {% - with ast = dynamics . get_stmts_body () %}
1625- {% - include "directives_cpp/StmtsBody.jinja2" %}
1626- {% - endwith %}
1649+ {% - with ast = dynamics . get_stmts_body ( ) %}
1650+ {% - include "directives_cpp/StmtsBody.jinja2" %}
1651+ {% - endwith %}
1652+ {% - endif %}
16271653{% - endfor %}
16281654{% - endif %}
16291655{% - endfilter %}
@@ -1659,7 +1685,6 @@ inline void
16591685 t_lastspike_ = t_trig;
16601686}
16611687
1662-
16631688{% - endif %}
16641689
16651690} // namespace {{ synapseName }};
0 commit comments