FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits
5932 Discussions

Ethernet with DSP Dev. Kit Cyclone III (no NIOS)

Altera_Forum
Honored Contributor II
3,567 Views

Hi, 

 

I have the dsp development kit, cyclone iii edition (http://www.altera.com/products/devkits/altera/kit-cyc3-dsp.html).  

 

How can I use the Ethernet? 

 

In my altera > 80 > ip Directory I have triple_speed_ethernet. Will that work with this board? 

 

Or will I need additional IP-Cores? Will they also be shipped with my dev. kit? 

 

And are there IP-Cores for USB-Communication? 

 

Kind regards, 

Stefan__
0 Kudos
66 Replies
Altera_Forum
Honored Contributor II
775 Views

By NIOS memory I meant any memory that can be accessed by the Nios CPU. So you should be able to read the DDR SDRAM too. 

 

For the SDRAM access, it really depends on how you do it. If you put the DDR controller in the SOPC system, your custom IP and the NIOS can share access to the RAM. Arbitration will be made automatically by SOPC builder. Your custom IP will need to use an Avalon master interface to wlite to the RAM. 

Another alternative could be to use a ready made DMA IP to write the data to RAM for you. If you format your data in Avalon streams, you can use the SGDMA IP to transfer it to RAM.
0 Kudos
Altera_Forum
Honored Contributor II
775 Views

As you said it in your previous post, it is possible in principle to have the FPGA and the NIOS CPU running at the same time (and sharing access to SDRAM, for example). So this would be one easy solution. Yesterday I tried to do the simple socket server example [...] (http://www.alteraforum.com/forum/showthread.php?p=73770), which is also working now finally. 

 

After all, I decided to give coding the ethernet/ip/udp protocol in hardware a try. I already know what documents I have to read in general for this purpose: 

 

UDP: rfc 768 - user datagram protocol (http://tools.ietf.org/html/rfc768) (It's much simpler than tcp (http://tools.ietf.org/html/rfc793)) 

IP: rfc 791 - internet protocol (http://tools.ietf.org/html/rfc791

Ethernet: rfc 826 - ethernet address resolution protocol (http://tools.ietf.org/html/rfc826) <--- is this the right document?? 

 

Maybe it's not that difficult as I thought. I should give it a try at least. If it doesn't work I will have to use the NIOS as an ethernet driver, because it doesn't seem that I will get very far with USB.
0 Kudos
Altera_Forum
Honored Contributor II
775 Views

The RFC 826 is just the ARP protocol, i.e. the protocol that can give you a MAC address from an IP address. It is not the easiest to read, I'm sure other online resources that can give a more readable information. 

You should have a more detailed look at the UDP offload example, it is well documented. IIRC they still use the NIOS to get the mac address through the ARP protocol, and then feed the hardware with the correct information to generate the UDP/IP/Ethernet packets.
0 Kudos
Altera_Forum
Honored Contributor II
775 Views

 

--- Quote Start ---  

The RFC 826 is just the ARP protocol, i.e. the protocol that can give you a MAC address from an IP address. It is not the easiest to read, I'm sure other online resources that can give a more readable information. 

--- Quote End ---  

 

 

There are many (http://www.faqs.org/rfcs/np.html#eth) of ethernet related rfc. Maybe it's better explained in wikipedia: http://en.wikipedia.org/wiki/ethernet#physical_layer 

What do you think is better? 

 

 

--- Quote Start ---  

You should have a more detailed look at the UDP offload example, it is well documented. 

--- Quote End ---  

 

 

Yes, I will do that later. 

 

If I try to use triple speed ethernet (without NIOS) then I think I don't need the SOPC Builder, or do I need it? I added triple speed ethernet megafunction. But at the moment I am not sure how to connect all the pins. 

 

In my hardware reference manual I have 16 address lines, but the TSE IP-Core has only 8 address lines... 

I guess the data lines are bidirectional, so I have chosen the pins 'bidir' and assigned them according to the data sheet. But if I connect the ff_tx_data and ff_rx_data (of the triple speed ethernet core) to the 32 Bit Data-Line, there come errors: 

Found I/O cells that do not connect to top-level pins or have illegal connectivity
0 Kudos
Altera_Forum
Honored Contributor II
775 Views

The Wikipedia page is easier to read, and accurate AFAIK. 

If you don't use the Nios, you don't need to go through SOPC builder and can directly use the Megawizard to create your instance. 

I don't know what reference manual you are talking about, but the datasheet (http://www.altera.com/literature/ug/ug_ethernet.pdf) mentions 8 address lines. 

All the signals are unidirectionnal, you have separate read and write data vectors. The TSE core uses Avalon memory mapped and streams interfaces, and you can learn more about them here (http://www.altera.com/literature/manual/mnl_avalon_spec.pdf?gsa_pos=7&wt.oss_r=1&wt.oss=avalon).
0 Kudos
Altera_Forum
Honored Contributor II
775 Views

 

--- Quote Start ---  

All the signals are unidirectionnal, you have separate read and write data vectors. The TSE core uses Avalon memory mapped and streams interfaces, and you can learn more about them here. 

--- Quote End ---  

 

 

On the TSE core I have following data lines: 

 

inputs: 

writedata[31..0] (Avalon-MM Register Interface Signal) 

ff_tx_data[31..0] (Avalon-ST Transmit Interface Signal) 

 

outputs: 

ff_rx_data[31..0] (Avalon-ST Receive Interface Signal) 

readdata[31..0] (Avalon-MM Register Interface Signal) 

 

I think, the above mentioned data lines must not be connected to the external PHY Pins of the FPGA. Is that right? 

 

Instead, I should connect gm_rx/tx or rgmii_in/out or m_rx/tx to the PHY Pins. But in the dev kit datasheet (http://www.altera.com/literature/manual/mnl_nios2_board_cycloneii_2c35.pdf) (I am working with cyclone II Board, my cyclone III DSP is not yet delivered) the Data Lines have only numbers, not symbol names. So I don't know which of them to use: 

 

Pin D8 = Data Line fe_d0 

Pin C8 = Data Line fe_d1 

Pin F10 = Data Line fe_d2 

... 

Pin G11 = Data Line fe_d31
0 Kudos
Altera_Forum
Honored Contributor II
775 Views

You can't use the TSE with the Cyclone II board. On that dev kit the MAC is on the board.

0 Kudos
Altera_Forum
Honored Contributor II
775 Views

And to answer your last question, yes the gm_* / rgmii_* / m_* are the signals to connect to the PHY, depending on the interface with the PHY. On the Cyclone III board it is an RGMII interface.

0 Kudos
Altera_Forum
Honored Contributor II
775 Views

OK. I think I am making good progress. :)  

 

Now I created a VHDL core (FPGA) which is connected to the MAC. I am wondering how I can send my packet from the FPGA to the MAC. I would do it like this: 

(this is no valid VHDL syntax, it is only for showing the concept) 

 

address = 0x0 data = ... (first 4 byte of the packet) --> falling/rising edge of signal_write address = 0x1 data = ... (second 4 byte of the packet) --> falling/rising edge of signal_write ... --> transmit the created packet (how?) 

 

Is this a correct beginning?
0 Kudos
Altera_Forum
Honored Contributor II
775 Views

No it doesn't work that way. The Avalon memory mapped interface is only used to configure the registers in the mac. 

You will need to set up a few registers to enable and configure the Mac. For that you supply the address and data on address and write_data, put a '1' on the write signal, and wait for waitrequest to go back to '0'. Then you can write another value. 

To send a packet, you need to use the Avalon stream sink ff_tx. You don't have any address there, just send your words one after the others and use the rdy/wren for flow control. 

Those interfaces are described in the Avalon spec.
0 Kudos
Altera_Forum
Honored Contributor II
775 Views

 

--- Quote Start ---  

To send a packet, you need to use the Avalon stream sink ff_tx. You don't have any address there, just send your words one after the others and use the rdy/wren for flow control. 

--- Quote End ---  

 

 

Yes, but if I don't use the TSE core (because my Cyclone ii Board does not need it) then I must use the following pins: 

 

Address Enable, Synchronous Ready, VL Bus Access, Local Device, IO Char Ready, Address Strobe, Local Bus Clock, Ready/Return, Bus Cycle, Write/Read, Bus Chip Select, Interrupt, Byte Enable (0...4), Read, Write, Address Line (1...15) and Data Line (0...31). 

 

I have a manual about the mac/phy-chip (http://www.smsc.com/media/downloads_public/data_sheets/91c111.pdf) but I couldn't find the information I need. 

 

I tried to capture the packets with wireshark but I couldn't see them.
0 Kudos
Altera_Forum
Honored Contributor II
775 Views

I don't know this chip, but it doesn't look very easy to use without a CPU. You will have to configure a few registers before being able to use them, and allocate a buffer in the chip's memory to put your packet to transmit. There is a list of actions to perform on pages 85-87 of the datasheet.

0 Kudos
Altera_Forum
Honored Contributor II
775 Views

OK. Now I am using the Cyclone III DSP Dev. Kit with TSE core. I can only create a time limited SOF file. 

 

If I connect the Board to my PC via Ethernet cable, windows says that there is no network connection. Has that something to do with the time limited file or is something else wrong? 

 

With other boards windows showed at least that there is a connection...
0 Kudos
Altera_Forum
Honored Contributor II
775 Views

No, you should have a connection. One of the LEDs (10 / 100 / 1000) should also be on. If its sot the case, check the signals to the PHY, especially reset_n. Maybe you are forcing the PHY in reset state...

0 Kudos
Altera_Forum
Honored Contributor II
775 Views

 

--- Quote Start ---  

One of the LEDs (10 / 100 / 1000) should also be on. If its sot the case, check the signals to the PHY, especially reset_n. Maybe you are forcing the PHY in reset state... 

--- Quote End ---  

 

 

None of the LED is on. I checked the reset signal and thought I found the error: 

 

I connected port "reset" of TSE core to ENET_RESETn, so I added an inverter. But it didn't help. I can put the reset port to constant 1 or 0, it's no difference. 

 

I wonder where to connect management bus data , management bus data clock and 1000 mb link established on the TSE. 

 

When I program my time limited SOF file on the board, it says: 

 

remaining time: unlimited 

 

(which can not be because I do not have a license) 

 

I also did the timing constraints. To configure the registers (command_config) I sent the according signals to address and writedata and sent a positive edge to the write port of the TSE.
0 Kudos
Altera_Forum
Honored Contributor II
775 Views

On the Board (near the ethernet connector) there are two Pins and next to them is a label: ENET_HSDAC. 

 

One pin is P, the other is N. I wonder whether it's something like a jumper that I have to set in order to use the Ethernet. 

 

But maybe P means plus and M means minus, then I have a short circuit. 

 

In the data sheet these pins are not mentioned. 

 

But the PHY Chip has normal temperature (~35°C), so it seems that the PHY is working. All the LED (10,100,1000,duplex,tx,rx) are off. 

 

Do you think that the board could be damaged or something? I am working since two days on it and I still don't even get a physical connection...
0 Kudos
Altera_Forum
Honored Contributor II
775 Views

They are not connected on my board either. 

Did you try the nios ii 3c120 design example (http://www.nioswiki.com/exampledesigns/niosii3c120designexample) from Nios Wiki? That way you would know if there is a problem with the board.
0 Kudos
Altera_Forum
Honored Contributor II
775 Views

I started compiling it (./create-NO_MMU_DEV) and it took ~40 minutes. Does this occur at your PC too? 

 

I programmed the (time limited) SOF File to the Board. That works, on the two Displays I can read "Wind River Linux for NIOS II" and "ID: 0x2EA82CDC ...". To check the Ethernet, I used simple socket server plus (http://www.nioswiki.com/exampledesigns/simplesocketserverplus), which is also working now. 

 

My question for you is: In one of your previous posts you said that it is possible to use the NIOS as an Ethernet driver. Does that mean that I can use this Simple Socket Server Plus for NIOS in my FPGA-Design? The FPGA itself should also do some other work like reading from the ADC and writing and reading from/to the DDR2-SDRAM.
0 Kudos
Altera_Forum
Honored Contributor II
775 Views

Yes you can open the created project in Quartus and modify it to suit your needs. You can add/remove peripherals in SOPC builder and recompile it. (don't forget to edit the top level file too, of course) 

 

And yes, the compiling took a long time on my PC too. The system is quite complex, with a lot of peripherals.
0 Kudos
Altera_Forum
Honored Contributor II
765 Views

 

--- Quote Start ---  

And yes, the compiling took a long time on my PC too. The system is quite complex, with a lot of peripherals. 

--- Quote End ---  

 

 

At the NiosII3C120DesignExample project, I tried to remove some options at the menu Assignments > Settings and remove some components in the SOPC Builder but it did not help. What did you do to get it faster?
0 Kudos
Altera_Forum
Honored Contributor II
765 Views

I didn't ;) 

When you start to put a Nios processor and a TSE to a system, the compile time increases a lot.
0 Kudos
Reply