Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)

Ram

Altera_Forum
Honored Contributor II
2,652 Views

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 alot
0 Kudos
14 Replies
Altera_Forum
Honored Contributor II
1,965 Views

Your question is too vague. What output are you referring to? 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
1,965 Views

hi 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?
0 Kudos
Altera_Forum
Honored Contributor II
1,965 Views

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? 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
1,965 Views

hi 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?
0 Kudos
Altera_Forum
Honored Contributor II
1,965 Views

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. 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
1,965 Views

hmm..by the way what is SOPC builder and PIO? and why have to be C code??  

sorry for the trouble...
0 Kudos
Altera_Forum
Honored Contributor II
1,965 Views

You could also just use SignalTap (Altera's built in Logic analyzer). That will let you see the signals inside your module. 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
1,965 Views

How 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? 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
1,965 Views

Well 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. 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
1,965 Views

well, 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.

0 Kudos
Altera_Forum
Honored Contributor II
1,965 Views

Another solution may be to instantiate an ALTSYNCRAM Megafunction (of the proper size) in your design and write into its write port all your output data. Then connect to its read port an UART module which can be used to drive an external RS232 transceiver. So the RS232 connection with a COM port of your PC may complete your job.

0 Kudos
Altera_Forum
Honored Contributor II
1,965 Views

 

--- Quote Start ---  

Another solution may be to instantiate an ALTSYNCRAM Megafunction (of the proper size) in your design and write into its write port all your output data. Then connect to its read port an UART module which can be used to drive an external RS232 transceiver. So the RS232 connection with a COM port of your PC may complete your job. 

--- Quote End ---  

 

 

ok ok..i will try out! thanks
0 Kudos
Altera_Forum
Honored Contributor II
1,965 Views

cLaRe, 

 

My appoligies. There was a small bug in the C code of my first ZIP file. Here is a corrected version. 

 

Thanks, 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
1,965 Views

Jake, 

 

Thanks alot!!! :D
0 Kudos
Reply