Replies: 1 comment
-
New signatures: typedef union gpc_params_s {
struct {
uint32_t tid;
void *global_data;
size_t global_data_size;
void *local_data;
size_t local_data_size;
uint32_t reserved[3];
};
uint32_t raw[8];
} gpc_params_t;
void gpc_global_setup(const gpc_params_t *gpc_params);
void gpc_local_setup(const gpc_params_t *gpc_params);
void gpc_loop(const gpc_params_t *gpc_params); The design steals 128 bytes from global data, but it allows more flexibility with the implementation (e.g. no need to rewrite all examples when the signature is changed. Also, the reserved fields can be used in the future for additional parameters for the user) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently user entry points have many arguments: thread ID, global data, local data and CR space. At the biggest function there are 6 arguments, which is the maximal number of registers that can be passed via registers in rv32e (rv32i allows 8), which leaves us without so much room to grow in the future. Also, local and global base addresses are stored in fixed registers (
gp
andtp
respectively).To address this, I have two alternative options in mind:
Option #1: implement utility functions that return the base pointers and remove them from the arguments. The user code will look something like that:
This approach frees 3 arguments for our use, but it might be a bit confusing (some arguments are passed via utility and some via arguments).
Option #2: create a struct with memory layout info and pass the user code a (const) pointer to it:
This approach provides saves all arguments and will allow us room to grow in the future, but it steals memory from the user's code. I don't know how critical it is, but my hunch is that library overhead should be minimal.
Beta Was this translation helpful? Give feedback.
All reactions