Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
1,336 Views

Quartus <--> Nios

Hi all, 

 

I am approaching the end of my project and I think I have the last question concerning it. I have a logical circuit built in Quartus and I have a system that sends packets with payload controlled with onboard swithces (that is built on top of the NET demonstration). How can I combine that? I mean instead of sending the state of the switches, I want to be able to send the state of a signal. 

 

Let's say I have an output signal defined in a project in Quartus and I want to send the state of the signal using a C program in Nios. Can I somehow assign the signal to some address (or maybe some specific component, defined in SOPC Builder), so that I will be able to read it using a C program in Nios? 

 

Please, can anyone give me instructions on how to solve this problem? 

 

Thank you in advance. 

 

Adam
0 Kudos
6 Replies
Altera_Forum
Honored Contributor I
24 Views

Altera_Forum
Honored Contributor I
24 Views

The easiest way is to use a PIO peripheral in SoPC builder. Connect it to your NIOS. Then outside SoPC builder, connect the ports of the PIO to the signal you want to read. Then you can read the signal in NIOS using SoPC builder. By the way, the Simple Socket Server example does something similar except it reads rather than writes. 

 

Jake
Altera_Forum
Honored Contributor I
24 Views

Thanks a lot. So from what I can understand, I should add tristate bridges (PIO) or a memory to the SOPC design, then connect necessary inputs in Quartus project, and finally use the base addresses to access the components from Nios program. Is that right? If so, how to use addressing in SDRAM, for example? In fact I would prefer using PIOs, but I'm not sure how many tristate bridges (if these are the ones I should use) I can add (I have about 40 bits that I have to send over the Ethernet frame). 

 

I hope you can also help me with that. Thank you in advance. 

 

cheers, 

Adam
Altera_Forum
Honored Contributor I
24 Views

Ok, maybe I should be more specific. 

 

I really like the idea of using PIO peripherals. From what I understand I should use tir-state bridges. My problem is, however, that it is impossible to assign specific base addresses to them in SOPC (as they use Flash memory). Does anybody know how I can access them in NIOS? 

 

I would really apprieciate any help. 

 

cheers, 

Adam
Altera_Forum
Honored Contributor I
24 Views

The PIO peripheral connects directly to the NIOS data master bus. Don't use a tristate bridge. 

 

Jake
Altera_Forum
Honored Contributor I
24 Views

 

--- Quote Start ---  

 

Let's say I have an output signal defined in a project in Quartus and I want to send the state of the signal using a C program in Nios. Can I somehow assign the signal to some address (or maybe some specific component, defined in SOPC Builder), so that I will be able to read it using a C program in Nios? 

Adam 

--- Quote End ---  

 

 

Hi Adam, 

 

You can easily implement this by opting for custom component in the SOPC Builder. You can make a new component wherein you can specify the read, read enable, clock, address and data signals for this component. You need not specify any HDL model here. This creates a "component" which is just a simple interface between NIOS and the rest of the HDL design. Here, you don't need any tri-state interface either.  

 

Further, you can also have an Interrupt signal in this interface which is driven by a line that signals you that the state of the signal is up to be read. 

 

I hope that helps.
Reply