Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20707 Discussions

Simple Ethernet port.

Altera_Forum
Honored Contributor II
4,236 Views

I've been tasked with trying to get a simple ethernet port onto some of our specialty boards. For the most part they'd be used to send down control commands and read back simple status. Likely as not the physical connection would be a laptop ether-cable connected to the board but we might want to put them on the network during testing and debug so we don't want conflicts there. It'd be set up with its own IP Address and would respond to only those packets sent to that address. We purchased the Triple Speed Ethernet IP from Altera as wel as a newer Nios II dev brd. Now I've been going through ALL the Altera tutorials, (huge) documents and many other things as well and come to several conclusions. 

The big one is that we don't need an OS and hence don't really need the Nios processor. Its all too big and particularly too complicated for our needs. The "simple socket server" example alone is not at all simple, I can't even figure out where to plug in our set IP Address into it. 

I've been through all the Altera examples and they require at least two engineers, FPGA designer and Embedded Systems Programmer, to perform simple manipulations. I'm alone, FPGA designer. 

What we do need is a simple hardware register set Protocol Stack design. We're willing to buy the IP for such but don't yet know where to find it.  

Does someone out there know? 

Looking for all feedback on this!:confused:
0 Kudos
26 Replies
Altera_Forum
Honored Contributor II
171 Views

I would add RFC1122/1123 requirements for internet hosts to the list of suggested readings, basically a review and protocol walkthrough that also discusses some implementation F.A.Q.  

 

I also can confirm, that it's no problem to design an TCP/IP stack from the scratch, mainly based on the RFCs, and a handy test platform to try your code. I once did for an embedded processor. The three weeks estimation seems to be a good guess to my opinion.  

 

Regarding TCP, there are some embedded products, that have omitted reassembly. You typically won't never be aware, unless you test it explicitely, or use a very lossy internet connection. Reassembly of consecutive fragments can be needed with some likelihood, if the communication is routed over media with restricted packet length, but it's not too difficult to implement. UDP is much easier, as said, and it's clearly more effective for a communication, that repeatedly exchanges commands and state data, while TCP is preferable for data streams (although not necessarily required).
0 Kudos
Altera_Forum
Honored Contributor II
171 Views

Hi, Jake, i'm trying to use this SUper Loop example in QuartusII 8.0 and it seems too complicated. Could you spread to all altera users this port you have done? 

 

Thanks
0 Kudos
Altera_Forum
Honored Contributor II
171 Views

I'm looking for this patch too, Jake. 

 

Thanks
0 Kudos
Altera_Forum
Honored Contributor II
171 Views

I'll see what I can do. As I said before, we applied the patch to the InterNiche stack shipped with version 7.1, We then manually diff'd and rolled the changes to 7.2. We have been using the modified 7.2 version of the stack since that time.  

 

As such, I don't have a patch that you can apply to 8.0 as it's a very different version of the stack. And I hesitate to simply post an entire copy of the modified stack in case there are legal implications. I'll see what I can do. 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
171 Views

 

--- Quote Start ---  

Now I have to interject. Gentlemen, the terms hardware engineer and software engineer are dying fast. You must become a design engineer with the ability to cross that line at least somewhat. I am an FPGA / PCB design engineer. However, I also have an extensive software skill set and indeed have a minor in Computer Science. The days of hardware design being seperate from software design are disappearing. You can't design your board and then throw it over the wall to the software engineer and ask him to test it for you.  

 

Hardware is utterly worthless without something to make use of it. 

 

Now with regards to the Ethernet offering from Altera: 

1 - I have been extremely pleased with SoPC builder. I don't think I've ever had it crash on me and it is extremely simple to use. The truth is that Altera has invested significant amounts of money in SoPC builder and the Avalon fabric. It generates a very minimal amount of files and the file structure is very simple. If you truly want that proven to you, go use Xilinx's EDK for a day. I use both regularly and I can easily tell you that EDK will likely have you giving up on embedded soft-core processors forever. 

 

2 - I don't know how Altera could make it much easier. Basically you drop in an ethernet MAC and the TCP/IP stack and it works right off the bat. Now if you want to modify the Simple Socket Server example, you need to know sockets. But that has nothing to do with Altera or Ethernet. Sockets are what they are and they would be the same level of difficulty no matter where you were trying to implement them. 

 

3 - If you are going to do anything useful with ethernet then truly you are going to need some software skills (be they yours or someone else's). Sockets and TCP/IP are not hardware elements. With regards to ethernet, once you get past the lowest layer of the ISO model, you are no longer hardware. Now you may purchase some IC's that implement a TCP/IP stack but really all you've done is paid someone else to do the software for you. 

 

If you need help, then don't spend your time pouring over the documentation if it's not helping you understand what it is you need to do. Come here and ask for help. There are many individuals experience and for them this stuff might be easy.  

 

The first time I implemented ethernet on the NIOS, I had not had any prior experience with sockets programming. But I was able to get it running with a little time investment. 

 

The problem I see with Bob's requirements is they are basically telling him to implement Gigabit capable ethernet using zero resources. Now if you really want to go down the path of trying to implement a TCP/IP stack in the NIOS using only the onchip RAM ... We can see if that's possible. 

 

With regards to using the InterNiche TCP/IP stack in superloop mode (no Operating System), There is a patch available on the internet for the version of the stack that was released with version 7.1 of the Altera tools. We ran the patch on that version then ported the changes over to 7.2. We still use that version of the stack to run in superloop mode even though we are using version 9.0 of the Altera tools. 

http://www.nioswiki.com/user:admin/%22super_loop%22_nichestack 

 

Jake 

--- Quote End ---  

 

 

Hello, 

 

I am trying to use the NicheStack in superloop mode with NIOS II for Eclipse. I tried to follow your link but it is not working. 

Can you advise me on this issue. 

 

Thanks & Regards
0 Kudos
Altera_Forum
Honored Contributor II
171 Views

 

--- Quote Start ---  

I'm using NIOSII + uCOSII + Interniche and a UDP modified version from the single socket server. 

 

I am very interested in using the Interniche stack TCP_IP without SO. How can I do it? 

--- Quote End ---  

 

 

Did you found an answer to your question? 

 

Thanks & Regards
0 Kudos
Reply