Go to the source code of this file.
◆ read_user_byte()
| unsigned char read_user_byte |
( |
unsigned int |
offset, |
|
|
unsigned char |
byte_num |
|
) |
| |
Read byte at user address space 32 bit register
- Parameters
-
| offset | the offset of the register to write. Origin at the user project address |
| byte_num | number of the in the 4 bytes register (32 bits) |
- Note
- Since offset is a doubleword (4 bytes) and address space represent bytes, offset = address /4
For example if project caravel space are 26 address bit offset = wb_addr_i[25:0]/4
world memory (2byte offset)
| byte_num | - | 0 | 1 | 2 | 3 |
| address | offset | byte0 | byte1 | byte2 | byte3 |
| 0x0 | 0 | 0 | 1 | 2 | 3 |
| 0x4 | 1 | 4 | 5 | 6 | 7 |
| 0x8 | 2 | 8 | 9 | 10 | 11 |
| 0xC | 3 | 12 | 13 | 14 | 15 |
◆ read_user_double_word()
| unsigned int read_user_double_word |
( |
int |
offset | ) |
|
Read double word (4 bytes) at user address space 32 bit register
- Parameters
-
| offset | the offset of the register to write. Origin at the user project address |
- Note
- Since offset is a doubleword (4 bytes) and address space represent bytes, offset = address /4
For example if project caravel space are 26 address bit offset = wb_addr_i[25:0]/4
double world memory (4 bytes offset)
| address | offset | byte0 | byte1 | byte2 | byte3 |
| 0x0 | 0 | 0 | 1 | 2 | 3 |
| 0x4 | 1 | 4 | 5 | 6 | 7 |
| 0x8 | 2 | 8 | 9 | 10 | 11 |
| 0xC | 3 | 12 | 13 | 14 | 15 |
◆ read_user_word()
| unsigned short read_user_word |
( |
unsigned int |
offset, |
|
|
bool |
is_first_word |
|
) |
| |
Read word (2 bytes) at user address space 32 bit register
- Parameters
-
| offset | the offset of the register to write. Origin at the user project address |
| is_first_word | the offset of the register to write. Origin at the user project address |
- Note
- Since offset is a doubleword (4 bytes) and address space represent bytes, offset = address /4
For example if project caravel space are 26 address bit offset = wb_addr_i[25:0]/4
world memory (2byte offset)
| is first word | - | 1 | 1 | 0 | 0 |
| address | offset | byte0 | byte1 | byte2 | byte3 |
| 0x0 | 0 | 0 | 1 | 2 | 3 |
| 0x4 | 1 | 4 | 5 | 6 | 7 |
| 0x8 | 2 | 8 | 9 | 10 | 11 |
| 0xC | 3 | 12 | 13 | 14 | 15 |
◆ write_user_byte()
| void write_user_byte |
( |
unsigned char |
data, |
|
|
unsigned int |
offset, |
|
|
unsigned char |
byte_num |
|
) |
| |
Write byte at user address space 32 bit register
- Parameters
-
| data | byte data to write |
| offset | the offset of the register to write. Origin at the user project address |
| byte_num | number of the in the 4 bytes register (32 bits) |
- Note
- Since offset is a doubleword (4 bytes) and address space represent bytes, offset = address /4
For example if project caravel space are 26 address bit offset = wb_addr_i[25:0]/4
world memory (2byte offset)
| byte_num | - | 0 | 1 | 2 | 3 |
| address | offset | byte0 | byte1 | byte2 | byte3 |
| 0x0 | 0 | 0 | 1 | 2 | 3 |
| 0x4 | 1 | 4 | 5 | 6 | 7 |
| 0x8 | 2 | 8 | 9 | 10 | 11 |
| 0xC | 3 | 12 | 13 | 14 | 15 |
◆ write_user_double_word()
| void write_user_double_word |
( |
unsigned int |
data, |
|
|
int |
offset |
|
) |
| |
Write double word (4 bytes) at user address space 32 bit register
- Parameters
-
| data | double world data to write |
| offset | the offset of the register to write. Origin at the user project address |
- Note
- Since offset is a doubleword (4 bytes) and address space represent bytes, offset = address /4
For example if project caravel space are 26 address bit offset = wb_addr_i[25:0]/4
double world memory (4 bytes offset)
| address | offset | byte0 | byte1 | byte2 | byte3 |
| 0x0 | 0 | 0 | 1 | 2 | 3 |
| 0x4 | 1 | 4 | 5 | 6 | 7 |
| 0x8 | 2 | 8 | 9 | 10 | 11 |
| 0xC | 3 | 12 | 13 | 14 | 15 |
◆ write_user_word()
| void write_user_word |
( |
unsigned short |
data, |
|
|
unsigned int |
offset, |
|
|
bool |
is_first_word |
|
) |
| |
Write word (2 bytes) at user address space 32 bit register
- Parameters
-
| data | world data to write |
| offset | the offset of the register to write. Origin at the user project address |
| is_first_word | the offset of the register to write. Origin at the user project address |
- Note
- Since offset is a doubleword (4 bytes) and address space represent bytes, offset = address /4
For example if project caravel space are 26 address bit offset = wb_addr_i[25:0]/4
world memory (2byte offset)
| is first word | - | 1 | 1 | 0 | 0 |
| address | offset | byte0 | byte1 | byte2 | byte3 |
| 0x0 | 0 | 0 | 1 | 2 | 3 |
| 0x4 | 1 | 4 | 5 | 6 | 7 |
| 0x8 | 2 | 8 | 9 | 10 | 11 |
| 0xC | 3 | 12 | 13 | 14 | 15 |