sinara-hw / FMC_Shuttler

16-channel 125MS/s 16bit DAC in FMC form factor.
16 stars 4 forks source link

[RFC] Shuttler GW/SW requirements specification #11

Open AAWO opened 4 years ago

AAWO commented 4 years ago

I've read through the issues regarding Shuttler and came up with requirements specification list. The final Shuttler's specification will also be a foundation for future ASIC (multi-channel DAC compatible with Sinara/ARTIQ) specification.

I imagine the operation such that Master sends all experiment's data branches (DAC output value + timestamp + DAC ID + some branch ID) to Shuttler which stores it in the SDRAM - the amount of data sent by Master is constrained by the SDRAM. Then Master can send just current branch ID to Satellite. Shuttler writes current data branch from SDRAM to required DACs' sequencers FIFOs. If the branch is changed before all data from FIFO is read, then FIFO is cleared and new data is written to it.
The timer can be started after Master's request. The timer's initial value should be dependent on the latency between Master and Shuttler's output as well as the delay between sending the 'start timer' request to next Shuttlers (which should be possible to determine by Master). This way all Shuttlers' timers should be aligned.

Part of the GW (namely: DAC handling) is going to be designed in Verilog, because later on it may be used as a test field for ASIC development.

dhslichter commented 4 years ago

FWIW, although I have been occupied with other things these past couple of months, my current plan is to try to make a Shuttler design that is EEM/Kasli compatible, similar to how Phaser has been developed. If others are interested in pursuing the specificiations above, perhaps we should branch or rename the EEM version to something else?

gkasprow commented 4 years ago

Several questions arrive:

dhslichter commented 4 years ago

Going for EEM would mean reduced channel count; I am also looking at ways to reduce power consumption by choosing different DACs and amps. We were doing some DAC testing in the lab before the quarantine but that has been stopped, unfortunately.

If the CPCIS form factor works, that's great, but I am hesitant to be the guinea pig here. My preference would be to develop a board as an EEM, which would allow us to get up and running, and ease the debugging process (as with Fastino and Phaser). Down the road, if the design is proven out and there are advantages to using a single card as a DRTIO satellite, rather than running over EEM from Kasli, one could port a lot of the design over.

Total channel count desired would be something like ~100 for a given setup, possibly a bit more. I think the primary limitation will be power dissipation in the rack, and thermal management. I don't think we need 24 channels per card, 12-16 would probably be just fine.

gkasprow commented 4 years ago

@dhslichter For the development of the Shuttler HW & GW we received already the research grant. It is clearly stated that it should support MTCA so we must somehow cope with it. What if we make it in FMC form-factor? Then we could use it with low cost AFC carrier and also with CPCIS FMC carrier. AFC/AFCK is well-tested solution (a few hundreds in operation), and now we are working on 4-th revision together with a few research institutions (CERN, LNLS, GSI, WUT). The CERN CPCIS carrier uses very low cost (special Xilinx discount) Kintex US FPGA, already supported by ARTIQ. With such an approach we could further fund the Shuttler development, meeting both funding agency goals as well as your requirements. We are working intensively with CERN on CPCIS, have suitable funding so soon the entire EEM ecosystem will be migrated to this ecosystem keeping full compatibility with existing EEM modules. I already proved that 16-channel * (ADC + CFD + TDC) together with SAS connector is feasible on single FMC HPC. I think 12-16 DAC channels per FMC can be done easily. I did a simple trick - the power section is placed on tiny mezzanine plugged to the FMC board and secured with 2 screws. Both boards are produced simultaneously with no additional cost. With such approach, we will lower the cost significantly due to the economy of scale of AFC. The design and verification of such DAC would also be much lower risk and cost. What we can do is to design two FMCs - one with LTC2000 and another with lower-grade DAC and see what approach is feasible in a real application. In the past I already did 16-channel 14-bit FMC DAC and even managed to fit 4 ADC channels and some IOs.

kaolpr commented 4 years ago

@dhslichter, @gkasprow - very interesting conversation. Interesting enough that it should have its own issue ;-). Please continue at #12 and let's leave this issue for comments on GW/SW specification as it seems to be at least partially independent.

AAWO commented 4 years ago

FWIW, although I have been occupied with other things these past couple of months, my current plan is to try to make a Shuttler design that is EEM/Kasli compatible, similar to how Phaser has been developed. If others are interested in pursuing the specificiations above, perhaps we should branch or rename the EEM version to something else?

OK, the form of the module, as well as the interface to ARTIQ is still to be discussed. Nevertheless, what about the rest of the proposed specification? Does it fit your use case?

kaolpr commented 4 years ago

@hartytp @dhslichter Do you have any thoughts on HDL / SW side of Shuttler? We'd like to specify it and start work.

hartytp commented 4 years ago

I'm not involved enough in this project to have a useful opinion I'm afraid!

dhslichter commented 4 years ago

Replying to top post:

18 DACs (LTC2000) - PHY: 16 bit parallel output + clock each

Use AD9117 instead, 14 bit parallel LVCMOS bus with interleaved data (DDR)

DRTIO Satellite interface

My current vision would be to have data streamed to a Shuttler from a Kasli, in the way that Phaser is done, so Shuttler itself would not need DRTIO.

DAC data rate = RTIO frequency -> single clock domain for DACs around 150MHz?

Yes, 125 MHz (max clock for DAC, good general value for RTIO clock too)

data from DRTIO (all branches up to memory limit) is passed to SDRAM memory

Again, I aim envisioning that reduced-representation data are streamed from Kasli to Shuttler. The FPGA on Shuttler would be in charge of turning the reduced representation into samples at the full data rate. For higher resolution, this MAY include performing sigma-delta modulation to increase the output resolution at ~DC. Otherwise, would be simpler.

current waveform branch data is passed from SDRAM to proper DAC's sequencer FIFO - is such functionality already implemented in ARTIQ?

Again, I envision this happening on Kasli.

32-bit (16-bit?) timer counting until end point (received from DRTIO)

Use the same architecture as for waveforms on Fastino or Phaser.

each DAC's output waveform sample is updated when next sample's timestamp value is equal to current timer value

a calibration procedure is needed to determine the latency between Master and Satellite's DAC output

Yes, TBA

the raw data received from DRTIO is later on sent to DACs directly, or some DDS/interpolation is required?

See above, FPGA on board hosting Shuttler (via FMC, or directly) will need to do calculations to turn reduced representation of waveform into samples at full data rate.

a single data packet received from DRTIO is (at proper time point) sent to DAC and dropped from memory/FIFO I imagine the operation such that Master sends all experiment's data branches (DAC output value + timestamp + DAC ID + some branch ID) to Shuttler which stores it in the SDRAM - the amount of data sent by Master is constrained by the SDRAM. Then Master can send just current branch ID to Satellite.

Let's do this in the same way that Fastino, Phaser, etc do it.

Shuttler writes current data branch from SDRAM to required DACs' sequencers FIFOs. If the branch is changed before all data from FIFO is read, then FIFO is cleared and new data is written to it. The timer can be started after Master's request. The timer's initial value should be dependent on the latency between Master and Shuttler's output as well as the delay between sending the 'start timer' request to next Shuttlers (which should be possible to determine by Master). This way all Shuttlers' timers should be aligned.

Again, see above, do the same way as Fastino and Phaser.

kaolpr commented 4 years ago

Camming back to GW specification:

My current vision would be to have data streamed to a Shuttler from a Kasli, in the way that Phaser is done, so Shuttler itself would not need DRTIO.

Shuttler will be mounted on some FMC carrier (maybe AFCv4 or CPCIe carrier like this one). Such carrier can run in standalone mode or be a satellite to Kasli.

Use the same architecture as for waveforms on Fastino or Phaser.

Up to my understanding, Fastino works in a different way than Phaser. If I'm to wrong, current GW for Fastino allows setting output levels at specified timestamps whereas Phaser is AWG. @dhslichter What architecture for waveforms do you have in mind?

dhslichter commented 4 years ago

I think the goal would be to be more like Phaser. We're looking to have parameterized waveforms, with some combinations of sine waves and splines and products of these -- the specification needs to be determined still. However, the waveforms would for sure be in some reduced representation that is not just (time, voltage) pairs.

kaolpr commented 4 years ago

@dhslichter - how do you find the process of determining these specifications? Do you have any timeline for that? Do you think you can specifiy that?

dhslichter commented 4 years ago

This is something that we want to contract with M-Labs to have them design for use with ARTIQ. Are you wanting to design your own independent gateware to have it emit pulses, or are you planning to work with M-Labs on a solution for ARTIQ? An official contract for this will take at least two months, maybe more. However, if you are just doing your own independent thing to be able to demonstrate the functionality for grant purposes, we can just discuss a draft specification here on a short timescale.

kaolpr commented 4 years ago

Is this contract going to give a rise to something more generic? I mean to be used throughout different boards, e.g. Sayma, Phaser, Shuttler, maybe Fastino? A generic waveform forming API for ARTIQ?

gkasprow commented 4 years ago

The initial idea was to have just AWG functionality that is sufficient to run the production tests. If we can do easily something more sexy that makes the end-used happy, we can do that.

dhslichter commented 4 years ago

A generic waveform forming API for ARTIQ?

There already exist several different versions of this for e.g. Sayma and Phaser, and @jordens has proposed yet a separate parameterization in https://github.com/quartiq/phaser/issues/2 as well. My general feeling is that the specific applications for ARTIQ are sufficiently varied that probably there isn't a one-size-fits-all method for generating all possible types of waveforms one wants. Different use cases call for different parameterizations.

The initial idea was to have just AWG functionality that is sufficient to run the production tests.

To be concrete, having waveforms defined as A+B*sin(C*t)+D*cos(C*t), where A,B,C,D are all time-dependent functions decomposed into cubic splines, with arbitrary/adjustable time delays between spline knots, is a fine place to start for demonstrating functionality. This is only one way in which one could parameterize outputs, and is probably NOT how things will end up in a written contract.

One feature of Shuttler that would be nice to implement, if you are looking for more of a challenge, is delta-sigma modulation of the output to increase the effective bit depth at DC to 16+ bits. This could be an interesting gateware project if you are looking for something a little bit fancier to implement. We did some test experiments at NIST with dithering to increase the low-frequency resolution and this should work.

dhslichter commented 3 years ago

@gkasprow @AAWO my concrete suggestion for how to do the AWG in the gateware is as follows:

gkasprow commented 3 years ago

@kaolpr

dhslichter commented 3 years ago

@kaolpr @gkasprow what is the status on this? is there a gateware repo that exists somewhere?

kaolpr commented 3 years ago

Generally we had some problems with DAC devkit we were working with. I'll looking into this in this month and hope to publish initial version of the gateware at the beginning of August.

dhslichter commented 3 years ago

problems with devkit? anything concerning?

gkasprow commented 3 years ago

Devkit works with ADI software but for some reason doesn't work with ARTIQ. It looks like a DAC initialization problem.

dhslichter commented 3 years ago

meaning that the SPI communications are broken?

kaolpr commented 3 years ago

I was not actively taking part in the development up till now. I only know he couldn't get it working and I'll be looking into it as soon as I'm back from vacation (on 20th July).

This devkit exposes USB interface for programming DAC and clock tree configuration. From what I have seen so far, provided software is a bit confusing and I hope this is the source of the problem.