Commit 44dc14fe authored by Jan Pospisil's avatar Jan Pospisil

initial commit, first few files

parents
/hdl/ffpg/wb_gen/*.htm
/hdl/ffpg/wb_gen/*.h
FMC Fast Pulse Generator Item EDA-03339-V1-0 (v.0)
FPGA module requirements
==================================================
2016-06-24
A) Controllable blocks and connections on the card
--------------------------------------------------
1) Clock selection and configuration
3 Variants
1) external clock (front panel)
2) loop clk (from FPGA)
3) on-board clock generator
communications
SPI/QSPI/Microwire/DSP <- FMC ("SPI_VCXO", AD5660)
1bit <- FMC ("CLK2_SEL", SY58017U)
1bit <- FMC ("AD9152_FUNC", AD9512)
SPI/SSR <-> FMC ("SPI_AD9512", AD9512)
2) channels configuration (2 times, MC100EP195B)
2bits <- FMC (LE_SET, LE_RES)
10bits <- FMC (shared)
1bit <- FMC (OUT_EN)
1bit -> FMC (CAL_OUT)
3) channels controlling (2 times)
2diff <- FMC (IN_SET, IN_RES)
4) Trigger threshold (AD5660)
SPI/QSPI/Microwire/DSP <- FMC ("SPI_DAC")
6) Thermometer (DS18B20)
1wire <-> FMC ("onewire")
7) LEDs
4bits <- FMC
X) Serial EEPROM (24AA64T)
I2C + address <-> FMC
(Handled by FMC carrier board)
B) Controlling module logic
---------------------------
(I.e. how it will be controlled via Wishbone interface (WB).)
0) Wishbone interface will be realized as WB slave with 32 bits of data and 32 bits of address.
1) The clock infrastructure needs to be configured by constant predefined values. This will be done
automatically upon power-up. Necessary part of this configuration will be also done each time
clock infrastructure parameters (clock selection or clock divider) will be changed.
1.1) What and how will be configured:
Clock selection: external clock
AD9512 settings:
0x00: 0x00 (TODO)
0x34: 0x00 (TODO)
0x35: 0x00 (TODO)
0x36: 0x00 (TODO)
0x3D: 0x00 (TODO)
0x3E: 0x00 (TODO)
0x3F: 0x00 (TODO)
0x40: 0x00 (TODO)
0x41: 0x00 (TODO)
0x45: 0x00 (TODO)
0x4A: 0x00 (TODO)
0x4B: 0x00 (TODO)
0x4C: 0x00 (TODO)
0x4D: 0x00 (TODO)
0x4E: 0x00 (TODO)
0x4F: 0x00 (TODO)
0x50: 0x00 (TODO)
0x51: 0x00 (TODO)
0x52: 0x00 (TODO)
0x53: 0x00 (TODO)
0x58: 0x00 (TODO)
0x5A: 0x00 (TODO)
2) The runtime configuration of individual components will be done via WB registers. E.g. the
threshold DAC will be assigned with one WB register and its configuration will be started by
writing to this register. Next configuration will be issued only after the previous end. The
status of ongoing configurations will be accessible via a dedicated status WB register.
2.1) Components configured this way:
VCXO DAC AD5660 (1 register - voltage)
Clock selection (in control register - enum: external/loop/on-board)
Clock divider (1 register - divider)
Channel configuration
Delay configuration (4 registers - delay for both channels, both rising/falling)
Output enable configuration (in control register - 2 bits map)
Trigger DAC AD5660 (1 register - voltage)
3) The pulse generation will be controlled by four serial streams from FPGA to four (two for each
channel) NB4L52 D flip-flops. These streams will be synchronous to the clock FMC_CLKIN0.
3.1) Definition of streams: Streams will be programmed in run time and stored in the controlling
module in a dual port RAM. One port will be used for writing the content via WB and a second
port will be used for reading the content and sending it out of FPGA in the form of the serial
stream. The size of each memory (4 memories together) will be 64 kbits, i.e. 8 kB.
3.1.1) WB interface: directly mapped memory interface (i.e. part of the WB address space
will be directly connected to each memory).
3.2) Modes of operation: There will be three modes of operation - a stop mode, a continuous mode
and an one-shot mode. In the *stop mode* no serial stream will be sent, no pulses will be
generated. In the *continuous mode*, streams will be outputted continually looping through
the memory. When the trigger signal will be received or memory overflow will happen (i.e.
progressing to the address of "overflow value"), a memory pointer will be reset to the
beginning of the memory. In the *one-shot mode*, the memory will be looped (up to "overflow
value") only once upon the trigger signal will be received. Then output serial streams will be
stopped, but mode selection will remain on one-shot.
3.2.1) WB interface:
Overflow value (1 register common to both channels - value)
Mode selection (in control register - 2x enum: stop/continuous/one-shot)
4) The temperature sensor will be connected as a separate slave inside FPGA module.
5) The status register will be one common register for the FPGA module. It will be accessible via
WB for read only. It will contain 9 bits map with the status of following components. An unset
bit (i.e. log.0) means there is no work carried by the component at that time, thus the component
is ready for an operation and it is accepting commands. A set bit (i.e. log.1) means that the
component is actually busy and doesn't accept any command. Exceptions are bits 4, 5, 7 and 8, which
(if set to log.1) doesn't prevent from issuing new commands.
0 - Clock infrastructure configuration
1 - VCXO DAC AD5660
2 - Clock selection
3 - Delay configuration
4 - CH1 output enable
5 - CH2 output enable
6 - Trigger DAC AD5660
7 - Generator running on CH1
8 - Generator running on CH2
8) The control register will hold all spare-bits configuration:
Clock selection (enum: external/loop/on-board)
Output enable configuration (2 bits map)
Mode selection (in control register - 2x enum: stop/continuous/one-shot)
7) LEDs will reflect inner status of the FPGA module as:
OUT1 LED will blink when there will be any activity on CH1 output
OUT2 LED will blink when there will be any activity on CH2 output
TRIG IN LED will blink when there will be any activity on trigger input
CLK IN LED will be on when there will be any activity on CLK input
8) Frequency of the clock to which serial streams will be synchronous can be retrieved by reading
one WB register.
9) Others: FMC outputs CAL_OUT coming from channels will not be used. The loop clock from FPGA
coming to FMC card will carry WB clock used by the FPGA module.
\ No newline at end of file
peripheral {
name = "FMC DEL 1ns 2cha core registers";
description = "Wishbone slave for FMC DEL 1ns 2cha core";
hdl_entity = "ffpg_csr";
prefix = "ffpg";
reg {
name = "Status register";
prefix = "status";
field {
name = "Clock infrastructure configuration in progress";
description = "Status of the clock infrastructure configuration\n0: configuration done\n1: configuration in progress";
prefix = "clock_infrastructure_busy";
type = BIT;
access_bus = READ_ONLY;
access_dev = WRITE_ONLY;
};
field {
name = "VCXO DAC busy";
description = "Status of the VCXO DAC communication\n0: DAC idle, value already set\n1: DAC busy, communication in progress";
prefix = "dac_vcxo_busy";
type = BIT;
access_bus = READ_ONLY;
access_dev = WRITE_ONLY;
};
field {
name = "Trigger DAC busy";
description = "Status of the trigger DAC communication\n0: DAC idle, value already set\n1: DAC busy, communication in progress";
prefix = "dac_trigger_busy";
type = BIT;
access_bus = READ_ONLY;
access_dev = WRITE_ONLY;
};
field {
name = "Clock source selection in progress";
description = "Status of the clock source selection configuration\n0: configuration done\n1: configuration in progress";
prefix = "clock_selection_busy";
type = BIT;
access_bus = READ_ONLY;
access_dev = WRITE_ONLY;
};
field {
name = "Delay configuration in progress";
description = "Status of the delay configuration\n0: configuration done\n1: configuration in progress";
prefix = "delay_configuration_busy";
type = BIT;
access_bus = READ_ONLY;
access_dev = WRITE_ONLY;
};
field {
name = "Channel 1 output enabled";
description = "Channel 1 output enabled\n0: output disabled\n1: output enabled";
prefix = "channel_1_oe";
type = BIT;
access_bus = READ_ONLY;
access_dev = WRITE_ONLY;
};
field {
name = "Channel 2 output enabled";
description = "Channel 2 output enabled\n0: output disabled\n1: output enabled";
prefix = "channel_2_oe";
type = BIT;
access_bus = READ_ONLY;
access_dev = WRITE_ONLY;
};
field {
name = "Pulse generator channel 1 running";
description = "Pulse generator channel 1 running\n0: channel 1 is not running\n1: channel 1 is running, pulses are generated";
prefix = "channel_1_running";
type = BIT;
access_bus = READ_ONLY;
access_dev = WRITE_ONLY;
};
field {
name = "Pulse generator channel 2 running";
description = "Pulse generator channel 2 running\n0: channel 2 is not running\n1: channel 2 is running, pulses are generated";
prefix = "channel_2_running";
type = BIT;
access_bus = READ_ONLY;
access_dev = WRITE_ONLY;
};
};
reg {
name = "Control register";
prefix = "control";
field {
name = "Clock source selection";
description = "0 (default): external clock used (connector on the front panel)\n1: FPGA loop clock used\n2: onboard clock used";
prefix = "clock_selection";
type = SLV;
size = 2;
load = LOAD_EXT;
access_bus = READ_WRITE;
access_dev = READ_WRITE;
};
field {
name = "CH1 output enable";
prefix = "ch1_oe";
type = BIT;
access_bus = READ_WRITE;
access_dev = READ_ONLY;
};
field {
name = "CH2 output enable";
prefix = "ch2_oe";
type = BIT;
access_bus = READ_WRITE;
access_dev = READ_ONLY;
};
field {
name = "CH1 mode selection";
description = "0 (default): stopped (no output generated)\n1: continuous (non-stop memory looping)\n2: one-shot (loop memory just once)";
prefix = "ch1_mode";
type = SLV;
size = 2;
load = LOAD_EXT;
access_bus = READ_WRITE;
access_dev = READ_WRITE;
};
field {
name = "CH2 mode selection";
description = "0 (default): stopped (no output generated)\n1: continuous (non-stop memory looping)\n2: one-shot (loop memory just once)";
prefix = "ch2_mode";
type = SLV;
size = 2;
load = LOAD_EXT;
access_bus = READ_WRITE;
access_dev = READ_WRITE;
};
};
reg {
name = "VCXO voltage register";
prefix = "vcxo_register";
description = "This register value D determines output voltage of the VCXO DAC.\nVoltage should be V_OUT = D * 5 / 65536 [V] (see datasheet), but is limited by 3.3 V supply voltage of the DAC.";
field {
name = "VCXO voltage register value";
type = SLV;
size = 16;
load = LOAD_EXT;
access_bus = READ_WRITE;
access_dev = READ_WRITE;
};
};
reg {
name = "Clock divider";
prefix = "clock_divider";
description = "LOw and HIgh values of the AD9512 clock divider - these values are used for all clocks generated on the FMC card. Write both values at one WB transaction, or write LO first and HI last. Clock configuration of both values begins when HI value is written.";
field {
name = "Clock divider LO value";
description = "Number of clock cycles output stays low.";
prefix = "lo";
type = SLV;
size = 4;
access_bus = READ_WRITE;
access_dev = READ_ONLY;
};
field {
name = "Clock divider HI value";
description = "Number of clock cycles output stays high.";
prefix = "hi";
type = SLV;
size = 4;
load = LOAD_EXT;
access_bus = READ_WRITE;
access_dev = READ_WRITE;
};
};
reg {
name = "CH1 delay configuration";
prefix = "ch1_delay";
description = "10 bit fine delays for pulse generation.";
field {
name = "CH1 SET delay";
description = "Delay of the SET pulse, i.e. pulse delay.";
prefix = "set";
type = SLV;
size = 10;
load = LOAD_EXT;
access_bus = READ_WRITE;
access_dev = READ_WRITE;
};
field {
name = "CH1 RES delay";
description = "Delay of the RES pulse, i.e. pulse width.";
prefix = "reset";
type = SLV;
size = 10;
load = LOAD_EXT;
access_bus = READ_WRITE;
access_dev = READ_WRITE;
};
};
reg {
name = "CH2 delay configuration";
prefix = "ch2_delay";
description = "10 bit fine delays for pulse generation.";
field {
name = "CH2 SET delay";
description = "Delay of the SET pulse, i.e. pulse delay.";
prefix = "set";
type = SLV;
size = 10;
load = LOAD_EXT;
access_bus = READ_WRITE;
access_dev = READ_WRITE;
};
field {
name = "CH2 RES delay";
description = "Delay of the RES pulse, i.e. pulse width.";
prefix = "reset";
type = SLV;
size = 10;
load = LOAD_EXT;
access_bus = READ_WRITE;
access_dev = READ_WRITE;
};
};
reg {
name = "Trigger threshold voltage register";
prefix = "trigger_register";
description = "This register value D determines output voltage of the trigger threshold DAC.\nVoltage should be V_OUT = D * 5 / 65536 [V] (see datasheet).";
field {
name = "Trigger threshold voltage register value";
type = SLV;
size = 16;
load = LOAD_EXT;
access_bus = READ_WRITE;
access_dev = READ_WRITE;
};
};
reg {
name = "Overflow";
prefix = "overflow";
description = "Overflow index for serial stream memory. When this index is reach when looping the memory, memory index is reset back to 0.";
field {
name = "Overflow value";
type = SLV;
size = 16;
load = LOAD_EXT;
access_bus = READ_WRITE;
access_dev = READ_WRITE;
};
};
reg {
name = "Clock frequency";
prefix = "frequency";
description = "Frequency of the input clock in kHz.";
field {
name = "Clock frequency value";
type = SLV;
size = 16;
access_bus = READ_ONLY;
access_dev = WRITE_ONLY;
};
};
ram {
name = "CH1 SET serial stream";
prefix = "ch1_set_mem";
width = 32;
size = 2048;
clock = "serial_stream_clk_ik";
access_bus = READ_WRITE;
access_dev = READ_ONLY;
};
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment