Nios II ソフトウェア開発ハンドブック Version 1.2 第5章. HAL用デバイス・ドライバの開発 ver.1.1

Size: px
Start display at page:

Download "Nios II ソフトウェア開発ハンドブック Version 1.2 第5章. HAL用デバイス・ドライバの開発 ver.1.1"

Transcription

1 5. HAL NII HAL Hardware Abstraction Layer HAL API Application Programming Interface Nios II 2 HAL HAL API API HAL API HAL API DMA HAL HAL API HAL API ASCII LCD printf() LCD Altera Corporation Preliminary

2 API HAL API HAL API HAL API HAL API HAL C API HAL API 5 17 HAL HAL API API C++ HAL HAL C++ C C HAL C 4 1 HAL HAL main () 4. HAL 5. HAL 5 2 Altera Corporation Nios II

3 HAL SOPC Builder SOPC Builder Nios II SOPC Builder system.h SOPC Builder system.h Nios II system.h Nios II SOPC Builder SOPC Builder Nios II system.h SOPC Builder system.h 4 1 HAL SOPC Builder system.h SOPC Builder system.h SOPC Builder SOPC Builder Nios II SOPC Builder SOPC Builder Altera Corporation Nios II

4 SOPC Builder Nios II <Nios II >/components < >_regs.h inc JTAG UART <Nios II >/components/altera_avalon_jtag_uart/ inc/altera_avalon_jtag_uart_regs.h _regs.h IORD_< >_< > IOWR_< >_< > 7 1 < >_ < >_< >_MSK < >_< >_< >_OFST PE ALTERA_AVALON_UART_STATUS_PE_MSK ALTERA_AVALON_UART_STATUS_PE_OFST _regs.h _regs.h 5 4 Altera Corporation Nios II

5 HAL 7 1 _regs.h SOPC Builder HAL HAL 3 1 HAL HAL HAL API DMA HAL alt_dev alt_dev typedef struct { alt_llist llist; /* */ const char* name; int (*open) (alt_fd* fd, const char* name, int flags, int mode); int (*close) (alt_fd* fd); int (*read) (alt_fd* fd, char* ptr, int len); int (*write) (alt_fd* fd, const char* ptr, int len); Altera Corporation Nios II

6 HAL int (*lseek) (alt_fd* fd, int ptr, int dir); int (*fstat) (alt_fd* fd, struct stat* buf); int (*ioctl) (alt_fd* fd, int req, void* arg); } alt_dev; HAL open() open() open() close() read() write() lseek() fstat() ioctl() 10 1 HAL API errno errno.h ioctl() errno ENOTTY ENOTTY errno HAL int alt_fd* alt_fd open() alt_fd typedef struct { alt_dev* dev; void* priv; int fd_flags; } alt_fd; dev fd_flags open() flags priv HAL 5 6 Altera Corporation Nios II

7 HAL priv alt_dev NULL alt_dev open close read write lseek fstat ioctl TIOCEXCL ioctl() open() close() read() write() lseek() ioctl() alt_dev llist name 2 llist ALT_LLIST_ENTRY name HAL system.h alt_dev HAL int alt_dev_reg (alt_dev* dev) Altera Corporation Nios II

8 HAL HAL API ANSI C (4 1 HAL )alt_dev HAL alt_dev 5 5 name read() write() fstat() int alt_fs_reg (alt_dev* dev) HAL HAL API ANSI C (4 1 HAL )alt_dev name 5 8 Altera Corporation Nios II

9 HAL 4 1 HAL 1 1 ISR void alt_tick (void) alt_tick() int alt_sysclk_init (alt_u32 nticks) nticks alt_timestamp_start() alt_timestamp() alt_timestamp_freq() HAL 10 1 HAL API Altera Corporation Nios II

10 HAL sys/alt_flash_dev.h alt_flash_dev struct alt_flash_dev { alt_llist llist; // const char* name; alt_flash_open open; alt_flash_close close; alt_flash_write write; alt_flash_read read; alt_flash_get_flash_info get_info; alt_flash_erase_block erase_block; alt_flash_write_block write_block; void* base_addr; int length; int number_of_regions; flash_region region_info[alt_max_number_of_flash_regions]; }; llist ALT_LLIST_ENTRY name HAL system.h open write_block 8 API alt_flash_open_dev() alt_flash_close_dev() alt_flash_write() alt_write_flash() alt_read_flash() alt_get_flash_info() alt_erase_flash_block() alt_write_flash_block() 5 10 Altera Corporation Nios II

11 HAL base_addr length number_of_regions region_info flash_region 4 14 CFI 2 alt_flash_dev HAL int alt_flash_device_register( alt_flash_fd* fd) DMA HAL DMA 2 DMA HAL DMA 4 20 DMA DMA sys/alt_dma_dev.h Altera Corporation Nios II

12 HAL DMA DMA alt_dma_txchan typedef struct alt_dma_txchan_dev_s alt_dma_txchan_dev; struct alt_dma_txchan_dev_s { alt_llist llist; const char* name; int (*space) (alt_dma_txchan dma); int (*send) (alt_dma_txchan dma, const void* from, alt_u32 len, alt_txchan_done* done, void* handle); int (*ioctl) (alt_dma_txchan dma, int req, void* arg); }; alt_dma_txchan llist name space send ioctl ALT_LLIST_ENTRY alt_dma_txchan_open() name system.h alt_dma_txchan_dev API alt_dma_txchan_send() DMA alt_txchan_send() send() alt_dma_txchan_send() I/O sys/alt_dma_dev.h space send ioctl null alt_dma_txchan_ioctl() ENOTTY alt_dma_txchan HAL int alt_dma_txchan_reg (alt_dma_txchan_dev* dev) dev 5 12 Altera Corporation Nios II

13 HAL DMA DMA alt_dma_rxchan typedef alt_dma_rxchan_dev_s alt_dma_rxchan; struct alt_dma_rxchan_dev_s { alt_llist list; const char* name; alt_u32 depth; int (*prepare) (alt_dma_rxchan dma, void* data, alt_u32 len, alt_rxchan_done* done, void* handle); int (*ioctl) (alt_dma_rxchan dma, int req, void* arg); }; alt_dma_rxchan llist name depth prepare ioctl ALT_LLIST_ENTRY alt_dma_rxchan_open() name system.h API alt_dma_rxchan_prepare() DMA alt_dma_rxchan_prepare() prepare() alt_dma_rxchan_prepare() I/O sys/alt_dma_dev.h prepare() ioctl null alt_dma_rxchan_ioctl() ENOTTY Altera Corporation Nios II

14 HAL alt_dma_rxchan HAL int alt_dma_rxchan_reg (alt_dma_rxchan_dev* dev) dev HAL MicroC/OS-II IP lwip TCP/IP lwip 9 1 Lightweight IP SMSC lan91c111 MAC lwip lwip lwip lan91c111 src inc <Nios II >/components/altera_avalon_lan91c111/ucosii/ Nios II <lwip >/UCOSII/inc/alt_lwip_dev.h 5 14 Altera Corporation Nios II

15 HAL alt_lwip_dev_list alt_lwip_dev_list typedef struct { alt_llist llist; /* */ alt_lwip_dev dev; } alt_lwip_dev_list; struct alt_lwip_dev { /* netif */ struct netif* netif; const char* name; err_t (*init_routine)(struct netif*); void (*rx_routine)(); }; name system.h lwip netif netif <lwip >/UCOSII/src/downloads/lwip-0.7.2/src/include/lwip netif.h netif MAC IP MAC init_routine() alt_lwip_dev init_routine netif err_t init_routine(struct netif* netif) Altera Corporation Nios II

16 HAL init_routine() get_mac_addr() get_ip_addr() MAC IP netif 9 1 Lightweight IP init_routine() output() linkoutput() init_routine() output() link_output() 2 netif link_output() link_output() link_output(struct netif *netif, struct pbuf *p) link_output() IP IP MAC ARP link_output() link_output() output(struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr) rx_routine() alt_lwip_dev rx_routine TCP/IP IRQ ISR rx_mbox <lwip >/UCOSII/src/alt_lwip_dev.c rx_thread rx_mbox rx_routine() rx_routine() TCP/IP 5 16 Altera Corporation Nios II

17 HAL void rx_func() HAL HAL HAL HAL HAL HAL SOPC Builder 5 3 JTAG UART 5-1 JTAG UART <Nios II >/components 5-1. HAL altera_avalon_jtag_uart HAL HAL HAL inc src inc HAL HAL Altera Corporation Nios II

18 HAL HAL alt_sys_init.c HAL alt_sys_init.c alt_sys_init.c HAL alt_sys_init() main() alt_sys_init.c alt_sys_init.c #include "system.h" #include "sys/alt_sys_init.h" /* * */ #include "altera_avalon_timer.h" #include "altera_avalon_uart.h" /* * */ ALTERA_AVALON_UART_INSTANCE( UART1, uart1 ); ALTERA_AVALON_TIMER_INSTANCE( SYSCLK, sysclk ); /* * */ void alt_sys_init( void ) { ALTERA_AVALON_UART_INIT( UART1, uart1 ); ALTERA_AVALON_TIMER_INIT( SYSCLK, sysclk ); } Nios II IDE SOPC Builder alt_sys_init.c Nios II IDE gtf-generate alt_sys_init.c gtf-generate HAL gtf-generate 5 18 Altera Corporation Nios II

19 HAL HAL/inc SOPC Builder JATG UART altera_avalon_jtag_uart/hal/inc/altera_avalon_jtag_uart.h alt_sys_init.c 5 18 alt_sys_init.c /* */ < >_INSTANCE 5 18 alt_sys_init.c /* */ alt_sys_init() < >_INIT 5 18 alt_sys_init.c /* */ *_INSTANCE *_INIT altera_avalon_jtag_uart.h ALTERA_AVALON_JTAG_UART_INSTANCE ALTERA_AVALON_JGAT_UART_INIT *_INSTANCE *_INIT 2 2 SOPC Builder system.h system.h alt_sys_init.c Altera Corporation Nios II

20 HAL SOPC Builder HAL/inc/<component_name>.h <COMPONENT_NAME>_INSTANCE <COMPONENT_NAME>_INIT HAL main() 5 18 HAL alt_sys_init.c HAL/src makefile component.mk component.mk JTAG UART makefile component.mk makefile C_LIB_SRCS += altera_avalon_uart.c ASM_LIB_SRCS += INCLUDE_PATH += 5 20 Altera Corporation Nios II

21 HAL Nios II IDE component.mk makefilecomponent.mk make C_LIB_SRCS ASM_LIB_SRCS INCLUDE_PATH component.mk make make C_LIB_SRCS ASM_LIB_SRCS INCLUDE_PATH C C <component>/hal/inc component.mk make 5 22 HAL *_INSTANCE *_INIT HAL/inc HAL/src makefile component.mk HAL/src Altera Corporation Nios II

22 HAL ALT_USE_SMALL_DRIVERS C Nios II IDE ALT_USE_SMALL_DRIVERS ALT_USE_SMALL_DRIVERS ALT_USE_SMALL_DRIVERS SOPC Builder SOPC Builder alt_ altera_avalon_jtag_uart altera_avalon_jtag_uart_init() alt_jtag_uart_init() avalon_jtag_uart_init() jtag_uart_init() 5 22 Altera Corporation Nios II

23 HAL SOPC Builder HAL 5 17 HAL Nios II IDE Nios II IDE alt_my_component.h alt_my_component.h C Altera Corporation Nios II

24 5 24 Altera Corporation Nios II

Nios II ソフトウェア開発ハンドブック Version 1.2 セクション IV. 付録 

Nios II ソフトウェア開発ハンドブック Version 1.2 セクション IV. 付録  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

More information

Nios II ソフトウェア開発ハンドブック Version 1.2 第4章. HALを使用したプログラムの開発 ver.1.2

Nios II ソフトウェア開発ハンドブック Version 1.2 第4章. HALを使用したプログラムの開発 ver.1.2 4. HAL NII52004-1.2 HAL Hardware Abstraction Layer HAL API Nios II HAL ANSI C HAL API ANSI C HAL HAL API ANSI C ANSI C HAL HAL printf() scanf() ANSI C I/O HAL API RTOS ANSI C Nios II IDE HAL Nios II IDE

More information

Nios® II HAL API を使用したソフトウェア・サンプル集 「Modular Scatter-Gather DMA Core」

Nios® II HAL API を使用したソフトウェア・サンプル集 「Modular Scatter-Gather DMA Core」 ALTIMA Company, MACNICA, Inc Nios II HAL API Modular Scatter-Gather DMA Core Ver.17.1 2018 8 Rev.1 Nios II HAL API Modular Scatter-Gather DMA Core...3...3...4... 4... 5 3-2-1. msgdma... 6 3-2-2. On-Chip

More information

Nios II IDE によるソフトウェア開発 - セクション 1

Nios II IDE によるソフトウェア開発 - セクション 1 ALTIMA Corp. Nios II IDE によるソフトウェア 開 発 セクション 1 ver.1.0 2010 年 8 月 ELSENA,Inc. 目 次 1. はじめに... 3 2. HAL を 用 いたプログラミング... 3 2-1. HAL (Hardware Abstraction Layer)... 3 2-2. Nios II IDE プロジェクトの 構 造... 4 2-3.

More information

Nios II ソフトウェア開発ハンドブック Version 1.2 第6章. 例外処理 ver.1.2

Nios II ソフトウェア開発ハンドブック Version 1.2 第6章. 例外処理 ver.1.2 6. NII52006-1.2 Nios II ISR HAL Hardware Abstraction Layer Nios II HAL ISR ISR HAL API Application Programming Interface ISR ISR C ISR ISR ISR Nios II Nios II Nios II Nios II RISC 1 1 Nios II Altera Corporation

More information

FreeBSD 1

FreeBSD 1 FreeBSD 1 UNIX OS 1 ( ) open, close, read, write, ioctl (cdevsw) OS DMA 2 (8 ) (24 ) 256 open/close/read/write Ioctl 3 2 2 I/O I/O CPU 4 open/close/read/write open, read, write open/close read/write /dev

More information

Nios II ハードウェア・チュートリアル

Nios II ハードウェア・チュートリアル Nios II ver. 7.1 2007 8 1. Nios II FPGA Nios II Quaruts II 7.1 Nios II 7.1 Nios II Cyclone II count_binary 2. 2-1. http://www.altera.com/literature/lit-nio2.jsp 2-2. Nios II Quartus II FEATURE Nios II

More information

1) // 2) I/O 3) Japan Advanced Institute of Science and Technology 2013/07/26 1

1) // 2) I/O 3) Japan Advanced Institute of Science and Technology 2013/07/26 1 I441 2013/07/26 Dependable Network Innovation Center, Japan Advanced Institute of Science and Technology 1) // 2) I/O 3) Japan Advanced Institute of Science and Technology 2013/07/26 1 1) Comer: Internetworking

More information

IP L09( Tue) : Time-stamp: Tue 14:52 JST hig TCP/IP. IP,,,. ( ) L09 IP (2017) 1 / 28

IP L09( Tue) : Time-stamp: Tue 14:52 JST hig TCP/IP. IP,,,. ( )   L09 IP (2017) 1 / 28 L09(2017-11-21 Tue) : Time-stamp: 2017-11-21 Tue 14:52 JST hig TCP/IP. IP,,,. http://hig3.net L09 (2017) 1 / 28 9, IP, - L09 (2017) 2 / 28 C (ex. ) 1 TCP/IP 2 3 ( ) ( L09 (2017) 3 / 28 50+5, ( )50+5. (

More information

Nios II 簡易チュートリアル

Nios II 簡易チュートリアル Nios II Ver. 7.1 2007 10 1. Nios II Nios II JTAG UART LED 8 PIO LED < > Quartus II SOPC Builder Nios II Quartus II.sof Nios II IDE Stratix II 2S60 RoHS Nios II Quartus II http://www.altera.com/literature/lit-nio2.jsp

More information

program.dvi

program.dvi 2001.06.19 1 programming semi ver.1.0 2001.06.19 1 GA SA 2 A 2.1 valuename = value value name = valuename # ; Fig. 1 #-----GA parameter popsize = 200 mutation rate = 0.01 crossover rate = 1.0 generation

More information

プロセッサ・アーキテクチャ

プロセッサ・アーキテクチャ 2. NII51002-8.0.0 Nios II Nios II Nios II 2-3 2-4 2-4 2-6 2-7 2-9 I/O 2-18 JTAG Nios II ISA ISA Nios II Nios II Nios II 2 1 Nios II Altera Corporation 2 1 2 1. Nios II Nios II Processor Core JTAG interface

More information

double float

double float 2015 3 13 1 2 2 3 2.1.......................... 3 2.2............................. 3 3 4 3.1............................... 4 3.2 double float......................... 5 3.3 main.......................

More information

Linuxデバイスドライバ.PDF

Linuxデバイスドライバ.PDF Linux [email protected] 2002/10/9 Linux Kernel Conference 2002 1 Linux 2 Linux 3 Software Hardware Device Algolith m Protocol Applicati on 4 CPU 128MB NIC ATI Radeon GeForce2 MX400 Matrox G400 DISK 5 OS

More information

Makefile, TCPソケットサーバ, コマンドライン引数

Makefile, TCPソケットサーバ, コマンドライン引数 L11(2017-12-12 Tue) : Time-stamp: 2017-12-22 Fri 12:28 JST hig ( ) make http://hig3.net L11 (2017) 1 / 24 I, void die(char message) void die(char message[])... 1 #i n c l u d e 2 / / 3 double

More information

エラー処理・分割コンパイル・コマンドライン引数

エラー処理・分割コンパイル・コマンドライン引数 L10(2017-12-05 Tue) : Time-stamp: 2017-12-17 Sun 11:59 JST hig. recv/send http://hig3.net ( ) L10 (2017) 1 / 21 IP I swallow.math.ryukoku.ac.jp:13 = 133.83.83.6:13 = : IP ( = ) (well-known ports), :. :,.

More information

1 1.1 C 2 1 double a[ ][ ]; 1 3x x3 ( ) malloc() malloc 2 #include <stdio.h> #include

1 1.1 C 2 1 double a[ ][ ]; 1 3x x3 ( ) malloc() malloc 2 #include <stdio.h> #include 1 1.1 C 2 1 double a[ ][ ]; 1 3x3 0 1 3x3 ( ) 0.240 0.143 0.339 0.191 0.341 0.477 0.412 0.003 0.921 1.2 malloc() malloc 2 #include #include #include enum LENGTH = 10 ; int

More information

Nios II - Vectored Interrupt Controller の実装

Nios II - Vectored Interrupt Controller の実装 ALTIMA Corp. Nios II Vectored Interrupt Controller の実装 ver.1.0 2010 年 7 月 ELSENA,Inc. 目次 1. はじめに... 3 2. 適用条件... 3 3. システムの構成... 4 3-1. SOPC Builder の設定... 4 3-2. ペリフェラルの設定... 4 3-2-1. VIC の設定... 4 3-2-2.

More information

Lab GPIO_35 GPIO

Lab GPIO_35 GPIO 6,GPIO, PSoC 3/5 GPIO HW Polling and Interrupt PSoC Experiment Lab PSoC 3/5 GPIO Experiment Course Material 6 V2.02 October 15th. 2012 GPIO_35.PPT (65 Slides) Renji Mikami [email protected] Lab GPIO_35

More information

Nios II IDE によるソフトウェア開発 セクション 2

Nios II IDE によるソフトウェア開発  セクション 2 ALTIMA Corp. Nios II IDE によるソフトウェア開発セクション 2 ver.1.0 2010 年 8 月 ELSENA,Inc. Nios II IDE によるソフトウェア開発セクション 2 目次 1. はじめに... 4 2. Nios II ソフトウェア プロジェクトが必要とする重要なファイル... 4 2-1. HAL システム ヘッダファイル... 4 2-2. リンカ

More information

: Nonblocking I/O readpartial read EOF Solaris FILE 256 ungetc SEGV errno stdio considered harmful p.

: Nonblocking I/O readpartial read EOF Solaris FILE 256 ungetc SEGV errno stdio considered harmful p. stdio considered harmful [email protected] 2005 06 02 stdio considered harmful p. : Nonblocking I/O readpartial read EOF Solaris FILE 256 ungetc SEGV errno stdio considered harmful p. : stdio stdio Nonblocking

More information

ARM gcc Kunihiko IMAI 2009 1 11 ARM gcc 1 2 2 2 3 3 4 3 4.1................................. 3 4.2............................................ 4 4.3........................................

More information

Nios IIプロセッサ・リファレンス・ハンドブック、セクション I. Nios IIプロセッサ Ver. 1.2

Nios IIプロセッサ・リファレンス・ハンドブック、セクション I. Nios IIプロセッサ Ver. 1.2 I. Nios II Nios II 1 2 3 4 SOPC Builder Nios II Altera Corporation I 1 Nios II 1 4 Nios II Nios II / 1 2004 9 v1.1 Nios II 1.01 2004 5 v1.0 2 2004 12 v1.2 ctl5 2004 9 v1.1 Nios II 1.01 2004 5 v1.0 3 2004

More information

mbed_library_study_meeting_v1.0.key

mbed_library_study_meeting_v1.0.key mbed _mbed 2014 11 7 https://atnd.org/events/57766 version 1.0, 07-Nov.-2014 Tedd OKANO mbed - - 4.0 (^^; 1 mbed TEDD OKANO https://twitter.com/tedd_okano 10 I 2 C http://developer.mbed.org/users/okano/

More information

thesis.dvi

thesis.dvi H8 e041220 2009 2 Copyright c 2009 by Kentarou Nagashima c 2009 Kentarou Nagashima All rights reserved , H8.,,,..,.,., AKI-H8/3052LAN. OS. OS H8 Write Turbo. H8 C, Cygwin.,., windows. UDP., (TA7279P).,.

More information

r07.dvi

r07.dvi 19 7 ( ) 2019.4.20 1 1.1 (data structure ( (dynamic data structure 1 malloc C free C (garbage collection GC C GC(conservative GC 2 1.2 data next p 3 5 7 9 p 3 5 7 9 p 3 5 7 9 1 1: (single linked list 1

More information

ohp07.dvi

ohp07.dvi 19 7 ( ) 2019.4.20 1 (data structure) ( ) (dynamic data structure) 1 malloc C free 1 (static data structure) 2 (2) C (garbage collection GC) C GC(conservative GC) 2 2 conservative GC 3 data next p 3 5

More information

Nios II カスタム・インストラクションによるキャスト(型変換)の高速化

Nios II カスタム・インストラクションによるキャスト(型変換)の高速化 ver. 9.1 2009 年 12 月 1. はじめに Nios II にオプションで実装できる浮動小数演算カスタム インストラクションは 浮動小数四則演算はサポートしているものの 整数から浮動小数にキャスト ( 型変換 ) する機能やその逆の機能は備えていません この資料では 単精度浮動小数型と整数型の変換を簡単に Nios II のカスタム インストラクションに実装する方法を紹介しています なお

More information

tutorial_lc.dvi

tutorial_lc.dvi 00 Linux v.s. RT Linux v.s. ART-Linux Linux RT-Linux ART-Linux Linux [email protected] 1 1.1 Linux Yes, No.,. OS., Yes. Linux,.,, Linux., Linux.,, Linux. Linux.,,. Linux,.,, 0..,. RT-Linux

More information

Avalon Memory-Mappedブリッジ

Avalon Memory-Mappedブリッジ 11. Avalon emory-apped QII54020-8.0.0 Avalon emory-apped Avalon- OPC Builder Avalon- OPC Builder Avalon- OPC Builder Avalon-11 9 Avalon- Avalon- 11 12 Avalon- 11 19 OPC Builder Avalon emory-apped Design

More information

I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) + x * x + x x (4) * *

I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) + x * x + x x (4) * * 2015 2015 07 30 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) +

More information

新・明解C言語 ポインタ完全攻略

新・明解C言語 ポインタ完全攻略 2 1-1 1-1 /* 1-1 */ 1 int n = 100; int *p = &n; printf(" n %d\n", n); /* n int */ printf("*&n %d\n", *&n); /* *&n int */ printf(" p %p\n", p); /* p int * */ printf("&*p %p\n", &*p); /* &*p int * */ printf("sizeof(n)

More information

untitled

untitled II 4 Yacc Lex 2005 : 0 1 Yacc 20 Lex 1 20 traverse 1 %% 2 [0-9]+ { yylval.val = atoi((char*)yytext); return NUM; 3 "+" { return + ; 4 "*" { return * ; 5 "-" { return - ; 6 "/" { return / ; 7 [ \t] { /*

More information

複数の Nios II を構成する際の注意事項

複数の Nios II を構成する際の注意事項 ver. 1.0 2009 年 4 月 1. はじめに Nios II IDE で ソフトウェアをビルドすると SOPC Builder の GUI 上で Nios II と接続されているペリフェラル用の初期化コードを自動で生成します この各ペリフェラルに対応した初期化コードで ペリフェラルを制御するためにアルテラ社から提供された HAL を利用するための準備や 各ペリフェラルの一般的な理想と考えられる初期状態のレジスタ設定等を行います

More information

DA100データアクイジションユニット通信インタフェースユーザーズマニュアル

DA100データアクイジションユニット通信インタフェースユーザーズマニュアル Instruction Manual Disk No. RE01 6th Edition: November 1999 (YK) All Rights Reserved, Copyright 1996 Yokogawa Electric Corporation 801234567 9 ABCDEF 1 2 3 4 1 2 3 4 1 2 3 4 1 2

More information

MINI2440マニュアル

MINI2440マニュアル ARM Cortex-M3 STM32F103 (GCC TOPPERS/ASP ) http://www.nissin-tech.com [email protected] 2009/10/15 copyright@2009 1 STM32F103...3 STM32...4...8 3.1...8 3.2...9 3.3...13 KEIL...19 4.1 KEIL...19 4.2...22

More information

II ( ) prog8-1.c s1542h017%./prog8-1 1 => 35 Hiroshi 2 => 23 Koji 3 => 67 Satoshi 4 => 87 Junko 5 => 64 Ichiro 6 => 89 Mari 7 => 73 D

II ( ) prog8-1.c s1542h017%./prog8-1 1 => 35 Hiroshi 2 => 23 Koji 3 => 67 Satoshi 4 => 87 Junko 5 => 64 Ichiro 6 => 89 Mari 7 => 73 D II 8 2003 11 12 1 6 ( ) prog8-1.c s1542h017%./prog8-1 1 => 35 Hiroshi 2 => 23 Koji 3 => 67 Satoshi 4 => 87 Junko 5 => 64 Ichiro 6 => 89 Mari 7 => 73 Daisuke 8 =>. 73 Daisuke 35 Hiroshi 64 Ichiro 87 Junko

More information

44 6 MPI 4 : #LIB=-lmpich -lm 5 : LIB=-lmpi -lm 7 : mpi1: mpi1.c 8 : $(CC) -o mpi1 mpi1.c $(LIB) 9 : 10 : clean: 11 : -$(DEL) mpi1 make mpi1 1 % mpiru

44 6 MPI 4 : #LIB=-lmpich -lm 5 : LIB=-lmpi -lm 7 : mpi1: mpi1.c 8 : $(CC) -o mpi1 mpi1.c $(LIB) 9 : 10 : clean: 11 : -$(DEL) mpi1 make mpi1 1 % mpiru 43 6 MPI MPI(Message Passing Interface) MPI 1CPU/1 PC Cluster MPICH[5] 6.1 MPI MPI MPI 1 : #include 2 : #include 3 : #include 4 : 5 : #include "mpi.h" 7 : int main(int argc,

More information

/ SCHEDULE /06/07(Tue) / Basic of Programming /06/09(Thu) / Fundamental structures /06/14(Tue) / Memory Management /06/1

/ SCHEDULE /06/07(Tue) / Basic of Programming /06/09(Thu) / Fundamental structures /06/14(Tue) / Memory Management /06/1 I117 II I117 PROGRAMMING PRACTICE II 2 MEMORY MANAGEMENT 2 Research Center for Advanced Computing Infrastructure (RCACI) / Yasuhiro Ohara [email protected] / SCHEDULE 1. 2011/06/07(Tue) / Basic of Programming

More information

Nios II Flash Programmer ユーザ・ガイド

Nios II Flash Programmer ユーザ・ガイド ver. 8.0 2009 年 4 月 1. はじめに 本資料は Nios II 開発環境においてフラッシュメモリ または EPCS へのプログラミングを行う際の参考マニュアルです このマニュアルでは フラッシュメモリの書き込みの際に最低限必要となる情報を提供し さらに詳しい情報はアルテラ社資料 Nios II Flash Programmer User Guide( ファイル名 :ug_nios2_flash_programmer.pdf)

More information

Linux on ITRON-ハイブリッド構造の実装

Linux on ITRON-ハイブリッド構造の実装 Linux on ITRON ハイブリッド構造の実装 目次... 2 Linux... 3... 4... 5 Linux Emblix... 6... 6... 7 OS... 8 FIFO... 8... 11...14 OS...14 Linux...17...18 OS...20...21...22...22 /...25 OS...28 ITRON...29...30 /...30 ITRON...30

More information

matrox0

matrox0 Image processing products Hardware/Software Software Hardware INDEX 4 3 2 12 13 15 18 14 11 10 21 26 20 9 8 7 6 5 Hardware 2 MatroxRadient 3 MatroxSolios MatroxMorphis MatroxVio 10 MatroxOrionHD 11 MatroxConcord

More information

1.ppt

1.ppt /* * Program name: hello.c */ #include int main() { printf( hello, world\n ); return 0; /* * Program name: Hello.java */ import java.io.*; class Hello { public static void main(string[] arg)

More information

VISPO /表1-4

VISPO /表1-4 7 2005 1,132 5,249 362 13,666 311,809 1,359 3,723 1,669 538 3,737 17,418 39,036 75,694 5,281 1,169 161,502 7,463 11,408,436 500,000 13,263 192,052 41,391 49,706 136,232 61,102 12,402,182 11,573,898 273,042

More information

mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( )

mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( ) 2008 3 10 1 mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( ) stream FILE ( man ) 40 ( ) %./a.out String : test

More information

第3章 OpenGL の基礎

第3章 OpenGL の基礎 3 OpenGL April 20, 2012 1 / 23 31 ( ) OpenGL OpenGL 2 / 23 32 OpenGL OpenGL OpenGL (Open Graphics Library) Silicon Graphics, Inc 2 3 API (Application Program Interface) [4] UNIX OS Windows Macintosh CAD

More information

pgen :: net_stream net (" eth0 ", pgen :: open_mode :: netif ); uint8_t buf [10000]; size_t recvlen = net. recv (buf, sizeof buf ); pgen :: udp pack (

pgen :: net_stream net ( eth0 , pgen :: open_mode :: netif ); uint8_t buf [10000]; size_t recvlen = net. recv (buf, sizeof buf ); pgen :: udp pack ( 第24回マルチメディア通信と分散処理ワークショップ論文集 平成28年10月 OSS のパケット解析ライブラリを使用し, プログラミング言語からパケット解析を行う手法の提案 城倉 弘樹,a) 金井 敦,b) 概要 これまでのパケット解析は Wireshark などのパケット解析アプリケーションを利用した解析が定石 である. しかし, このようなパケット解析では柔軟な処理などに対して限界があり, より高度な通信解析を

More information

1. 入力した正の整数を降順に並べ換えて出力するプログラムを作成せよ プログラムは個別にコンパイルし make コマンドで実行すること 入力データは 50 以下とし 以下の数が混在しているとする 16 進数 : 先頭 1 文字が x または X( エックスの小文字か大文字 ) 8 進数 : 先頭 1

1. 入力した正の整数を降順に並べ換えて出力するプログラムを作成せよ プログラムは個別にコンパイルし make コマンドで実行すること 入力データは 50 以下とし 以下の数が混在しているとする 16 進数 : 先頭 1 文字が x または X( エックスの小文字か大文字 ) 8 進数 : 先頭 1 1. 入力した正の整数を降順に並べ換えて出力するプログラムを作成せよ プログラムは個別にコンパイルし make コマンドで実行すること 入力データは 50 以下とし 以下の数が混在しているとする 16 進数 : 先頭 1 文字が x または X( エックスの小文字か大文字 ) 8 進数 : 先頭 1 文字が 0( 零 ) 10 進数 : 先頭 1 文字が 0( 零 ) 以外の数字 1.1 プログラム

More information

:30 12:00 I. I VI II. III. IV. a d V. VI

:30 12:00 I. I VI II. III. IV. a d V. VI 2018 2018 08 02 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF N N y N x N xy yx : yxxyxy N N x, y N (parse tree) (1) yxyyx (2) xyxyxy (3) yxxyxyy (4) yxxxyxxy N y N x N yx

More information

DPD Software Development Products Overview

DPD Software Development Products Overview 2 2007 Intel Corporation. Core 2 Core 2 Duo 2006/07/27 Core 2 precise VTune Core 2 Quad 2006/11/14 VTune Core 2 ( ) 1 David Levinthal 3 2007 Intel Corporation. PC Core 2 Extreme QX6800 2.93GHz, 1066MHz

More information

【注意事項】RXファミリ 組み込み用TCP/IP M3S-T4-Tiny

【注意事項】RXファミリ 組み込み用TCP/IP M3S-T4-Tiny 注意事項 RX ファミリ組み込み用 TCP/IP M3S-T4-Tiny R20TS0227JJ0100 Rev.1.00 号 概要 RX ファミリ組み込み用 TCP/IP M3S-T4-Tiny ( 注 ) の使用上の注意事項を連絡します 1. Ping Reply パケットに関する注意事項 2. LAN ネットワーク環境に関する注意事項 3. select() 関数のタイムアウト設定値に関する注意事項

More information

ファイル入出力と プロセス間通信 \(1\)

ファイル入出力と プロセス間通信 \(1\) ファイル入出力と プロセス間通信 (1) 2004 年 12 月 10 日 海谷治彦 1 目次 まずはマニュアルをみよう. 2 章システムコールインタフェース 3 章汎用関数定義 アンバッファー化入出力 (Unbuffered I/O) open, read, write... lseek, dup... 標準入出力ライブラリ fopen, fscanf, fprintf... 標準入力, 標準出力,

More information

file"a" file"b" fp = fopen("a", "r"); while(fgets(line, BUFSIZ, fp)) {... fclose(fp); fp = fopen("b", "r"); while(fgets(line, BUFSIZ, fp)) {... fclose

filea fileb fp = fopen(a, r); while(fgets(line, BUFSIZ, fp)) {... fclose(fp); fp = fopen(b, r); while(fgets(line, BUFSIZ, fp)) {... fclose I117 9 2 School of Information Science, Japan Advanced Institute of Science and Technology file"a" file"b" fp = fopen("a", "r"); while(fgets(line, BUFSIZ, fp)) {... fclose(fp); fp = fopen("b", "r"); while(fgets(line,

More information

J.JSSAC Vol. 7, No. 2, Mathematica Maple,., Open asir Open xxx asir. Open xxx Open asir, asir., Open xxx, Linux Open asir Open sm1 (kan/sm1). C

J.JSSAC Vol. 7, No. 2, Mathematica Maple,., Open asir Open xxx asir. Open xxx Open asir, asir., Open xxx, Linux Open asir Open sm1 (kan/sm1). C J.JSSAC (1999) Vol. 7, No. 2, pp. 2-17 Open asir HPC (Received 1997/12/1) 1 Open asir Open xxx,., ( ),,,,,.,., (1) (2) (3) (4),. Open xxx,.,., 1.,.,., 0 10, dx,.,., [email protected] [email protected]

More information

第3章 OpenGL の基礎

第3章 OpenGL の基礎 3 OpenGL April 11, 2017 1 / 28 3.1 ( ) OpenGL OpenGL 2 / 28 3.2 OpenGL OpenGL OpenGL (Open Graphics Library) Silicon Graphics, Inc. 2 3 API (Application Program Interface) [4] UNIX OS Windows Macintosh

More information

SOPC Builder ペリフェラル 簡易ユーザ・ガイド - PIO (Parallel I/O)

SOPC Builder ペリフェラル 簡易ユーザ・ガイド - PIO (Parallel I/O) ALTIMA Corp. SOPC Builder ペリフェラル簡易ユーザ マニュアル PIO (Parallel I/O) ver.1.0 2010 年 8 月 ELSENA,Inc. SOPC Builder ペリフェラル簡易ユーザ マニュアル PIO (Parallel I/O) 目次 1. はじめに... 3 2. PIO 概要... 3 2-1. PIO 概要... 3 2-2. PIO

More information

r08.dvi

r08.dvi 19 8 ( ) 019.4.0 1 1.1 (linked list) ( ) next ( 1) (head) (tail) ( ) top head tail head data next 1: NULL nil ( ) NULL ( NULL ) ( 1 ) (double linked list ) ( ) 1 next 1 prev 1 head cur tail head cur prev

More information

void hash1_init(int *array) int i; for (i = 0; i < HASHSIZE; i++) array[i] = EMPTY; /* i EMPTY */ void hash1_insert(int *array, int n) if (n < 0 n >=

void hash1_init(int *array) int i; for (i = 0; i < HASHSIZE; i++) array[i] = EMPTY; /* i EMPTY */ void hash1_insert(int *array, int n) if (n < 0 n >= II 14 2018 7 26 : : [email protected] 14,, 8 2 12:00 1 O(1) n O(n) O(log n) O(1) 32 : 1G int 4 250 M 2.5 int 21 2 0 100 0 100 #include #define HASHSIZE 100 /* */ #define NOTFOUND 0

More information

bitvisor-ipc v12b.key

bitvisor-ipc v12b.key PC PC OS PC PC 1 1 2 101 101 enum tre_rpc_direction { TRE_RPC_DIRECTION_REQUEST, TRE_RPC_DIRECTION_RESULT }; struct tre_rpc_request { }; enum tre_rpc_direction direction; ulong id; ulong proc_number;

More information

CM-3G 周辺モジュール拡張技術文書 MS5607センサ(温度、気圧)

CM-3G 周辺モジュール拡張技術文書 MS5607センサ(温度、気圧) CM-3G 周辺モジュール拡張技術文書 MS5607 センサ ( 温度 気圧 ) ( 第 1 版 ) Copyright (C)2016 株式会社コンピューテックス 目次 1. はじめに... 1 2. MS5607 について... 1 3. 接続図... 1 4. アプリケーション ソース... 2 5. アプリケーションのコンパイル方法... 7 6. アプリケーションの実行... 8 1. はじめに

More information

QW-3414

QW-3414 MA1312-C P 1 2 3 A E L D E D A A E D A D D D D D E A C A C E D A A A C A C A C E E E D D D A C A C A A A A C A C A C E E C C E D D C C C E C E C C E C C C E D A C A C A C E L B B

More information

昨年度までの研究紹介 および 研究計画

昨年度までの研究紹介 および 研究計画 第 12 回 ICN 研究会ワークショップ Cefore で キャッシュプラグイン開発 2018 年 8 月 30 日 ( 木 ) キャッシュプラグイン csmgrd は起動時に使用するキャッシュプラグインを指定 Cache plugin: キャッシュデータ保存方式 Cache algorithm: キャッシュ選択 / 置換アルゴリズム Cache Plugin Cache algorithm csmgrd

More information

3.1 stdio.h iostream List.2 using namespace std C printf ( ) %d %f %s %d C++ cout cout List.2 Hello World! cout << float a = 1.2f; int b = 3; cout <<

3.1 stdio.h iostream List.2 using namespace std C printf ( ) %d %f %s %d C++ cout cout List.2 Hello World! cout << float a = 1.2f; int b = 3; cout << C++ C C++ 1 C++ C++ C C++ C C++? C C++ C *.c *.cpp C cpp VC C++ 2 C++ C++ C++ [1], C++,,1999 [2],,,2001 [3], ( )( ),,2001 [4] B.W. /D.M.,, C,,1989 C Web [5], http://kumei.ne.jp/c_lang/ 3 Hello World Hello

More information

ikuo/enshu/keisanki/ GUI(Graphica

ikuo/enshu/keisanki/ GUI(Graphica 2008 ([email protected]) http://www.jsk.t.u-tokyo.ac.jp/ http://www.jsk.t.u-tokyo.ac.jp/ ikuo/enshu/keisanki/ 2008 5 16 6 23 1 2 1 GUI(Graphical User Interface) 2 2.1 CD USB ( LSI ) (hardware abstraction)

More information

Microsoft Word - ALT0982_program_epcs_by_niosii_v10.doc

Microsoft Word - ALT0982_program_epcs_by_niosii_v10.doc ver. 1.0 2008 年 6 月 1. はじめに この資料では ホスト PC に存在する ハードウェアのコンフィギュレーション データ ファイルをホスト ファイルシステムの機能を使用して Nios II システム メモリへ転送し そのコンフィギュレーション データを Nios II を使って EPCS へプログラムする手法を紹介します この資料は Quartus II ver.7.2 SP3

More information

r03.dvi

r03.dvi 19 ( ) 019.4.0 CS 1 (comand line arguments) Unix./a.out aa bbb ccc ( ) C main void... argc argv argc ( ) argv (C char ) ( 1) argc 4 argv NULL. / a. o u t \0 a a \0 b b b \0 c c c \0 1: // argdemo1.c ---

More information

17 1. strucr Potter ( ) Harry Potter and the Philosopher s Stone 1997 English Title : Harry Potter and the Philosopher s Stone : : 1997 #include<stdio

17 1. strucr Potter ( ) Harry Potter and the Philosopher s Stone 1997 English Title : Harry Potter and the Philosopher s Stone : : 1997 #include<stdio 17 1. strucr Potter ( ) Harry Potter and the Philosopher s Stone 1997 English Title : Harry Potter and the Philosopher s Stone : : 1997 #include typedef struct Potter{ Potter; int main(void){

More information

yacc.dvi

yacc.dvi 2017 c 8 Yacc Mini-C C/C++, yacc, Mini-C, run,, Mini-C 81 Yacc Yacc, 1, 2 ( ), while ::= "while" "(" ")" while yacc 1: st while : lex KW WHILE lex LPAREN expression lex RPAREN statement 2: 3: $$ = new

More information

C言語によるアルゴリズムとデータ構造

C言語によるアルゴリズムとデータ構造 Algorithms and Data Structures in C 4 algorithm List - /* */ #include List - int main(void) { int a, b, c; int max; /* */ Ÿ 3Ÿ 2Ÿ 3 printf(""); printf(""); printf(""); scanf("%d", &a); scanf("%d",

More information