From 4b3cfcfaadc2f31c21f1c8f486a7fc7c164a81d3 Mon Sep 17 00:00:00 2001 From: Luc Grosheintz Date: Fri, 1 Dec 2023 11:00:22 +0100 Subject: [PATCH] Stubs of `nrn_{alloc,init,jacob,cur,state}`. --- src/codegen/codegen_neuron_cpp_visitor.cpp | 14 ++++++++++++-- src/codegen/codegen_neuron_cpp_visitor.hpp | 11 +++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/codegen/codegen_neuron_cpp_visitor.cpp b/src/codegen/codegen_neuron_cpp_visitor.cpp index f4b3747ce0..ccda553d42 100644 --- a/src/codegen/codegen_neuron_cpp_visitor.cpp +++ b/src/codegen/codegen_neuron_cpp_visitor.cpp @@ -453,6 +453,13 @@ void CodegenNeuronCppVisitor::print_global_function_common_code(BlockType type, return; } +void CodegenNeuronCppVisitor::print_nrn_init() { + printer->add_line("void nrn_init(_nrn_model_sorted_token const&, NrnThread*, Memb_list*, int) {}"); +} + +void CodegenNeuronCppVisitor::print_nrn_jacob() { + printer->add_line("void nrn_jacob(_nrn_model_sorted_token const&, NrnThread* _nt, Memb_list* _ml_arg, int _type) {}"); +} /// TODO: Edit for NEURON void CodegenNeuronCppVisitor::print_nrn_constructor() { @@ -468,6 +475,7 @@ void CodegenNeuronCppVisitor::print_nrn_destructor() { /// TODO: Print the equivalent of `nrn_alloc_` void CodegenNeuronCppVisitor::print_nrn_alloc() { + printer->add_line("void nrn_alloc(Prop*) {}"); return; } @@ -484,7 +492,7 @@ void CodegenNeuronCppVisitor::print_nrn_state() { } codegen = true; - printer->add_line("void nrn_state() {}"); + printer->add_line("void nrn_state(_nrn_model_sorted_token const& sorted_token, NrnThread* nt, Memb_list* ml, int type) {}"); /// TODO: Fill in codegen = false; @@ -534,7 +542,7 @@ void CodegenNeuronCppVisitor::print_nrn_cur() { codegen = true; - printer->add_line("void nrn_cur() {}"); + printer->add_line("void nrn_cur(_nrn_model_sorted_token const& sorted_token, NrnThread* nt, Memb_list* ml, int type) {}"); /// TODO: Fill in codegen = false; @@ -641,8 +649,10 @@ void CodegenNeuronCppVisitor::print_g_unused() const { /// TODO: Edit for NEURON void CodegenNeuronCppVisitor::print_compute_functions() { + print_nrn_init(); print_nrn_cur(); print_nrn_state(); + print_nrn_jacob(); } diff --git a/src/codegen/codegen_neuron_cpp_visitor.hpp b/src/codegen/codegen_neuron_cpp_visitor.hpp index e8bf7e36af..56387e4ffa 100644 --- a/src/codegen/codegen_neuron_cpp_visitor.hpp +++ b/src/codegen/codegen_neuron_cpp_visitor.hpp @@ -360,6 +360,17 @@ class CodegenNeuronCppVisitor: public CodegenCppVisitor { virtual void print_global_function_common_code(BlockType type, const std::string& function_name = "") override; + /** + * Print nrn_init function definition + * + */ + void print_nrn_init(); + + /** + * Print nrn_init function definition + * + */ + void print_nrn_jacob(); /** * Print nrn_constructor function definition