Forum Discussion
Altera_Forum
Honored Contributor
20 years ago --- Quote Start --- originally posted by zhzhn1980+oct 19 2005, 09:50 am--><div class='quotetop'>quote (zhzhn1980 @ oct 19 2005, 09:50 am)</div>
--- quote start ---
i wish i can use the nios ii ide console to input some command. then the nios can send the control bytes to a ram in fpga. then nios will tell configuring verilog modules for peripheral chips to fetch these control bytes from ram and send out to the chips.[/b]
--- quote end ---
there's an in-sytem memory contents editor in the altera quartus ii system; you could use that to edit the memory contents directly.
<!--quotebegin-zhzhn1980@Oct 19 2005, 09:50 AM 1. how to use small c library? --- Quote End --- The small C library has no interrupt support, IIRC. So there's no "scanf". You have to read the characters from the UART yourself, then use sscanf(), atol(), strtol(), strtoul(), or something else to deal with them. --- Quote Start --- originally posted by zhzhn1980+oct 19 2005, 09:50 am--><div class='quotetop'>quote (zhzhn1980 @ oct 19 2005, 09:50 am)</div>
--- quote start ---
i don't wanna use any external sram. i've specify the jtag_uart_0 as my stdin and stdout.[/b]
--- quote end ---
the stdio library will use quite a bit of on-chip memory.
--- quote start ---
originally posted by zhzhn1980@oct 19 2005, 09:50 am
obj/hello_world_small.o(.text+0x34): in function `main':
../hello_world_small.c:78: undefined reference to `scanf'
--- quote end ---
scanf() requires interrupt support, thus the full c library.
--- quote start ---
originally posted by zhzhn1980@oct 19 2005, 09:50 am
if i choose not to use small c library, the total elf seems to be huge! around 52k ~ 56k. surely i don't want this small module take up all the memory in ep2c35.
--- quote end ---
that memory usage looks about right. there's a pile of debug symbol tables in the .elf file; this will not be part of the final program image.
to figure out how much memory you're really using, use the nios2-elf-size command:
nio2-elf-size hello_world_small_0.elf
--- quote start ---
originally posted by zhzhn1980@oct 19 2005, 09:50 am
i am still not so familiar with avalon tri-state bridge. do i have to have one in my system if i want my nios to communicate with another ram (not on-chip memory within nios) in the fpga?
--- quote end ---
it's the easiest way; the alternative is writing your own glue logic... which will wind up looking like the tri-state bridge.
<!--quotebegin-zhzhn1980@Oct 19 2005, 09:50 AM since this ram is only for control byte storage. it's not necessary to be very large. i still don't know who to implement such kind of structure. i would really appreciate if someone can give me some brief idea. --- Quote End --- That sounds like a job for on-chip RAM.