Open fanghuaqi opened 1 year ago
Yes, that looks like the kind of thing we need, thank you.
Could you please go to https://github.com/riscv-admin/help/issues/new/choose and request Jira access? Then we can assign you to the Jira task.
Hi @WiseCrohn , I have comment on this https://jira.riscv.org/secure/RapidBoard.jspa?rapidView=397&view=detail&selectedIssue=RECSI-17
Yes I have seen your comment, but I can't assign the task to you.
@WiseCrohn hello, it seems the csi_parser.py doesn't support macro_define-type function like the normal functions with 'description', 'c-params','c-return-value'. The macro_define-type function can only be decribed as fragment, which is not suitable.
so I will pull request the hand-coded csi_csr_access.h without the yaml file first?
- comment:
Read the content of csr register to __v,
then write content of val into csr register, then return __v
fragment: |
#define __RV_CSR_SWAP(csr, val) \
({ \
rv_csr_t __v = (unsigned long)(val); \
__ASM volatile("csrrw %0, " STRINGIFY(csr) ", %1" \
: "=r"(__v) \
: "rK"(__v) \
: "memory"); \
__v; \
})
My teammate have opened an PR here for CSR access API, see https://github.com/riscv-non-isa/riscv-rvm-csi/pull/10
@WiseCrohn hello, it seems the csi_parser.py doesn't support macro_define-type function like the normal functions with 'description', 'c-params','c-return-value'. The macro_define-type function can only be decribed as fragment, which is not suitable.
You can just use the c-definitions field like in csi_hl_console_spec.yaml. This allows for fragments with a comment above each fragment. I think it can produce exactly what you have in the header you submitted?
@WiseCrohn hello, it seems the csi_parser.py doesn't support macro_define-type function like the normal functions with 'description', 'c-params','c-return-value'. The macro_define-type function can only be decribed as fragment, which is not suitable.
You can just use the c-definitions field like in csi_hl_console_spec.yaml. This allows for fragments with a comment above each fragment. I think it can produce exactly what you have in the header you submitted?
Yes,I already did this like c-definitions field in csi_hl_console_spec.yaml, but I thought describing params and return value like functions field will be better , so I didn't push the ready yaml.
OK, I can push this yaml just using fragment.
PR #11 addresses your points about defining a macro with arguments.
@dongyongtao maybe you could take a try when you are free.
PR #11 addresses your points about defining a macro with arguments.
ok, I will have a try, thanks
PR #11 addresses your points about defining a macro with arguments.
it‘s ok, and what I want. The yaml has updated macros by this PR.
Hi @WiseCrohn @VincentCui632 , we will start to do CSR Access API based on existing NMSIS-Core CSR API macros, the macros implementation and documentation can be found here:
If you have any feedback, we can discuss it here, and we will push this CSR accessing API PR when we have done it.
Thanks