Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

What is the fastest way of accessing on-chip register contents?

Hi all,

I am in the phase of hardware verification of my design, that is developed based on 10 Gb/s Ethernet subsystem. One of the requirements for my application is to collect the performance statistics and export those to another machine, and this should be done in runtime. Currently, I am using the System Console with JTAG to Avalon Master bridge for configuring the input parameters as well as monitoring the result statistics.

However, using Avalon-MM commands, such as master_read_32(8,16), master_write takes longer time than the update frequency of the statistics. For example, I use the command "time {master_read_32 BASE_ADDR register_add}" in TCL script to check the time needed for one read operation, and that is around 360 milliseconds. Therefore, I am looking for a solution that enables to read the content of statistics registers in a faster way. Please help share your knowledge and experience about this. If you need any information, please kindly ask.

Thank you very much.

PLMT.

15 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The data you send across the link is not synchronous to the 10Gbps clock, so you must decouple it somehow right? One way of decoupling the data would be to packetize it. Each packet of data samples can be preceded by a header that contains; a timestamp (or packet ID code or incrementing count), a data rate (the thing you are trying to figure out now), and the number of samples to follow in the data payload. 
    For example, lets say I have an Avalon-ST stream generating 16-bit samples at 100MHz clock rate, i.e., 200MB/s. I could capture a block of this data (using a FIFO or dual-port memory), prepend the header, send it over the link, and then generate a 16-bit 100MHz clock rate data stream on the other side of the link. So long as the Avalon-ST valid signal is used to indicate when samples are valid, the DSP logic on either side of the link should work correctly.

    This is clear for me now, thanks Dave.

    Regarding the communication between a host PC and modules of a design, beside using the Ethernet interface, if I use the bytestream service to send/receive byte-streams via the data mode of the JTAG-to-Avalon-ST bridge from/to an application running on the host PC, what is the maximum rate this service can provide?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    http://www.alterawiki.com/wiki/nios_ii_udp_offload_example

    You can use it (and it's components) to get your bearings.

    Basically, what you want to do is to create a new Qsys component with an Avalon-MM Master port and a state machine to execute the (various) reads to gather and/or compute the statistics you want to communicate to the host.

    Then, take that data and encode it into the payload of a UDP packet.

    --- Quote End ---

    This is really what I am looking for to prepare for my next step. Thank you very much. If possible, when I start working on this, I would ask you for some further support.

    --- Quote Start ---

    On the PC, you just need to write a simple socket utility to receive the UDP packets.

    --- Quote End ---

    How did you do this, I heard about this, it is simple but actually really new for me. If you can provide more details or references about this socket utility?

    --- Quote Start ---

    Which route to go basically depends on whether you are a software person or a hardware/HDL person, and whether or not your hardware can support you.

    --- Quote End ---

    To be honest, I don't know if I am a software or hardware guy now. But I would say that I have some experience with Verilog, Altera tools like Qsys, System Console, TCL scripting, Signal Tap, Transceiver Toolkit and hardware verification.

    Again, thank you very much
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Regarding the communication between a host PC and modules of a design, beside using the Ethernet interface, if I use the bytestream service to send/receive byte-streams via the data mode of the JTAG-to-Avalon-ST bridge from/to an application running on the host PC, what is the maximum rate this service can provide?

    --- Quote End ---

    The details are in the document I wrote and linked to.

    The transport rate is limited by the 6MHz JTAG clock used on the USB-Blaster interface. When operating in byte-mode, it takes the equivalent of 10 6MHz clocks per byte

    (there's 8 actual clocks and then a gap of a couple of clocks before the next byte), so about 600kB/s transfer rate. This is the data rate of master_read/write_memory for blocks of data, and its the data rate of the Avalon-ST interface - which the JTAG-to-Avalon-MM bridge is implemented using.

    There's really no advantage in using the JTAG-to-Avalon-ST interface directly. The JTAG interface should only really be used for slow control/monitoring. For your application, you should be using the 10Gbps link to move your data and meta-data.

    Cheers,

    Dave
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    The details are in the document I wrote and linked to.

    There's really no advantage in using the JTAG-to-Avalon-ST interface directly. The JTAG interface should only really be used for slow control/monitoring. For your application, you should be using the 10Gbps link to move your data and meta-data.

    --- Quote End ---

    Thank you very much Dave. Your explanation really answers most of my wondering these days and gives me a clear direct for the next step to go.

    Best,
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Thank you very much Dave.

    --- Quote End ---

    You're welcome.

    --- Quote Start ---

    Your explanation really answers most of my wondering these days and gives me a clear direct for the next step to go.

    --- Quote End ---

    Its always best to start with a good plan! :)

    Cheers,

    Dave