software_APIs  1.0.0
Functions
user_addr_space.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void write_user_double_word (unsigned int data, int offset)
 
unsigned int read_user_double_word (int offset)
 
void write_user_word (unsigned short data, unsigned int offset, bool is_first_word)
 
unsigned short read_user_word (unsigned int offset, bool is_first_word)
 
void write_user_byte (unsigned char data, unsigned int offset, unsigned char byte_num)
 
unsigned char read_user_byte (unsigned int offset, unsigned char byte_num)
 

Function Documentation

◆ 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
offsetthe offset of the register to write. Origin at the user project address
byte_numnumber 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 123
addressoffset byte0byte1byte2byte3
0x000123
0x414567
0x82891011
0xC312131415

◆ 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
offsetthe 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)
addressoffset byte0byte1byte2byte3
0x000123
0x414567
0x82891011
0xC312131415

◆ 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
offsetthe offset of the register to write. Origin at the user project address
is_first_wordthe 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-11 00
addressoffset byte0byte1byte2byte3
0x000123
0x414567
0x82891011
0xC312131415

◆ 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
databyte data to write
offsetthe offset of the register to write. Origin at the user project address
byte_numnumber 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 123
addressoffset byte0byte1byte2byte3
0x000123
0x414567
0x82891011
0xC312131415

◆ 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
datadouble world data to write
offsetthe 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)
addressoffset byte0byte1byte2byte3
0x000123
0x414567
0x82891011
0xC312131415

◆ 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
dataworld data to write
offsetthe offset of the register to write. Origin at the user project address
is_first_wordthe 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-11 00
addressoffset byte0byte1byte2byte3
0x000123
0x414567
0x82891011
0xC312131415