Altera_Forum
Honored Contributor
17 years agoRam
Hi,
If i want to have the output to be written to RAM available in my DE-2 board. Can anyone give me some guideline on how to start doing it? I dont have any idea of how to do it. Thanks alotHi,
If i want to have the output to be written to RAM available in my DE-2 board. Can anyone give me some guideline on how to start doing it? I dont have any idea of how to do it. Thanks alotYour question is too vague. What output are you referring to?
Jakehi Jake
erm..actually i have written a code that perform some arithmetic calculation. i can get the result from simulator but when i download the code to fpga, i need to have the result stored in somewhere so that i can retrieve it. so i was thinking perhaps i can write the output to RAM ? and try to read the output from there?Okay so you've got some piece of code in your FPGA that's going to perform some calculation. How often does it do this?
Let's forget about RAM at this point because so far your problem description doesn't indicate RAM to be the required method. Once you get the result, you would like to read it. Where exactly are you reading it to? A host PC? Are you really just wanting to see the result of the calculation? Jakehi Jake
at the moment i just only want to read the result of the calculation that's it. so any advice on how should i do so?Use SOPC builder to create a system with a NIOS processor, some onchip memory, a jtag uart, and an input PIO. Outside the system, connect your calculation result to the PIO. Then you write a small piece of C code that simply reads the PIO port and prints the result out the jtag uart.
Jakehmm..by the way what is SOPC builder and PIO? and why have to be C code??
sorry for the trouble...You could also just use SignalTap (Altera's built in Logic analyzer). That will let you see the signals inside your module.
JakeHow exactly were you planning on reading the result out of memory once you got it there? Do you already have some mechanism for doing this and somehow routing the information out via a human interface?
JakeWell in case you decide to venture out of your comfort zone a bit, I've written the SOPC system and C code for you and attached it. The top level file is "simple_sopc.v" and it's port declaration looks like this:
module simple_sopc ( // 1) global signals: clk, reset_n, // the_result_pio in_port_to_the_result_pio ) ; clk is a 50mhz clock input. reset_n is an active low asynchronous reset, "in_port_to_the_result_pio" is a 32-bit input to a PIO where you would connect your result. The only thing you have left to do is add this to your system and figure out how to connect to the processor using the "nios2-terminal.exe" application. You don't even have to open the NIOS2 IDE and look at the C-code as I've precompiled the processors memory file. I'm thinking SignalTap will be your easiest solution. Jakewell, thanks alot Jake. i will try out both Signal Tap and the SOPC methods. Im new in these so i want to learn as much as i could. thanks alot for the guide. i will let you know if i have further problems during the tryout.