Skip to content

Commit

Permalink
Stubs of nrn_{alloc,init,jacob,cur,state}.
Browse files Browse the repository at this point in the history
  • Loading branch information
1uc committed Dec 1, 2023
1 parent 5bae4d0 commit 4b3cfcf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/codegen/codegen_neuron_cpp_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -468,6 +475,7 @@ void CodegenNeuronCppVisitor::print_nrn_destructor() {

/// TODO: Print the equivalent of `nrn_alloc_<mech_name>`
void CodegenNeuronCppVisitor::print_nrn_alloc() {
printer->add_line("void nrn_alloc(Prop*) {}");
return;
}

Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}


Expand Down
11 changes: 11 additions & 0 deletions src/codegen/codegen_neuron_cpp_visitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4b3cfcf

Please sign in to comment.