Skip to content
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

Add mchan_check_end_policy flag to hw_desc #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions dory/Hardware_targets/PULP/Common/Templates/Makefile.t
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ APP_CFLAGS += -DALWAYS_BLOCK_DMA_TRANSFERS
% if single_core_dma:
APP_CFLAGS += -DSINGLE_CORE_DMA
% endif
% if mchan_check_end_policy:
APP_CFLAGS += -DMCHAN_${mchan_check_end_policy.upper()}
% endif

include ${prefix}vars.mk

Expand Down
2 changes: 0 additions & 2 deletions dory/Hardware_targets/PULP/Common/Utils/dory_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
// GAP8 hardware to be tested...
#define MCHAN_BASE_ADDR (ARCHI_MCHAN_DEMUX_ADDR) // CLUSTER_MCHAN_ADDR
#endif
#define MCHAN_EVENT
//#define MCHAN_POLLED
#ifdef MCHAN_EVENT
#define MCHAN_EVENT_BIT (ARCHI_CL_EVT_DMA0) // 8
#endif
Expand Down
3 changes: 2 additions & 1 deletion dory/Hardware_targets/PULP/GAP8/HW_description.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@
},
"double_buffering": 1,
"split_ints": true,
"blocking_dma_transfers": true
"blocking_dma_transfers": true,
"mchan_check_end_policy": "polled"
}
4 changes: 2 additions & 2 deletions dory/Hardware_targets/PULP/GAP8_L2/HW_description.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
"accelerator core1-7 stack": 3400
},
"split_ints": true,
"double_buffering": 1

"double_buffering": 1,
"mchan_check_end_policy": "polled"
}
3 changes: 2 additions & 1 deletion dory/Hardware_targets/PULP/GAP9/HW_description.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@
"double_buffering": 2,
"split_ints": true,
"blocking_dma_transfers": false,
"single_core_dma": true
"single_core_dma": true,
"mchan_check_end_policy": "event"
}
3 changes: 2 additions & 1 deletion dory/Hardware_targets/PULP/PULP_gvsoc/HW_description.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@
"accelerator core1-7 stack": 3600
},
"split_ints": true,
"blocking_dma_transfers": false
"blocking_dma_transfers": false,
"mchan_check_end_policy": "event"
}
5 changes: 5 additions & 0 deletions dory/Utils/Templates_writer/Makefile_template_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ def print_template_Makefile(
except KeyError:
print("Makefile template writer: key 'single_core_dma' not found in HW description, using multi-core transfers!")
single_core_dma = False
if 'mchan_check_end_policy' in HW_description:
supported_policies = ["polled", "event", "interrupt"]
assert HW_description['mchan_check_end_policy'] in supported_policies, \
f"Requested mchan check end policy {HW_description['mchan_check_end_policy']} not supported: {supported_policies}"
tk['mchan_check_end_policy'] = HW_description['mchan_check_end_policy']
tk['single_core_dma'] = single_core_dma
root = os.path.realpath(os.path.dirname(__file__))
tmpl = Template(filename=os.path.join(root, "../../Hardware_targets", HW_description["name"], template_location_rel))
Expand Down