data_specification.spi package

Module contents

The interface used by implementations of the executor.

class data_specification.spi.AbstractExecutorFunctions[source]

Bases: object

This class defines a function related to each of the commands of the data specification file. Subclasses need to provide implementations that work for the operations they wish to support.

execute_align_wr_ptr(cmd)[source]

This command moves the write pointer to be at the start of the next word if it isn’t already at the start of a word.

Implements ALIGN_WR_PTR

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_arith_op(cmd)[source]

This command performs an arithmetic operation.

Implements ARITH_OP

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_block_copy(cmd)[source]

This command copies a block of memory from one location to another.

Implements BLOCK_COPY

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_break(cmd)[source]

This command raises an exception to stop the execution of the data spec executor (DSE).

Implements BREAK

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_break_loop(cmd)[source]

This command stops a loop early.

Implements BREAK_LOOP

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_construct(cmd)[source]

This command calls a function.

Implements CONSTRUCT

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_copy_param(cmd)[source]

This command copies a field of a structure to another field of a possibly-different structure.

Implements COPY_PARAM

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_copy_struct(cmd)[source]

This command copies a structure from one slot to another.

Implements COPY_STRUCT

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_declare_rng(cmd)[source]

This command declares a random number generator.

Implements DECLARE_RNG

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_else(cmd)[source]

This command handles the other branch of a conditional.

Implements ELSE

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_end_constructor(cmd)[source]

This command ends the definition of a function.

Implements END_CONSTRUCTOR

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_end_if(cmd)[source]

This command ends a conditional.

Implements END_IF

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_end_loop(cmd)[source]

This command finishes a loop.

Implements END_LOOP

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_end_spec(cmd)[source]

This command marks the end of the specification program.

Implements END_SPEC

Parameters:

cmd (int) – the command which triggered the function call

Returns:

A special marker to signal the end.

Raises:
execute_end_struct(cmd)[source]

This command completes the definition of a structure.

Implements END_STRUCT

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_free(cmd)[source]

This command frees some memory.

Implements FREE

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_get_random_rumber(cmd)[source]

This command obtains a random number from a distribution.

Implements GET_RANDOM_NUMBER

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_get_wr_ptr(cmd)[source]

This command gets the current write pointer.

Implements GET_WR_PTR

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_if(cmd)[source]

This command does a conditional branch.

Implements IF

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_logic_op(cmd)[source]

This command performs a logical operation.

Implements LOGIC_OP

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_loop(cmd)[source]

This command starts a loop.

Implements LOOP

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_mv(cmd)[source]

This command moves an immediate value to a register or copies the value of a register to another register.

Implements MV

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_nop(cmd)[source]

This command executes no operation.

Implements NOP

Parameters:cmd (int) – the command which triggered the function call
Raises:DataSpecificationSyntaxError – If there is an error in the command syntax
execute_print_struct(cmd)[source]

This command prints a structure to the log.

Implements PRINT_STRUCT

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_print_txt(cmd)[source]

This command prints a short string to the log.

Implements PRINT_TXT

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_print_val(cmd)[source]

This command prints a value to the log.

Implements PRINT_VAL

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_random_dist(cmd)[source]

This command defines a random distribution.

Implements DECLARE_RANDOM_DIST

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_read(cmd)[source]

This command reads a word from memory.

Implements READ

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_read_param(cmd)[source]

This command extracts an element from a structure.

Implements READ_PARAM

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_reference(cmd)[source]

This command reserves a region and sets it to reference another.

Implements REFERENCE

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_reformat(cmd)[source]

This command is never generated!

Implements REFORMAT

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_reserve(cmd)[source]

This command reserves a region and assigns some memory space to it.

Implements RESERVE

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_reset_wr_ptr(cmd)[source]

This command resets the current write pointer to the beginning of the memory region.

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_set_wr_ptr(cmd)[source]

This command sets the current write pointer.

Implements SET_WR_PTR

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_start_constructor(cmd)[source]

This command starts the definition of a function.

Implements START_CONSTRUCTOR

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_start_struct(cmd)[source]

This command starts to define a structure.

Implements START_STRUCT

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_struct_elem(cmd)[source]

This command adds an element to a structure.

Implements STRUCT_ELEM

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_switch_focus(cmd)[source]

This command switches the focus to the desired, already allocated, memory region.

Implements SWITCH_FOCUS

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_write(cmd)[source]

This command writes the given value in the specified region a number of times as identified by either a value in the command or a register value.

Implements WRITE

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_write_array(cmd)[source]

This command writes an array of values in the specified region.

Implements WRITE_ARRAY

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_write_param(cmd)[source]

This command handles a single element of a structure.

Implements WRITE_PARAM

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_write_param_component(cmd)[source]

This command is never generated!

Implements WRITE_PARAM_COMPONENT

Parameters:

cmd (int) – the command which triggered the function call

Raises:
execute_write_struct(cmd)[source]

This command writes a structure to memory.

Implements WRITE_STRUCT

Parameters:

cmd (int) – the command which triggered the function call

Raises: