Hardware Libraries
20.1
Arria 10 SoC Hardware Manager
|
This section implements useful macros to set, clear, change, and replace selected bits within a word in memory or a memory-mapped register.
Macros | |
#define | alt_setbits_byte(dest, bits) (alt_write_byte(dest, alt_read_byte(dest) | (bits))) |
#define | alt_clrbits_byte(dest, bits) (alt_write_byte(dest, alt_read_byte(dest) & ~(bits))) |
#define | alt_xorbits_byte(dest, bits) (alt_write_byte(dest, alt_read_byte(dest) ^ (bits))) |
#define | alt_replbits_byte(dest, msk, src) (alt_write_byte(dest,(alt_read_byte(dest) & ~(msk)) | ((src) & (msk)))) |
#define | alt_setbits_hword(dest, bits) (alt_write_hword(dest, alt_read_hword(dest) | (bits))) |
#define | alt_clrbits_hword(dest, bits) (alt_write_hword(dest, alt_read_hword(dest) & ~(bits))) |
#define | alt_xorbits_hword(dest, bits) (alt_write_hword(dest, alt_read_hword(dest) ^ (bits))) |
#define | alt_replbits_hword(dest, msk, src) (alt_write_hword(dest,(alt_read_hword(dest) & ~(msk)) | ((src) & (msk)))) |
#define | alt_setbits_word(dest, bits) (alt_write_word(dest, alt_read_word(dest) | (bits))) |
#define | alt_clrbits_word(dest, bits) (alt_write_word(dest, alt_read_word(dest) & ~(bits))) |
#define | alt_xorbits_word(dest, bits) (alt_write_word(dest, alt_read_word(dest) ^ (bits))) |
#define | alt_replbits_word(dest, msk, src) (alt_write_word(dest,(alt_read_word(dest) & ~(msk)) | ((src) & (msk)))) |
#define | alt_setbits_dword(dest, bits) (alt_write_dword(dest, alt_read_dword(dest) | (bits))) |
#define | alt_clrbits_dword(dest, bits) (alt_write_dword(dest, alt_read_dword(dest) & ~(bits))) |
#define | alt_xorbits_dword(dest, bits) (alt_write_dword(dest, alt_read_dword(dest) ^ (bits))) |
#define | alt_replbits_dword(dest, msk, src) (alt_write_dword(dest,(alt_read_dword(dest) & ~(msk)) | ((src) & (msk)))) |
#define | alt_setbits_byte(dest, bits) (alt_write_byte(dest, alt_read_byte(dest) | (bits))) |
#define | alt_clrbits_byte(dest, bits) (alt_write_byte(dest, alt_read_byte(dest) & ~(bits))) |
#define | alt_xorbits_byte(dest, bits) (alt_write_byte(dest, alt_read_byte(dest) ^ (bits))) |
#define | alt_replbits_byte(dest, msk, src) (alt_write_byte(dest,(alt_read_byte(dest) & ~(msk)) | ((src) & (msk)))) |
#define | alt_setbits_hword(dest, bits) (alt_write_hword(dest, alt_read_hword(dest) | (bits))) |
#define | alt_clrbits_hword(dest, bits) (alt_write_hword(dest, alt_read_hword(dest) & ~(bits))) |
#define | alt_xorbits_hword(dest, bits) (alt_write_hword(dest, alt_read_hword(dest) ^ (bits))) |
#define | alt_replbits_hword(dest, msk, src) (alt_write_hword(dest,(alt_read_hword(dest) & ~(msk)) | ((src) & (msk)))) |
#define | alt_setbits_word(dest, bits) (alt_write_word(dest, alt_read_word(dest) | (bits))) |
#define | alt_clrbits_word(dest, bits) (alt_write_word(dest, alt_read_word(dest) & ~(bits))) |
#define | alt_xorbits_word(dest, bits) (alt_write_word(dest, alt_read_word(dest) ^ (bits))) |
#define | alt_replbits_word(dest, msk, src) (alt_write_word(dest,(alt_read_word(dest) & ~(msk)) | ((src) & (msk)))) |
#define | alt_setbits_dword(dest, bits) (alt_write_dword(dest, alt_read_dword(dest) | (bits))) |
#define | alt_clrbits_dword(dest, bits) (alt_write_dword(dest, alt_read_dword(dest) & ~(bits))) |
#define | alt_xorbits_dword(dest, bits) (alt_write_dword(dest, alt_read_dword(dest) ^ (bits))) |
#define | alt_replbits_dword(dest, msk, src) (alt_write_dword(dest,(alt_read_dword(dest) & ~(msk)) | ((src) & (msk)))) |
#define alt_setbits_byte | ( | dest, | |
bits | |||
) | (alt_write_byte(dest, alt_read_byte(dest) | (bits))) |
Set selected bits in the 8 bit byte at the destination address in device memory.
dest | - Destination pointer address |
bits | - Bits to set in destination byte |
#define alt_clrbits_byte | ( | dest, | |
bits | |||
) | (alt_write_byte(dest, alt_read_byte(dest) & ~(bits))) |
Clear selected bits in the 8 bit byte at the destination address in device memory.
dest | - Destination pointer address |
bits | - Bits to clear in destination byte |
#define alt_xorbits_byte | ( | dest, | |
bits | |||
) | (alt_write_byte(dest, alt_read_byte(dest) ^ (bits))) |
Change or toggle selected bits in the 8 bit byte at the destination address in device memory.
dest | - Destination pointer address |
bits | - Bits to change in destination byte |
#define alt_replbits_byte | ( | dest, | |
msk, | |||
src | |||
) | (alt_write_byte(dest,(alt_read_byte(dest) & ~(msk)) | ((src) & (msk)))) |
Replace selected bits in the 8 bit byte at the destination address in device memory.
dest | - Destination pointer address |
msk | - Bits to replace in destination byte |
src | - Source bits to write to cleared bits in destination byte |
#define alt_setbits_hword | ( | dest, | |
bits | |||
) | (alt_write_hword(dest, alt_read_hword(dest) | (bits))) |
Set selected bits in the 16 bit halfword at the destination address in device memory.
dest | - Destination pointer address |
bits | - Bits to set in destination halfword |
#define alt_clrbits_hword | ( | dest, | |
bits | |||
) | (alt_write_hword(dest, alt_read_hword(dest) & ~(bits))) |
Clear selected bits in the 16 bit halfword at the destination address in device memory.
dest | - Destination pointer address |
bits | - Bits to clear in destination halfword |
#define alt_xorbits_hword | ( | dest, | |
bits | |||
) | (alt_write_hword(dest, alt_read_hword(dest) ^ (bits))) |
Change or toggle selected bits in the 16 bit halfword at the destination address in device memory.
dest | - Destination pointer address |
bits | - Bits to change in destination halfword |
#define alt_replbits_hword | ( | dest, | |
msk, | |||
src | |||
) | (alt_write_hword(dest,(alt_read_hword(dest) & ~(msk)) | ((src) & (msk)))) |
Replace selected bits in the 16 bit halfword at the destination address in device memory.
dest | - Destination pointer address |
msk | - Bits to replace in destination halfword |
src | - Source bits to write to cleared bits in destination halfword |
#define alt_setbits_word | ( | dest, | |
bits | |||
) | (alt_write_word(dest, alt_read_word(dest) | (bits))) |
Set selected bits in the 32 bit word at the destination address in device memory.
dest | - Destination pointer address |
bits | - Bits to set in destination word |
#define alt_clrbits_word | ( | dest, | |
bits | |||
) | (alt_write_word(dest, alt_read_word(dest) & ~(bits))) |
Clear selected bits in the 32 bit word at the destination address in device memory.
dest | - Destination pointer address |
bits | - Bits to clear in destination word |
#define alt_xorbits_word | ( | dest, | |
bits | |||
) | (alt_write_word(dest, alt_read_word(dest) ^ (bits))) |
Change or toggle selected bits in the 32 bit word at the destination address in device memory.
dest | - Destination pointer address |
bits | - Bits to change in destination word |
#define alt_replbits_word | ( | dest, | |
msk, | |||
src | |||
) | (alt_write_word(dest,(alt_read_word(dest) & ~(msk)) | ((src) & (msk)))) |
Replace selected bits in the 32 bit word at the destination address in device memory.
dest | - Destination pointer address |
msk | - Bits to replace in destination word |
src | - Source bits to write to cleared bits in destination word |
#define alt_setbits_dword | ( | dest, | |
bits | |||
) | (alt_write_dword(dest, alt_read_dword(dest) | (bits))) |
Set selected bits in the 64 bit doubleword at the destination address in device memory.
dest | - Destination pointer address |
bits | - Bits to set in destination doubleword |
#define alt_clrbits_dword | ( | dest, | |
bits | |||
) | (alt_write_dword(dest, alt_read_dword(dest) & ~(bits))) |
Clear selected bits in the 64 bit doubleword at the destination address in device memory.
dest | - Destination pointer address |
bits | - Bits to clear in destination doubleword |
#define alt_xorbits_dword | ( | dest, | |
bits | |||
) | (alt_write_dword(dest, alt_read_dword(dest) ^ (bits))) |
Change or toggle selected bits in the 64 bit doubleword at the destination address in device memory.
dest | - Destination pointer address |
bits | - Bits to change in destination doubleword |
#define alt_replbits_dword | ( | dest, | |
msk, | |||
src | |||
) | (alt_write_dword(dest,(alt_read_dword(dest) & ~(msk)) | ((src) & (msk)))) |
Replace selected bits in the 64 bit doubleword at the destination address in device memory.
dest | - Destination pointer address |
msk | - Bits to replace in destination doubleword |
src | - Source bits to write to cleared bits in destination word |
#define alt_setbits_byte | ( | dest, | |
bits | |||
) | (alt_write_byte(dest, alt_read_byte(dest) | (bits))) |
Set selected bits in the 8 bit byte at the destination address in device memory.
dest | - Destination pointer address |
bits | - Bits to set in destination byte |
#define alt_clrbits_byte | ( | dest, | |
bits | |||
) | (alt_write_byte(dest, alt_read_byte(dest) & ~(bits))) |
Clear selected bits in the 8 bit byte at the destination address in device memory.
dest | - Destination pointer address |
bits | - Bits to clear in destination byte |
#define alt_xorbits_byte | ( | dest, | |
bits | |||
) | (alt_write_byte(dest, alt_read_byte(dest) ^ (bits))) |
Change or toggle selected bits in the 8 bit byte at the destination address in device memory.
dest | - Destination pointer address |
bits | - Bits to change in destination byte |
#define alt_replbits_byte | ( | dest, | |
msk, | |||
src | |||
) | (alt_write_byte(dest,(alt_read_byte(dest) & ~(msk)) | ((src) & (msk)))) |
Replace selected bits in the 8 bit byte at the destination address in device memory.
dest | - Destination pointer address |
msk | - Bits to replace in destination byte |
src | - Source bits to write to cleared bits in destination byte |
#define alt_setbits_hword | ( | dest, | |
bits | |||
) | (alt_write_hword(dest, alt_read_hword(dest) | (bits))) |
Set selected bits in the 16 bit halfword at the destination address in device memory.
dest | - Destination pointer address |
bits | - Bits to set in destination halfword |
#define alt_clrbits_hword | ( | dest, | |
bits | |||
) | (alt_write_hword(dest, alt_read_hword(dest) & ~(bits))) |
Clear selected bits in the 16 bit halfword at the destination address in device memory.
dest | - Destination pointer address |
bits | - Bits to clear in destination halfword |
#define alt_xorbits_hword | ( | dest, | |
bits | |||
) | (alt_write_hword(dest, alt_read_hword(dest) ^ (bits))) |
Change or toggle selected bits in the 16 bit halfword at the destination address in device memory.
dest | - Destination pointer address |
bits | - Bits to change in destination halfword |
#define alt_replbits_hword | ( | dest, | |
msk, | |||
src | |||
) | (alt_write_hword(dest,(alt_read_hword(dest) & ~(msk)) | ((src) & (msk)))) |
Replace selected bits in the 16 bit halfword at the destination address in device memory.
dest | - Destination pointer address |
msk | - Bits to replace in destination halfword |
src | - Source bits to write to cleared bits in destination halfword |
#define alt_setbits_word | ( | dest, | |
bits | |||
) | (alt_write_word(dest, alt_read_word(dest) | (bits))) |
Set selected bits in the 32 bit word at the destination address in device memory.
dest | - Destination pointer address |
bits | - Bits to set in destination word |
#define alt_clrbits_word | ( | dest, | |
bits | |||
) | (alt_write_word(dest, alt_read_word(dest) & ~(bits))) |
Clear selected bits in the 32 bit word at the destination address in device memory.
dest | - Destination pointer address |
bits | - Bits to clear in destination word |
#define alt_xorbits_word | ( | dest, | |
bits | |||
) | (alt_write_word(dest, alt_read_word(dest) ^ (bits))) |
Change or toggle selected bits in the 32 bit word at the destination address in device memory.
dest | - Destination pointer address |
bits | - Bits to change in destination word |
#define alt_replbits_word | ( | dest, | |
msk, | |||
src | |||
) | (alt_write_word(dest,(alt_read_word(dest) & ~(msk)) | ((src) & (msk)))) |
Replace selected bits in the 32 bit word at the destination address in device memory.
dest | - Destination pointer address |
msk | - Bits to replace in destination word |
src | - Source bits to write to cleared bits in destination word |
#define alt_setbits_dword | ( | dest, | |
bits | |||
) | (alt_write_dword(dest, alt_read_dword(dest) | (bits))) |
Set selected bits in the 64 bit doubleword at the destination address in device memory.
dest | - Destination pointer address |
bits | - Bits to set in destination doubleword |
#define alt_clrbits_dword | ( | dest, | |
bits | |||
) | (alt_write_dword(dest, alt_read_dword(dest) & ~(bits))) |
Clear selected bits in the 64 bit doubleword at the destination address in device memory.
dest | - Destination pointer address |
bits | - Bits to clear in destination doubleword |
#define alt_xorbits_dword | ( | dest, | |
bits | |||
) | (alt_write_dword(dest, alt_read_dword(dest) ^ (bits))) |
Change or toggle selected bits in the 64 bit doubleword at the destination address in device memory.
dest | - Destination pointer address |
bits | - Bits to change in destination doubleword |
#define alt_replbits_dword | ( | dest, | |
msk, | |||
src | |||
) | (alt_write_dword(dest,(alt_read_dword(dest) & ~(msk)) | ((src) & (msk)))) |
Replace selected bits in the 64 bit doubleword at the destination address in device memory.
dest | - Destination pointer address |
msk | - Bits to replace in destination doubleword |
src | - Source bits to write to cleared bits in destination word |