- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Follow-up to an earlier question (Can I change the opcode configuration registers of a datapath during runtime? ), but with a slightly different core topic:
Are macros for defining a datapath's opcodes available in C? Something like
CS_ALU_OP__AND | CS_SRCA_A0 | ...(and so on)
That would be much more readable and maintainable than configuring the opcodes in the datapath config tool and then copying binary values over to C.
Solved! Go to Solution.
- Tags:
- datapath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Can you please let me know if you are referring to macros generated in the verilog file of the UDB component as shown in the image below:
There macros are restricted to the verilog file and cannot be used outside it.
As far as I understand, we do not have macro's for datapath opcodes available in C.
But I will check internally and get back to you on this.
Best Regards
Ekta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Can you please let me know if you are referring to macros generated in the verilog file of the UDB component as shown in the image below:
There macros are restricted to the verilog file and cannot be used outside it.
As far as I understand, we do not have macro's for datapath opcodes available in C.
But I will check internally and get back to you on this.
Best Regards
Ekta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, I'm referring to those verilog macros and was looking for something similar in C. I didn't expect these to work in C directly, and they don't. But after I looked at the registers TRM again, there's a hint in the descriptions for the bits in UDB_UDBPAIR0_UDBSNG0_DPATH_OPC0:
Typing these bitfield names in the PSoC Creator editor brings up auto-completion, and it reveals a bunch of defines like this one:
CYVAL_UDB_UDBPAIR_UDBSNG_OPC0_A0_WR_SRC_ALU
I'm not sure if these are intended to be used like I hope they are. There's no trace of these (well, I found none) in the PDL documentation.