-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create mechanism instance struct in LLVM IR #507
Conversation
TODO: - Same should happen for codegen_int_variables, codegen_global_variables, codegen_shadow_variables - Check especially codegen_global_variables - Move small utility functions from CodegenCVisitor to codeged_utils
- Needs testing
This reverts commit f522cb4.
- Removed non working blocks from procedure.mod - Added unit test for global variable
- Add float and int variables - Moved get_int_variables, get_shadow_variables and get_float_variables to codegen_info
- Removed debugging printf - Added some comments - Improved unit test
@iomaganaris A quick question about the Mech struct. The pointers point to the arrays of these variables that define current, conductivity, etc, across different points on the membrane. (By that I mean that NEURON user can define segments within the model that have their own properties). Do we know the sizes of the arrays they point to at compile time? |
@georgemitenkov As far as I know the sizes of the arrays are defined during run time according to the number of cells and segments per cell. @pramodk can correct me if I am wrong. |
What Ioannis mentioned is correct! we will know the trip count at runtime unless we do JIT (but that's different topic for now). |
* Moved info related function to codegen_info - Moved get_float_variables, codegen_int_variables, codegen_global_variables, codegen_shadow_variables into CodegenHelper - Move small utility functions from CodegenCVisitor to codeged_utils * Add proper variables to the mech_Instance * Adding LLVMStructBlock * Added test and visitor * Fix llvm codegen tests with x[0-9].*
* Moved info related function to codegen_info - Moved get_float_variables, codegen_int_variables, codegen_global_variables, codegen_shadow_variables into CodegenHelper - Move small utility functions from CodegenCVisitor to codeged_utils * Add proper variables to the mech_Instance * Adding LLVMStructBlock * Added test and visitor * Fix llvm codegen tests with x[0-9].*
* Moved info related function to codegen_info - Moved get_float_variables, codegen_int_variables, codegen_global_variables, codegen_shadow_variables into CodegenHelper - Move small utility functions from CodegenCVisitor to codeged_utils * Add proper variables to the mech_Instance * Adding LLVMStructBlock * Added test and visitor * Fix llvm codegen tests with x[0-9].*
* Moved info related function to codegen_info - Moved get_float_variables, codegen_int_variables, codegen_global_variables, codegen_shadow_variables into CodegenHelper - Move small utility functions from CodegenCVisitor to codeged_utils * Add proper variables to the mech_Instance * Adding LLVMStructBlock * Added test and visitor * Fix llvm codegen tests with x[0-9].*
* Moved info related function to codegen_info - Moved get_float_variables, codegen_int_variables, codegen_global_variables, codegen_shadow_variables into CodegenHelper - Move small utility functions from CodegenCVisitor to codeged_utils * Add proper variables to the mech_Instance * Adding LLVMStructBlock * Added test and visitor * Fix llvm codegen tests with x[0-9].*
* Moved info related function to codegen_info - Moved get_float_variables, codegen_int_variables, codegen_global_variables, codegen_shadow_variables into CodegenHelper - Move small utility functions from CodegenCVisitor to codeged_utils * Add proper variables to the mech_Instance * Adding LLVMStructBlock * Added test and visitor * Fix llvm codegen tests with x[0-9].* * Fixes after rebasing llvm branch on master (15.9.2022)
Create a stuct declaration in LLVM IR module similar to
<mech>_Instance
struct declared incpp
files.An example of such struct declaration is:
test.mod
(based onhh.mod
)test.cpp
In LLVM IR we generate the following:
The variables that are taken into account are:
These variables include any float pointers or int pointers that are indexes to other vectors.
This PR also includes:
CodegeCVisitor
and moving some functions toCodegenInfo
hpc-coding-conventions