Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Framework ---------------------------------------------------------------- */
- struct block;
- typedef int (*cd_init_t)(void);
- typedef int (*cd_connect_t)(struct block *, struct block *);
- struct compute_domain
- {
- const char *name;
- cd_init_t *init;
- cd_connect_t *connect;
- };
- struct block
- {
- struct compute_domain *domain;
- };
- /* This would replace the current tb->connect method */
- int
- connect(struct block *src, struct block *dst)
- {
- /* Easy case */
- if (src->domain == dst->domain)
- return src->domain->connect(src, dst);
- /* ingress / egress */
- factory = find_adaptor(src, dst);
- if (!factory)
- return -EINVAL;
- struct block *adapt = factory();
- src->domain->connect(src, adapt);
- dst->domain->connect(adapt, dst);
- }
- /* Host -------------------------------------------------------------------- */
- /* This is shipped with gr-runtime, the default compute domain and would
- * pretty much be all the current code */
- static int
- host_init(void)
- {
- /* Init of host domain (if any is required ...) */
- }
- static int
- host_connect(struct block *src, struct block *dst)
- {
- /* Call the 'normal' connect function like it is currently */
- }
- static struct compute_domain domHost = {
- .name = "Host",
- .init = host_init,
- .connect = host_connect,
- };
- /* RF NoC ----------------------------------------------------------------- */
- /* This would essentially be in gr-uhd */
- static int
- rfnoc_init(void)
- {
- /* Register our host ingress / egress with framework */
- }
- static int
- rfnoc_connect(struct block *src, struct block *dst)
- {
- /* Calls UHD to connect those blocks. You can assume
- * src & dst are either pure rfnoc block or an ingress/egress blocks
- */
- }
- static struct compute_domain domRFNoC = {
- .name = "RF NoC",
- .init = rfnoc_init,
- .connect = rfnoc_connect,
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement