RISC-V eXpress Software Development Manual
- Standard Library Porting -

Kyuseung Han, Sukho Lee, Jae-Jin Lee
ETRI, Daejeon, South Korea

v2025-07-10 or later

Simple Replacement of Headers

File I/O Porting

Overview

Converting Input Files to Headers

cmd) cd #(platform dir)
cmd) make user
cmd) make util
cmd) cd #(platform dir)/util
cmd) make fakefile
cmd) cd #(platform dir)/util/fakefile
cmd) mkdir target
inst) Copy the input files into the ‘target’ directory.
cmd) make all

Modifying C Code

Original Modified
Variable/Function Header Variable/Function Header
SEEK_SET stdio.h - ervp_fakefile.h
SEEK_CUR stdio.h - ervp_fakefile.h
SEEK_END stdio.h - ervp_fakefile.h
FILE stdio.h FAKEFILE ervp_fakefile.h
fopen stdio.h ffopen ervp_fakefile.h
fputc stdio.h ffputc ervp_fakefile.h
fgetc stdio.h ffgetc ervp_fakefile.h
feof stdio.h ffeof ervp_fakefile.h
fclose stdio.h ffclose ervp_fakefile.h
fgetline stdio.h ffgetline ervp_fakefile.h
fread stdio.h ffread ervp_fakefile.h
ftell stdio.h fftell ervp_fakefile.h
fseek stdio.h ffseek ervp_fakefile.h

Setting Up Compilation Environment

cmd) cd #(app dir)
cmd) make rvx_each
inst) Uncomment ‘USE_FAKEFILE=true’ in rvx_each.mh

Retrieving Output Files to a PC

cmd) cd #(imp dir)
cmd) make dump

Navigate