Main Level#

Trigger Logic Unit#

class aidatlu.main.tlu.AidaTLU(hw, config_path, clock_config_path)[source]#
configure() None[source]#

loads the conf.yaml and configures the TLU accordingly.

default_configuration() None[source]#

Default configuration. Configures DUT 1 to run in EUDET mode. This is just for testing and bugfixing.

get_device_id() int[source]#

Read back board id. Consists of six blocks of hex data

Returns:

Board id as 48 bits integer

Return type:

int

get_event_fifo_csr() int[source]#

Reads value from ‘EventFifoCSR’

Returns:

number of events

Return type:

int

get_event_fifo_fill_level() int[source]#

Reads value from ‘EventFifoFillLevel’

Returns:

buffer level of the fifi

Return type:

int

get_run_active() bool[source]#

Reads register ‘RunActiveRW’

Returns:

Returns bool of the run active register.

Return type:

bool

get_timestamp() int[source]#

Get current time stamp.

Returns:

Time stamp is not formatted.

Return type:

int

init_raw_data_table() None[source]#

Initializes the raw data table, where the raw FIFO data is found.

log_sent_status(time: int) None[source]#
Logs the status of the TLU run with trigger number, runtime usw.

Also calculates the mean trigger frequency between function calls.

Parameters:

time (int) – current runtime of the TLU

log_trigger_inputs(event_vector: list) None[source]#

Logs which inputs triggered the event corresponding to the event vector.

Parameters:

event_vector (list) – 6 data long event vector from the FIFO.

pull_fifo_event() list[source]#
Pulls event from the FIFO. This is needed in the run loop to prevent the buffer to get stuck.

if this register is full the fifo needs to be reset or new triggers are generated but not sent out. #TODO check here if the FIFO is full and reset it if needed would prob. make sense.

Returns:

6 element long vector containing bitwords of the data.

Return type:

list

reset_configuration() None[source]#

Switch off all outputs, reset all counters and set threshold to 1.2V

reset_counters() None[source]#

Resets the trigger counters.

reset_fifo() None[source]#

Sets 0 to ‘EventFifoCSR’ this resets the FIFO.

reset_status() None[source]#

Resets the complete status and all counters.

reset_timestamp() None[source]#

Resets the internal timestamp by asserting a bit in ‘ResetTimestampW’.

run() None[source]#

Start run of the TLU.

set_enable_record_data(value: int) None[source]#

#TODO not sure what this does. Looks like a separate internal event buffer to the FIFO.

Parameters:

value (int) – #TODO I think this does not work

set_event_fifo_csr(value: int) None[source]#

Sets value to the EventFifoCSR register.

Parameters:

value (int) – 0 resets the FIFO. #TODO can do other stuff that is not implemented

set_run_active(state: bool) None[source]#

Raises internal run active signal.

Parameters:

state (bool) – True sets run active, False disables it.

start_run() None[source]#

Start run configurations

stop_run() None[source]#

Stop run configurations

test_configuration() None[source]#

Configure DUT 1 to run in a default test configuration. Runs in EUDET mode with internal generated triggers. This is just for testing and bugfixing.

write_status(value: int) None[source]#

Sets value to the ‘SerdesRstW’ register.

Parameters:

value (int) – Bit 0 resets the status, bit 1 resets trigger counters and bit 2 calibrates IDELAY.

Configuration Parser#

class aidatlu.main.config_parser.TLUConfigure(TLU, io_control, config_path)[source]#
conf_dut() None[source]#

Parse the configuration for the DUT interface to the AIDATLU.

conf_trigger_inputs() None[source]#

Configures the trigger inputs. Each input can have a different threshold. The two trigger words mask_low and mask_high are generated with the use of two support functions.

conf_trigger_logic() None[source]#

Configures the trigger logic. So the trigger polarity and the trigger pulse length and stretch.

configure() None[source]#

Loads configuration file and configures the TLU accordingly.

get_configuration_table() list[source]#

Creates the configuration list to save in the data files

Returns:

configuration list

Return type:

list

get_data_handling() tuple[source]#

Information about data handling.

Returns:

two bools, save and interpret data.

Return type:

tuple

get_output_data_path() str[source]#

Parses the output data path

Returns:

output path

Return type:

str

get_stop_condition() tuple[source]#

Information about tlu stop condition.

Returns:

maximum trigger number and timeout in seconds.

Return type:

tuple

get_zmq_connection() str[source]#

Information about the zmq Address

Returns:

ZMQ Address

Return type:

str

Data Parser#