IV. 10 HAL API 11 12 zip Nios II Nios II / 10 2004 12 v1.2 2004 9 v1.1 2004 5 v1.0 11 2004 12 v1.1 2004 5 v1.0 12 2004 5 v1.0 DMA open() alt_dma_txchan_open() ERRNO ALT_DMA_TX_STREAM_ON ALT_DMA_RX_STREAM_ON alt_dma_rxchan_ioctl() alt_dma_txchan_ioctl() Nios II Altera Corporation IV 1
Nios II IV 2 Altera Corporation
10. HAL API NII52010-1.2 HALHardware Abstraction LayerAPI C ISR HAL HAL Newlib API Newlib printf() I/O Newlib API Newlib Windows > Altera > Nios II Development Kit > Nios II Documentation Altera Corporation 10 1 2004 12 Preliminary
_exit() ISR void _exit (int exit_code) Newlib C <unistd.h> Newlib exit() _exit() main() HAL 1 HAL ISR exit_code Newlib Windows > Altera > Nios II Development Kit > Nios II Documentation 10 2 Altera Corporation Nios II 2004 12
HAL API _rename() ISR int _rename(char *existing, char* new) Newlib C <stdio.h> _rename() Newlib 1 errno ENOSYS Newlib Windows > Altera > Nios II Development Kit > Nios II Documentation Altera Corporation 10 3 2004 12 Nios II
alt_alarm_start() ISR int alt_alarm_start (alt_alarm* alarm, alt_u32 nticks, alt_u32 (*callback) (void* context), void* context) C/C++ <sys/alt_alarm.h> alt_alarm_start() 4 11 ntick callback context callback alarm alarm alt_alarm_start() alt_alarm_start() alt_alarm_stop() alt_nticks() alt_sysclk_init() alt_tick() alt_ticks_per_second() gettimeofday() settimeofday() times() usleep() 10 4 Altera Corporation Nios II 2004 12
HAL API alt_alarm_stop() ISR void alt_alarm_stop (alt_alarm* alarm) C/C++ <sys/alt_alarm.h> alt_alarm_stop() alt_alarm_start() alt_alarm_start() alt_alarm_start() alt_nticks() alt_sysclk_init() alt_tick() alt_ticks_per_second() gettimeofday() settimeofday() times() usleep() Altera Corporation 10 5 2004 12 Nios II
alt_dcache_flush() ISR void alt_dcache_flush (void* start, alt_u32 len) C/C++ <sys/alt_cache.h> alt_dcache_flush() start len alt_dcache_flush_all() alt_icache_flush() alt_icache_flush_all()# alt_remap_cached() alt_remap_uncached() alt_uncached_free() alt_uncached_malloc() 10 6 Altera Corporation Nios II 2004 12
HAL API alt_dcache_flush_all() ISR void alt_dcache_flush_all (void) C/C++ <sys/alt_cache.h> alt_dcache_flush_all() alt_dcache_flush() alt_icache_flush() alt_icache_flush_all()# alt_remap_cached() alt_remap_uncached() alt_uncached_free() alt_uncached_malloc() Altera Corporation 10 7 2004 12 Nios II
alt_dev_reg() ISR int alt_dev_reg(alt_dev* dev) <sys/alt_dev.h> alt_dev_reg() I/O 4 1 HAL alt_dev_reg() alt_dev_reg() alt_dev_reg() alt_sys_init() C alt_fs_reg() 10 8 Altera Corporation Nios II 2004 12
HAL API alt_dma_rxchan_close() ISR int alt_dma_rxchan_close (alt_dma_rxchan rxchan) C/C++ <sys/alt_dma.h> alt_dma_rxchan_close() DMA rxchan alt_dma_rxchan_depth() alt_dma_rxchan_ioctl() alt_dma_rxchan_open() alt_dma_rxchan_prepare() alt_dma_rxchan_reg() alt_dma_txchan_close() alt_dma_txchan_ioctl() alt_dma_txchan_open() alt_dma_txchan_reg() alt_dma_txchan_send() alt_dma_txchan_space() Altera Corporation 10 9 2004 12 Nios II
alt_dma_rxchan_depth() ISR alt_u32 alt_dma_rxchan_depth(alt_dma_rxchan dma) C/C++ <sys/alt_dma.h> alt_dma_rxchan_depth()dmadma ISR alt_dma_rxchan_close() alt_dma_rxchan_ioctl() alt_dma_rxchan_open() alt_dma_rxchan_prepare() alt_dma_rxchan_reg() alt_dma_txchan_close() alt_dma_txchan_ioctl() alt_dma_txchan_open() alt_dma_txchan_reg() alt_dma_txchan_send() alt_dma_txchan_space() 10 10 Altera Corporation Nios II 2004 12
HAL API alt_dma_rxchan_ioctl() ISR int alt_dma_rxchan_ioctl (alt_dma_rxchan dma, int req, void* arg) C/C++ <sys/alt_dma.h> alt_dma_rxchan_ioctl() DMA dma I/O req arg arg 10 1 <sys/alt_dma.h> alt_dma_rxchan_iotcl() ISR DMA alt_dma_rxchan_ioctl() alt_dma_rxchan_close() alt_dma_rxchan_depth() alt_dma_rxchan_open() alt_dma_rxchan_prepare() alt_dma_rxchan_reg() alt_dma_txchan_close() alt_dma_txchan_ioctl() alt_dma_txchan_open() alt_dma_txchan_reg() alt_dma_txchan_send() alt_dma_txchan_space() Altera Corporation 10 11 2004 12 Nios II
10 1. ALT_DMA_SET_MODE_8 ALT_DMA_SET_MODE_16 ALT_DMA_SET_MODE_32 ALT_DMA_SET_MODE_64 ALT_DMA_SET_MODE_128 ALT_DMA_GET_MODE ALT_DMA_TX_ONLY_ON (1) ALT_DMA_TX_ONLY_OFF (1) ALT_DMA_RX_ONLY_ON (1) 8 arg 16 arg 32 arg 64 arg 128 arg arg ALT_DMA_TX_ONLY_ON DMA 1 DMA ALT_DMA_RX_ONLY_ON DMA 1 ALT_DMA_RX_ONLY_OFF (1) DMA 10 1 (1) Nios II 1.1 ALT_DMA_TX_STREAM_ONALT_DMA_TX_STREAM_OFFALT_DMA_RX_STREAM_ON ALT_DMA_RX_STREAM_OFF 10 12 Altera Corporation Nios II 2004 12
HAL API alt_dma_rxchan_open() ISR alt_dma_rxchan alt_dma_rxchan_open (const char* name) C/C++ <sys/alt_dma.h> alt_dma_rxchan_open() DMA alt_dma_rxchan name /dev/dma_0 null null errno ENODEV alt_dma_rxchan_close() alt_dma_rxchan_depth() alt_dma_rxchan_ioctl() alt_dma_rxchan_prepare() alt_dma_rxchan_reg() alt_dma_txchan_close() alt_dma_txchan_ioctl() alt_dma_txchan_open() alt_dma_txchan_reg() alt_dma_txchan_send() alt_dma_txchan_space() Altera Corporation 10 13 2004 12 Nios II
alt_dma_rxchan_prepare() int alt_dma_rxchan_prepare (alt_dma_rxchan dma, void* data, alt_u32 length, alt_rxchan_done* done, void* handle) ISR C/C++ <sys/alt_dma.h> alt_dma_rxchan_prepare() DMA dma data length done handle done ISR alt_dma_rxchan_close() alt_dma_rxchan_depth() alt_dma_rxchan_ioctl() alt_dma_rxchan_open() alt_dma_rxchan_reg() alt_dma_txchan_close() alt_dma_txchan_ioctl() alt_dma_txchan_open() alt_dma_txchan_reg() alt_dma_txchan_send() alt_dma_txchan_space() 10 14 Altera Corporation Nios II 2004 12
HAL API alt_dma_rxchan_reg() ISR int alt_dma_rxchan_reg (alt_dma_rxchan_dev* dev) C/C++ <sys/alt_dma_dev.h> alt_dma_rxchan_reg() DMA 4 23 DMA alt_dma_rxchan_reg() alt_dma_rxchan_reg() alt_dma_rxchan_reg() alt_sys_init() C alt_dma_rxchan_close() alt_dma_rxchan_depth() alt_dma_rxchan_ioctl() alt_dma_rxchan_open() alt_dma_rxchan_prepare() alt_dma_txchan_close() alt_dma_txchan_ioctl() alt_dma_txchan_open() alt_dma_txchan_reg() alt_dma_txchan_send() alt_dma_txchan_space() Altera Corporation 10 15 2004 12 Nios II
alt_dma_txchan_close() ISR int alt_dma_txchan_close (alt_dma_txchan txchan) C/C++ <sys/alt_dma.h> alt_dma_txchan_close() DMA txchan alt_dma_rxchan_close() alt_dma_rxchan_depth() alt_dma_rxchan_ioctl() alt_dma_rxchan_open() alt_dma_rxchan_prepare() alt_dma_rxchan_reg() alt_dma_txchan_ioctl() alt_dma_txchan_open() alt_dma_txchan_reg() alt_dma_txchan_send() alt_dma_txchan_space() 10 16 Altera Corporation Nios II 2004 12
HAL API alt_dma_txchan_ioctl() ISR int alt_dma_txchan_ioctl (alt_dma_txchan dma, int req, void* arg) C/C++ <sys/alt_dma.h> alt_dma_txchan_ioctl() DMA dma I/O req arg arg 10 1 alt_dma_txchan_iotcl() ISR DMA alt_dma_rxchan_ioctl() alt_dma_rxchan_close() alt_dma_rxchan_depth() alt_dma_rxchan_ioctl() alt_dma_rxchan_open() alt_dma_rxchan_prepare() alt_dma_rxchan_reg() alt_dma_txchan_close() alt_dma_txchan_open() alt_dma_txchan_reg() alt_dma_txchan_send() alt_dma_txchan_space() Altera Corporation 10 17 2004 12 Nios II
alt_dma_txchan_open() ISR alt_dma_txchan alt_dma_txchan_open (const char* name) C/C++ <sys/alt_dma.h> alt_dma_txchan_open()dmaalt_dma_txchan name /dev/dma_0 null null errno ENODEV alt_dma_rxchan_close() alt_dma_rxchan_depth() alt_dma_rxchan_ioctl() alt_dma_rxchan_open() alt_dma_rxchan_prepare() alt_dma_rxchan_reg() alt_dma_txchan_close() alt_dma_txchan_ioctl() alt_dma_txchan_reg() alt_dma_txchan_send() alt_dma_txchan_space() 10 18 Altera Corporation Nios II 2004 12
HAL API alt_dma_txchan_reg() ISR int alt_dma_txchan_reg (alt_dma_txchan_dev* dev) C/C++ <sys/alt_dma_dev.h> alt_dma_txchan_reg() DMA 4 21 DMA alt_dma_txchan_reg() alt_dma_txchan_reg() alt_dma_txchan_reg() alt_sys_init() C alt_dma_rxchan_close() alt_dma_rxchan_depth() alt_dma_rxchan_ioctl() alt_dma_rxchan_open() alt_dma_rxchan_prepare() alt_dma_rxchan_reg() alt_dma_txchan_close() alt_dma_txchan_ioctl() alt_dma_txchan_open() alt_dma_txchan_send() alt_dma_txchan_space() Altera Corporation 10 19 2004 12 Nios II
alt_dma_txchan_send() int alt_dma_txchan_send (alt_dma_txchan dma, const void* from, alt_u32 length, alt_txchan_done* done, void* handle) ISR C/C++ <sys/alt_dma.h> alt_dma_txchan_send() DMA dma from length done handle done ISR alt_dma_rxchan_close() alt_dma_rxchan_depth() alt_dma_rxchan_ioctl() alt_dma_rxchan_open() alt_dma_rxchan_prepare() alt_dma_rxchan_reg() alt_dma_txchan_close() alt_dma_txchan_ioctl() alt_dma_txchan_open() alt_dma_txchan_reg() alt_dma_txchan_space() 10 20 Altera Corporation Nios II 2004 12
HAL API alt_dma_txchan_space() ISR int alt_dma_txchan_space (alt_dma_txchan dma) C/C++ <sys/alt_dma.h> alt_dma_txchan_space() DMA dma ISR alt_dma_rxchan_close() alt_dma_rxchan_depth() alt_dma_rxchan_ioctl() alt_dma_rxchan_open() alt_dma_rxchan_prepare() alt_dma_rxchan_reg() alt_dma_txchan_close() alt_dma_txchan_ioctl() alt_dma_txchan_open() alt_dma_txchan_reg() alt_dma_txchan_send() Altera Corporation 10 21 2004 12 Nios II
alt_erase_flash_block() ISR int alt_erase_flash_block(alt_flash_fd* fd, int offset, int length) C/C++ <sys/alt_flash.h> alt_erase_flash_block() fd offset length 4 18 alt_erase_flash_block() fd alt_flash_open_dev alt_flash_close_dev() alt_flash_open_dev() alt_get_flash_info() alt_read_flash() alt_write_flash() alt_write_flash_block() 10 22 Altera Corporation Nios II 2004 12
HAL API alt_flash_close_dev() ISR void alt_flash_close_dev(alt_flash_fd* fd) C/C++ <sys/alt_flash.h> alt_flash_close_dev() alt_write_flash() alt_read_flash()a lt_get_flash_info() alt_erase_flash_block() alt_write_flash_block() alt_flash_close_dev() fd alt_flash_open_dev alt_erase_flash_block() alt_flash_open_dev() alt_get_flash_info() alt_read_flash() alt_write_flash() alt_write_flash_block() Altera Corporation 10 23 2004 12 Nios II
alt_flash_open_dev() alt_flash_fd* alt_flash_open_dev(const char* name) C/C++ ISR <sys/alt_flash.h> alt_flash_open_dev() alt_write_flash() alt_read_flash() alt_get_flash_info() alt_erase_flash_block() alt_write_flash_block() alt_flash_open_dev() alt_erase_flash_block() alt_flash_close_dev() alt_get_flash_info() alt_read_flash() alt_write_flash() alt_write_flash_block() 10 24 Altera Corporation Nios II 2004 12
HAL API alt_fs_reg() ISR int alt_fs_reg (alt_dev* dev) <sys/alt_dev.h> alt_fs_reg() HAL I/O 4 1 HAL alt_fs_reg() alt_fs_reg() alt_fs_reg() alt_sys_init() C alt_dev_reg() Altera Corporation 10 25 2004 12 Nios II
alt_get_flash_info() ISR int alt_get_flash_info(alt_flash_fd* fd, flash_region** info, int* number_of_regions) C/C++ <sys/alt_flash.h> alt_get_flash_info() fd flash_region info number_of_regions fd alt_flash_open_dev alt_erase_flash_block() alt_flash_close_dev() alt_flash_open_dev() alt_read_flash() alt_write_flash() alt_write_flash_block() 10 26 Altera Corporation Nios II 2004 12
HAL API alt_icache_flush() ISR void alt_icache_flush (void* start, alt_u32 len) C/C++ <sys/alt_cache.h> alt_icache_flush() start len alt_dcache_flush() alt_dcache_flush_all() alt_icache_flush_all()# alt_remap_cached() alt_remap_uncached() alt_uncached_free() alt_uncached_malloc() Altera Corporation 10 27 2004 12 Nios II
alt_icache_flush_all() ISR void alt_icache_flush_all (void) C/C++ <sys/alt_cache.h> alt_icache_flush_all() alt_dcache_flush() alt_dcache_flush_all() alt_icache_flush()# alt_remap_cached() alt_remap_uncached() alt_uncached_free() alt_uncached_malloc() 10 28 Altera Corporation Nios II 2004 12
HAL API alt_irq_disable_all() ISR alt_irq_context alt_irq_disable_all (void) C/C++ <sys/alt_irq.h> alt_irq_disable_all() alt_irq_enable_all() alt_irq_enable_all() alt_irq_enabled() alt_irq_register() Altera Corporation 10 29 2004 12 Nios II
alt_irq_enable_all() void alt_irq_enable_all (alt_irq_context context) C/C++ ISR <sys/alt_irq.h> alt_irq_enable_all() context alt_irq_disable_all() alt_irq_disable_all() alt_irq_disable_all() alt_irq_enable_all() alt_irq_disable_all() alt_irq_enabled() alt_irq_register() 10 30 Altera Corporation Nios II 2004 12
HAL API alt_irq_enabled() ISR int alt_irq_enabled (void) <sys/alt_irq.h> alt_irq_enabled() alt_irq_disable_all() alt_irq_enable_all() alt_irq_register() Altera Corporation 10 31 2004 12 Nios II
alt_irq_register() ISR int alt_irq_register (alt_u32 id, void* context, void (*isr)(void*, alt_u32)) <sys/alt_irq.h> alt_irq_register() ISR id isr context id isr alt_irq_register() id irq_handler null alt_irq_register() alt_irq_disable_all() alt_irq_enable_all() alt_irq_enabled() 10 32 Altera Corporation Nios II 2004 12
HAL API alt_llist_insert() void alt_llist_insert(alt_llist* list, alt_llist* entry) C/C++ ISR <sys/alt_llist.h> alt_llist_insert() entry list ISR MicroC/OS- II mutex alt_llist_remove() Altera Corporation 10 33 2004 12 Nios II
alt_llist_remove() void alt_llist_remove(alt_llist* entry) C/C++ ISR <sys/alt_llist.h> alt_llist_remove() entry ISR MicroC/OS-II mutex alt_llist_insert() 10 34 Altera Corporation Nios II 2004 12
HAL API alt_nticks() ISR alt_u32 alt_nticks (void) C/C++ <sys/alt_alarm.h> alt_niticks() alt_alarm_start() alt_alarm_stop() alt_sysclk_init() alt_tick() alt_ticks_per_second() gettimeofday() settimeofday() times() usleep() Altera Corporation 10 35 2004 12 Nios II
alt_read_flash() ISR int alt_read_flash(alt_flash_fd* fd, int offset, void* dest_addr, int length) C/C++ <sys/alt_flash.h> alt_read_flash() fd length offset dest_addr fd alt_flash_open_dev alt_erase_flash_block() alt_flash_close_dev() alt_flash_open_dev() alt_get_flash_info() alt_write_flash() alt_write_flash_block() 10 36 Altera Corporation Nios II 2004 12
HAL API alt_remap_cached() ISR void* alt_remap_cached (volatile void* ptr, alt_u32 len); C/C++ <sys/alt_cache.h> alt_remap_cached() ptr len alt_dcache_flush() alt_dcache_flush_all() alt_icache_flush() alt_icache_flush_all()# alt_remap_uncached() alt_uncached_free() alt_uncached_malloc() Altera Corporation 10 37 2004 12 Nios II
alt_remap_uncached() volatile void* alt_remap_uncached (void* ptr, alt_u32 len); ISR C/C++ <sys/alt_cache.h> alt_remap_uncached() ptr len alt_dcache_flush() alt_dcache_flush_all() alt_icache_flush() alt_icache_flush_all()# alt_remap_cached() alt_uncached_free() alt_uncached_malloc() 10 38 Altera Corporation Nios II 2004 12
HAL API alt_sysclk_init() ISR int alt_sysclk_init (alt_u32 nticks) <sys/alt_alarm.h> alt_sysclk_init() 1 alt_sys_init() alt_alarm_start() alt_alarm_stop() alt_nticks() alt_tick() alt_ticks_per_second() gettimeofday() settimeofday() times() usleep() Altera Corporation 10 39 2004 12 Nios II
alt_tick() ISR void alt_tick (void) <sys/alt_alarm.h> alt_tick() alt_sysclk_init() ISR alt_alarm_start() alt_alarm_stop() alt_nticks() alt_sysclk_init() alt_ticks_per_second() gettimeofday() settimeofday() times() usleep() 10 40 Altera Corporation Nios II 2004 12
HAL API alt_ticks_per_second() ISR alt_u32 alt_ticks_per_second (void) C/C++ <sys/alt_alarm.h> alt_ticks_per_second() 1 1 alt_alarm_start() alt_alarm_stop() alt_nticks() alt_sysclk_init() alt_tick() gettimeofday() settimeofday() times() usleep() Altera Corporation 10 41 2004 12 Nios II
alt_timestamp() ISR alt_u32 alt_timestamp (void) C/C++ <sys/alt_timestamp.h> alt_timestamp() 4 12 alt_timestamp_start() alt_timestamp() alt_timestamp() alt_timestamp_freq() alt_timestamp_start() 10 42 Altera Corporation Nios II 2004 12
HAL API alt_timestamp_freq() ISR alt_u32 alt_timestamp_freq (void) C/C++ <sys/alt_timestamp.h> alt_timestamp_freq() 4 12 1 alt_timestamp() alt_timestamp_start() Altera Corporation 10 43 2004 12 Nios II
alt_timestamp_start() ISR int alt_timestamp_start (void) C/C++ <sys/alt_timestamp.h> alt_timestamp_start() 4 12 alt_timestamp() alt_timestamp_freq() 10 44 Altera Corporation Nios II 2004 12
HAL API alt_uncached_free() void alt_uncached_free (volatile void* ptr) C/C++ ISR <sys/alt_cache.h> alt_uncached_free() ptr alt_uncached_malloc() ptr alt_uncached_malloc() alt_dcache_flush() alt_dcache_flush_all() alt_icache_flush() alt_icache_flush_all()# alt_remap_cached() alt_remap_uncached() alt_uncached_malloc() Altera Corporation 10 45 2004 12 Nios II
alt_uncached_malloc() ISR volatile void* alt_uncached_malloc (size_t size) C/C++ <sys/alt_cache.h> alt_uncached_malloc() size alt_uncached_free() null alt_dcache_flush() alt_dcache_flush_all() alt_icache_flush() alt_icache_flush_all()# alt_remap_cached() alt_remap_uncached() alt_uncached_free() 10 46 Altera Corporation Nios II 2004 12
HAL API alt_write_flash() ISR int alt_write_flash(alt_flash_fd* fd, int offset, const void* src_addr, int length) C/C++ <sys/alt_flash.h> alt_write_flash() src_addr length fd offset 4 15 fd alt_flash_open_dev alt_erase_flash_block() alt_flash_close_dev() alt_flash_open_dev() alt_get_flash_info() alt_read_flash() alt_write_flash_block() Altera Corporation 10 47 2004 12 Nios II
alt_write_flash_block() ISR int alt_write_flash_block(alt_flash_fd* fd, int block_offset, int data_offset, const void *data, int length) C/C++ <sys/alt_flash.h> alt_write_flash_block() 1 fd block_offset data_offset data length 4 18 fd alt_flash_open_dev alt_erase_flash_block() alt_flash_close_dev() alt_flash_open_dev() alt_get_flash_info() alt_read_flash() alt_write_flash() 10 48 Altera Corporation Nios II 2004 12
HAL API close() ISR int close (int filedes) C/C++ Newlib C <unistd.h> close() filedes UNIX close() close() close() fd STDOUT_FILENOSTDIN_FILENO STDERR_FILENO open() STDOUT_FILENOSTDIN_FILENO STDERR_FILENO <unistd.h> 1 errno Newlib Windows > Altera > Nios II Development Kit > Nios II Documentation Altera Corporation 10 49 2004 12 Nios II
execve() int execve(const char *path, char *const argv[], char *const envp[]) ISR Newlib C <unistd.h> execve()newlib execve() 1 errno ENOSYS Newlib Windows > Altera > Nios II Development Kit > Nios II Documentation 10 50 Altera Corporation Nios II 2004 12
HAL API fork() ISR pid_t fork (void) Newlib C <unistd.h> fork() Newlib fork() 1 errno ENOSYS Newlib Windows > Altera > Nios II Development Kit > Nios II Documentation Altera Corporation 10 51 2004 12 Nios II
fstat() int fstat (int filedes, struct stat *st) C/C++ Newlib C ISR <sys/stat.h> fstat() st sys/stat.h fstat() fstat() fstat() fd STDOUT_FILENOSTDIN_FILENO STDERR_FILENO open() STDOUT_FILENOSTDIN_FILENO STDERR_FILENO <unistd.h> 1 errno close() ioctl() isatty() lseek() open() read() stat() write() Newlib Windows > Altera > Nios II Development Kit > Nios II Documentation 10 52 Altera Corporation Nios II 2004 12
HAL API getpid() ISR pid_t getpid (void) Newlib C <unistd.h> getpid() Newlib id HAL getpid() id Newlib Windows > Altera > Nios II Development Kit > Nios II Documentation Altera Corporation 10 53 2004 12 Nios II
gettimeofday() ISR int gettimeofday(struct timeval *ptimeval, struct timezone *ptimezone) C/C++ Newlib C <sys/time.h> gettimeofday() settimeofday() settimeofday() gettimeofday() gettimeofday() 1 errno alt_alarm_start() alt_alarm_stop() alt_nticks() alt_sysclk_init() alt_tick() alt_ticks_per_second() settimeofday() times() usleep() Newlib Windows > Altera > Nios II Development Kit > Nios II Documentation 10 54 Altera Corporation Nios II 2004 12
HAL API ioctl() ISR int ioctl (int file, int req, void* arg) C/C++ <sys/ioctl.h> ioctl() I/O UNIX ioctl() file req arg ioctl() alt_dev TIOCEXCL TIOCNXCL ioctl() ioctl() fd STDOUT_FILENOSTDIN_FILENO STDERR_FILENO open() STDOUT_FILENOSTDIN_FILENO STDERR_FILENO <unistd.h> errno close() fstat() isatty() lseek() open() read() stat() write() Newlib Windows > Altera > Nios II Development Kit > Nios II Documentation Altera Corporation 10 55 2004 12 Nios II
isatty() ISR int isatty(int file) C/C++ Newlib C <unistd.h> isatty() file fstat() fstat() isatty() 1 errno close() fstat() ioctl() lseek() open() read() stat() write() Newlib Windows > Altera > Nios II Development Kit > Nios II Documentation 10 56 Altera Corporation Nios II 2004 12
HAL API kill() ISR int kill(int pid, int sig) Newlib C <signal.h> kill() Newlib pid idsig HAL 1 pid getpid() id pid SIGABRTSIGALRMSIGFPESIGILLSIGKILLSIGPIPE SIGQUITSIGSEGVSIGTERMSIGUSR1SIGUSR2SIGBUSSIGPOLL SIGPROFSIGSYSSIGTRAPSIGVTALRMSIGXCPU SIGXFSZ exit() SIGCHLD SIGURG 1 errno Newlib Windows > Altera > Nios II Development Kit > Nios II Documentation Altera Corporation 10 57 2004 12 Nios II
link() ISR int link(const char *_path1, const char *_path2) Newlib C <unistd.h> link() Newlib link() 1 errno ENOSYS Newlib Windows > Altera > Nios II Development Kit > Nios II Documentation 10 58 Altera Corporation Nios II 2004 12
HAL API lseek() ISR off_t lseek(int file, off_t ptr, int whence) C/C++ Newlib C <unistd.h> lseek() file / lseek() lseek() lseek() UNIX lseek() whence whence SEEK_SET ptr SEEK_CUR ptr SEEK_END ptr lseek() lseek() fd STDOUT_FILENOSTDIN_FILENO STDERR_FILENO open() STDOUT_FILENOSTDIN_FILENO STDERR_FILENO <unistd.h> 1 errno close() fstat() ioctl() isatty() open() read() stat() write() Newlib Windows > Altera > Nios II Development Kit > Nios II Documentation Altera Corporation 10 59 2004 12 Nios II
open() ISR int open (const char* pathname, int flags, mode_t mode) C/C++ <unistd.h> open() flag / O_RDONLYO_WRONLYO_RDWR OR O_NONBLOCK open() / mode open() open() -1 errno close() fstat() ioctl() isatty() lseek() read() stat() write() Newlib Windows > Altera > Nios II Development Kit > Nios II Documentation 10 60 Altera Corporation Nios II 2004 12
HAL API read() ISR int read(int file, void *ptr, size_t len) C/C++ Newlib C <unistd.h> read() file ptr len read() read() fd STDOUT_FILENOSTDIN_FILENO STDERR_FILENO open() STDOUT_FILENOSTDIN_FILENO STDERR_FILENO <unistd.h> 1 errno close() fstat() ioctl() isatty() lseek() open() stat() write() Newlib Windows > Altera > Nios II Development Kit > Nios II Documentation Altera Corporation 10 61 2004 12 Nios II
sbrk() caddr_t sbrk(int incr) Newlib C ISR <unistd.h> sbrk() incr sbrk() malloc() Newlib Windows > Altera > Nios II Development Kit > Nios II Documentation 10 62 Altera Corporation Nios II 2004 12
HAL API settimeofday() ISR int settimeofday (const struct timeval *t, const struct timezone *tz) C/C++ <sys/time.h> settimeofday() gettimeofday() gettimeofday() 1 alt_alarm_start() alt_alarm_stop() alt_nticks() alt_sysclk_init() alt_tick() alt_ticks_per_second() gettimeofday() times() usleep() Altera Corporation 10 63 2004 12 Nios II
stat() ISR int stat(const char *file_name, struct stat *buf); C/C++ Newlib C <sys/stat.h> stat() fstat() fstat() stat() stat() stat() stat() fstat() 10 52 fstat() close() fstat() ioctl() isatty() lseek() open() read() write() Newlib Windows > Altera > Nios II Development Kit > Nios II Documentation 10 64 Altera Corporation Nios II 2004 12
HAL API times() ISR clock_t times (struct tms *buf) C/C++ Newlib C <sys/times.h> times() Newlib buf tms typedef struct { clock_t tms_utime; clock_t tms_stime; clock_t tms_cutime; clock_t tms_cstime; }; tms_utime: CPU tms_stime: CPU tms_cutime: tms_utime tms_cutime tms_cstime: tms_stimes tms_ctimes HAL alt_alarm_start() alt_alarm_stop() alt_nticks() alt_sysclk_init() alt_tick() alt_ticks_per_second() gettimeofday() settimeofday() usleep() Newlib Windows > Altera > Nios II Development Kit > Nios II Documentation Altera Corporation 10 65 2004 12 Nios II
unlink() ISR int unlink(char *name) Newlib C <unistd.h> unlink()newlib unlink() 1 errno ENOSYS Newlib Windows > Altera > Nios II Development Kit > Nios II Documentation 10 66 Altera Corporation Nios II 2004 12
HAL API usleep() ISR int usleep (int us) C/C++ <unistd.h> usleep() us usleep() 1 errno alt_alarm_start() alt_alarm_stop() alt_nticks() alt_sysclk_init() alt_tick() alt_ticks_per_second() gettimeofday() settimeofday() times() Altera Corporation 10 67 2004 12 Nios II
wait() ISR int wait(int *status) Newlib C <sys/wait.h> Newlib wait() HAL status 1 errno ECHILD Newlib Windows > Altera > Nios II Development Kit > Nios II Documentation 10 68 Altera Corporation Nios II 2004 12
HAL API write() ISR int write(int file, const void *ptr, size_t len) C/C++ Newlib C <unistd.h> write() file ptr len write() write() fd STDOUT_FILENOSTDIN_FILENO STDERR_FILENO open() STDOUT_FILENOSTDIN_FILENO STDERR_FILENO <unistd.h> 1 errno close() fstat() ioctl() isatty() lseek() open() read() stat() Newlib Windows > Altera > Nios II Development Kit > Nios II Documentation Altera Corporation 10 69 2004 12 Nios II
HAL ANSI C 10 2 alt_types.h 10 2. alt_8 alt_u8 alt_16 alt_u16 alt_32 alt_u32 8 8 16 16 32 32 10 70 Altera Corporation Nios II 2004 12
11. NII520011-1.1 Nios II Nios II IDE GNU Nios II IDE 11 1 Nios II IDE 11 1. Nios II IDE ( / ) Nios II IDE Flash Programmer Nios II IDE Nios II IDE Nios II IDE Nios II IDE Flash Programmer Flash Programmer Flash Programmer RAM RAM HAL FPGA Nios II Flash Programmer User Guide Altera Corporation 11 1 2004 12 Preliminary
11 1. Nios II IDE ( / ) Quartus II Nios II ISS ISS Nios II IDE ISS Nios II IDE Quartus II Quartus II Nios II IDE Quartus II FPGA Nios II IDE Quartus II [F1] Nios II Software Development Kit (SDK) Shell <Nios II >/bin/ Nios II SDK Shell < > --help 11 2 Nios II IDE GUI Nios II IDE Nios II IDE Nios II IDE Nios II IDE GUI Nios II IDE Nios II IDE 1 IDE 11 2 Altera Corporation Nios II 2004 12
11 2. Nios II IDE nios2-create-system-library nios2-create-application-project nios2-build-project nios2-import-project nios2-delete-project C/C++ Nios II IDE managed-make makefile make nios2-buildproject Nios II IDE Nios II IDE Nios II IDE 11 3 Nios II 11 3. nios2-download nios2-flash-programmer nios2-gdb-server nios2-terminal validate_zip Nios II TCP GNU GDB JTAGJoint Test Action Group Nios II JTAG UARTUniversal Asynchronous Receiver/Transmitter I/O zip zip Altera Corporation 11 3 2004 12 Nios II
11 4 11 4. bin2flash elf2dat elf2flash elf2hex elf2mem elf2mif flash2dat mk-nios2- signaltapmnemonictable sof2flash.flash.elf Verilog HDL.dat.elf.flash.elf Intel.hex Nios II.elf Quartus II (.mif).flash Verilog HDL.dat.elf SOPC Builder (.ptf) Nios II SignalTap II.stp FPGA.sof.flash 11 5 1 Nios SDK AN 350: Upgrading Nios Processor Systems to the Nios II Processor 11 5. ( / ) nios2-build nios2-run SDK Nios II I/O 11 4 Altera Corporation Nios II 2004 12
11 5. ( / ) nios2-debug nios2-console Nios II Insight FS2 CLINios II GNU Nios II GNU GNU HTML Nios II GNU <Nios II >/bin/nios2-gnutools Nios II GNU nios2-elf-< > nios2-elf-gcc make nios2-elf-as nios2-elf-ld nios2-elf-objdump nios2-elf-size GNU HTML 11 6 Nios II 11 6. ( / ) HALHardware Abstraction Layer 3 1 HAL MicroC/OS-II RTOS Lightweight IP TCP/IP 8 1 MicroC/OS-II 9 1 Lightweight IP Altera Corporation 11 5 2004 12 Nios II
11 6. ( / ) Newlib ANSI C zip 3 1 HAL Newlib HTML Nios II 12 1 zip Nios II Nios II 11 6 Altera Corporation Nios II 2004 12
12. zip NII520012-1.0 HAL ( Hardware Abstraction Layer) zip zip HAL fopen()fread()ansi CI/O zip zip Nios II IDE HAL <Nios II >/components/altera_ro_zipfs/hal/ zip zip Nios II IDE zip Nios II IDE GUIzip 4 HAL /mnt/zipfs HAL zip hello fopen( /mnt/zipfs/hello, r ) zip Nios II IDE zip zip Altera Corporation 12 1 2004 5 Preliminary
zip Nios II IDE Nios II IDE system.h zip zip zip zip zip zip WinZip GUI winzip pkzip -e0 zip zip zip Nios II IDE zip.flash Release Nios II IDE Flash Programmer zip Nios II Flash Programmer User Guide 12 2 Altera Corporation Nios II 2004 5
_exit() 4 30, 10 2 _irq_entry 6 3 _rename() 10 3 A alt_alarm_start() 10 4 alt_alarm_stop() 10 5 alt_dcache_flush() 10 6 alt_dcache_flush_all() 10 7 alt_dev_reg() 10 8 alt_dma_rxchan_close() 10 9 alt_dma_rxchan_depth() 10 10 alt_dma_rxchan_ioctl() 10 11 alt_dma_rxchan_open() 10 13 alt_dma_rxchan_prepare() 10 14 alt_dma_rxchan_reg() 10 15 alt_dma_txchan_close() 10 16 alt_dma_txchan_ioctl() 10 17 alt_dma_txchan_open() 10 18 alt_dma_txchan_reg() 10 19 alt_dma_txchan_send() 10 20 alt_dma_txchan_space() 10 21 alt_erase_flash_block() 10 22 alt_flash_close_dev() 10 23 alt_flash_open_dev() 10 24 alt_fs_reg() 10 25 alt_get_flash_info() 10 26 alt_icache_flush() 10 27 alt_icache_flush_all() 10 28 alt_irq_disable_all() 10 29 alt_irq_enable_all() 10 30 alt_irq_enabled() 10 31 alt_irq_handler() 6 3 alt_irq_register() 6 7, 10 32 alt_irq_register() ISR 6 7 alt_llist_insert() 10 33 alt_llist_remove() 10 34 alt_lwip_dev_list 5 15 alt_nticks() 10 35 alt_read_flash() 10 36 alt_remap_cached() 10 37 alt_remap_uncached 10 38 alt_sysclk_init() 10 39 alt_tick() 10 40 alt_ticks_per_second() 10 41 alt_timestamp() 10 42 alt_timestamp_freq() 10 43 alt_timestamp_start() 10 44 alt_uncached_free() 10 45 alt_uncached_malloc() 10 46 alt_write_flash() 10 47 alt_write_flash_block() 10 48 C close() 10 49 C 6 11 D dev/null 4 27 DMA 4 23, 5 13 DMA 4 21, 5 12 DMA DMA 4 23 DMA 4 21 HAL 4 20 DMA 4 24 DMA 5 11 DMA HAL 4 20 E execve() 10 50 F fork() 10 51 fstat() 10 52 Altera Corporation 1 Preliminary
Nios II G get_ip_addr() 9 7 get_mac_addr() 9 7 getpid() 10 53 gettimeofday() 10 54 GNU tool chain 1 2 GNU 11 5 H HAL API 5 1 HAL API 5 1 HAL API _exit() 10 2 _rename() 10 3 alt_alarm_start() 10 4 alt_alarm_stop() 10 5 alt_dcache_flush() 10 6 alt_dcache_flush_all() 10 7 alt_dev_reg() 10 8 alt_dma_rxchan_close() 10 9 alt_dma_rxchan_depth() 10 10 alt_dma_rxchan_ioctl() 10 11 alt_dma_rxchan_open() 10 13 alt_dma_rxchan_prepare() 10 14 alt_dma_rxchan_reg() 10 15 alt_dma_txchan_close() 10 16 alt_dma_txchan_ioctl() 10 17 alt_dma_txchan_open() 10 18 alt_dma_txchan_reg() 10 19 alt_dma_txchan_send() 10 20 alt_dma_txchan_space() 10 21 alt_erase_flash_block() 10 22 alt_flash_close_dev() 10 23 alt_flash_open_dev() 10 24 alt_fs_reg() 10 25 alt_get_flash_info() 10 26 alt_icache_flush() 10 27 alt_icache_flush_all() 10 28 alt_irq_disable_all() 10 29 alt_irq_enable_all() 10 30 alt_irq_enabled() 10 31 alt_irq_register() 10 32 alt_llist_insert() 10 33 alt_llist_remove() 10 34 alt_nticks() 10 35 alt_read_flash() 10 36 alt_remap_cached() 10 37 alt_remap_uncached() 10 38 alt_sysclk_init 10 39 alt_tick() 10 40 alt_ticks_per_second() 10 41 alt_timestamp() 10 42 alt_timestamp_freq() 10 43 alt_timestamp_start() 10 44 alt_uncached_free() 10 45 alt_uncached_malloc() 10 46 alt_write_flash() 10 47 alt_write_flash_block() 10 48 close() 10 49 execve() 10 50 fork() 10 51 fstat() 10 52 getpid() 10 53 gettimeofday() 10 54 ioctl() 10 55 isatty() 10 56 kill() 10 57 link() 10 58 lseek() 10 59 open() 10 60 read() 10 61 sbrk() 10 62 settimeofday() 10 63 stat() 10 64 times() 10 65 unlink() 10 66 usleep() 10 67 wait() 10 68 write() 10 69 10 1 10 70 HALsystem.h 4 3 HAL HAL 3 2 newlib 3 5 3 2 HAL - 4 38 HAL 4 38 HAL HAL 4 4 2 Altera Corporation Preliminary
HAL 4 10 HAL / CPU 7 8 HAL 1 3 HAL HAL 3 2 3 6 3 1 HAL HAL 4 38 HAL HAL 4 38 HAL 4 38 HAL 4 38 HAL 7 5 7 6 7 4 HAL _irq_entry 6 3 alt_irq_handler() 6 3 software_exception 6 4 6 2 HAL DMA 5 11 5 14 5 5 5 9 5 8 5 10 HAL HAL 5 5 HAL 5 17 HAL 5 17 HAL 10 70 HAL 4 38 HAL HAL 5 17 HAL 5 17 5 21 HAL 4 32 HAL HAL 5 5 HAL 5 17 SOPC Builder 5 3 5 2 5 23 5 22 5 22 5 3 5 1 HAL 5 17 HAL DMA 4 20 DMA 4 20 HAL 4 4 HAL 4 38 HAL 4 38 Nios IDE 4 1 UNIX 4 5 4 31 4 7 4 7 4 26 4 26 4 3 4 10 4 10 4 4 4 1 4 9 4 9 4 6 4 14 4 14 4 31 4 34 I init_done_func() 9 5 init_routine() 5 15 ioctl() 10 55 isatty() 10 56 Altera Corporation 3 Preliminary
Nios II ISR C 6 11 ISR 6 10 ISR 6 8 ISR 6 10 ISR 6 7 ISR HAL API 6 7 6 6 ISR 6 15 ISR 6 10 ISR 6 8 ISR 6 13 ISR 6 10 ISR HAL API 6 7 ISR 6 14 K kill() 10 57 L Lightweight IP ARP 9 12 DHCP 9 12 IP 9 11 Lightweight TCP/IP 9 11 Nios II 9 1 TCP 9 12 UDP 9 12 9 2 9 13 Lightweight IP Nios II 9 1 link() 10 58 linkoutput() 5 16 lseek() 10 59 lwip_devices_init() 9 7 lwip_stack_init() 9 5 LWIP Lightweight IP 9 3 M MicroC/OS-II MicroC/OS-II 8 2 Newlib ANSI C 8 6 Nios II IDE 8 7 8 3 8 8 8 8 8 10 8 12 8 3 8 9 8 9 RTOS 8 2 8 1 8 11 8 12 8 4 8 1 8 10 8 11 8 2 MicroC/OS-II 8 1 N Newlib ANSI C MicroC/OS-II 8 6 Newlib C 4 28 Nios II IDE 1 2 Nios II IDE 11 1 Nios II IDE LWIP Lightweight IP 9 10 Nios II IDE MicroC/OS-II 8 7 Nios II IDE Nios IDE 2 1 2 2 2 2 2 2 4 Altera Corporation Preliminary
Nios II 7 1 Nios II 6 1 Nios IDE Nios II IDE 2 1 2 10 2 2 2 1 2 9 2 6 2 4 Nios IDE HAL 4 1 O open() 10 60 output() 5 16 R read() 10 61 RTOS TCP/IP 1 3 rx_routine() 5 16 S sbrk() 10 62 settimeofday() 10 63 software_exception 6 4 SOPC Builder system.h 5 3 SOPC Builder HAL 5 3 5 3 SOPC 5 3 stat() 10 64 stderr 4 8 stdin 4 8 stdout 4 8 system.h HAL 4 3 system.h SOPC Builder 5 3 T times() 10 65 U UNIX HAL 4 5 unlink() 10 66 usleep() 10 67 W wait() 10 68 write() 10 69 Z zip zip 12 2 zip zip 12 2 MicroC/OS-II 8 3 4 11 GNU 11 5 Nios II IDE 11 1 11 2 11 5 11 1 11 5 MicroC/OS-II MicroC/OS-II 8 2 11 2 Altera Corporation 5 Preliminary
Nios II 5 14 alt_lwip_dev_list 5 15 init_routine() 5 15 linkoutput() 5 16 output() 5 16 rx_routine() 5 16 Lightweight IP LWIP Nios II 9 1 LWIP 9 2 LWIP 9 3 Nios II IDE LWIP 9 10 9 13 9 4 9 5 TCP/IP 9 3 9 1 9 3 MicroC/OS-II 8 8 MicroC/OS-II 8 8 1 2 4 33 HAL 4 31 4 31 4 31 11 5 Nios IDE 2 10 1 2 Lightweight IP 9 13 MicroC/OS-II 8 1 Nios 1 5 1 2 1 4 1 Nios 1 4 1 1 1 1 HAL API 7 2 7 1 7 2 Nios II 7 1 HAL API 7 2 7 4 7 1 7 6 / CPU 7 7 7 3 C++ 4 9 dev/null 4 9 HAL 4 7 4 8 4 8 5 5 5 5 5 7 HAL 4 7 MicroC/OS-II 8 10 6 Altera Corporation Preliminary
4 12 4 18 ISR 6 12 _exit() 4 30 dev/null 4 27 HAL 4 26 Newlib C 4 28 4 26 4 27 4 30 HAL 4 26 1 4 5 3 HAL 3 6 HAL 4 3 5 9 Lightweight IP 9 4 HAL 3 1 Nios IDE 2 2 4 15 MicroC/OS-II 8 12 HAL 7 6 Lightweight IP 9 5 4 37 4 26 MicroC/OS-II 8 3 MicroC/OS-II 8 9 MicroC/OS-II 8 9 RTOS MicroC/OS-II 8 2 MicroC/OS-II 8 1 Nios 1 5 MicroC/OS-II 8 11 TCP/IP Lightweight IP 9 3 HAL 4 10 HAL 4 10 4 11 4 12 5 9 5 9 5 9 HAL 4 10 5 9 Altera Corporation 7 Preliminary
Nios II MicroC/OS-II 8 12 1 Nios 1 4 1 2 GNU tool chain 1 2 HAL 1 3 Nios II IDE 1 2 RTOS TCP/IP 1 3 1 2 HAL 4 4 MicroC/OS-II 8 4 HAL 5 2 HAL 7 5 7 4 HAL 5 23 4 31 HAL 5 22 1 1 HAL 5 22 HAL 5 3 HAL API 10 1 HAL 3 1 HAL 5 1 HAL 4 1 MicroC/OS-II 8 1 Nios IDE 2 1 11 1 Lightweight IP 9 1 1 1 7 1 zip 12 1 6 1 4 17 4 37 HAL 5 2 4 8 4 8 4 8 4 27 HAL 4 9 5 8 5 8 5 8 HAL 4 9 HAL 4 6 HAL 4 14 4 18 4 15 4 17 4 17 8 Altera Corporation Preliminary
5 10 5 10 5 11 HAL 4 14 Nios IDE 2 9 4 32 HAL 4 31 4 31 4 33 4 31 4 33 4 37 4 17 Nios IDE 2 6 HAL 7 6 7 6 zip zip 12 1 Nios IDE 2 4 API 5 2 4 31 / CPU HAL 7 8 7 7 4 30 MicroC/OS-II 8 10 DMA 4 24 MicroC/OS-II 8 11 4 34 HAL 4 34 4 37 4 37 4 37 4 34 4 35 4 35 Lightweight IP 9 3 MicroC/OS-II 8 2 11 5 zip zip 12 2 zip 12 1 zip 12 2 12 1 HAL 7 4 7 3 Altera Corporation 9 Preliminary
Nios II HAL 6 2 ISR 6 6 ISR 6 15 ISR 6 13 ISR 6 14 Nios II 6 1 ISR 6 12 6 1 10 Altera Corporation Preliminary