REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
Loading...
Searching...
No Matches

The Lucidac class represents a single cluster. More...

#include <cluster.h>

Inheritance diagram for platform::Cluster:
Collaboration diagram for platform::Cluster:

Public Member Functions

 Cluster (uint8_t cluster_idx=0)
 
metadata::eui_t get_entity_eui () const override
 
bool init ()
 returns true in case of success
 
std::array< blocks::FunctionBlock *, 6 > get_blocks () const
 
bool calibrate_offsets ()
 
bool calibrate_routes ()
 
utils::status write_to_hardware () override
 returns true in case of success
 
uint8_t get_cluster_idx () const
 
bool route (uint8_t u_in, uint8_t u_out, float c_factor, uint8_t i_out)
 Register a route throught the cluster.
 
bool add_constant (blocks::UBlock::Transmission_Mode signal_type, uint8_t u_out, float c_factor, uint8_t i_out)
 
bool route_in_external (uint8_t input, uint8_t i_out)
 Allows to route in an external signal from the lucidac front panel. input can be between 0 - 7.
 
bool route_out_external (uint8_t u_in, uint8_t output, float c_factor)
 Allows to route an signal to the external outputs on the lucidac front panel.
 
void reset (entities::ResetAction action)
 
std::vector< Entity * > get_child_entities () override
 
Entityget_child_entity (const std::string &child_id) override
 
utils::status config_self_from_json (JsonObjectConst cfg) override
 Deserialize a new configuration for this entity from a JsonObject.
 
- Public Member Functions inherited from entities::Entity
 Entity ()=default
 
 Entity (std::string entityId)
 
const std::string & get_entity_id () const
 
void rename_entity (const std::string entityId)
 
EntityClassifier get_entity_classifier () const
 
EntityClass get_entity_class () const
 
uint8_t get_entity_type () const
 
Version get_entity_version () const
 
uint8_t get_entity_variant () const
 
bool is_entity_class (EntityClass class_) const
 
bool is_entity_type (uint8_t type_) const
 
bool is_entity_version (Version version_) const
 
bool is_entity_variant (uint8_t variant_) const
 
Entityresolve_child_entity (std::string paths[], size_t len)
 
Entityresolve_child_entity (JsonArrayConstIterator begin, JsonArrayConstIterator end)
 
Entityresolve_child_entity (JsonArrayConst path)
 
utils::status config_from_json (JsonObjectConst cfg)
 Deserialize a new configuration for this entity and all its children from a JsonObject.
 
void config_to_json (JsonObject &cfg, bool recursive=true)
 Serialize the configuration for this entity to a JsonObject.
 
utils::status user_set_config (JsonObjectConst msg_in, JsonObject &msg_out)
 
utils::status user_get_config (JsonObjectConst msg_in, JsonObject &msg_out)
 
utils::status user_reset_config (JsonObjectConst msg_in, JsonObject &msg_out)
 
void classifier_to_json (JsonObject &out)
 Provide recursive entity information in a tree.
 

Public Attributes

blocks::MBlockm0block = nullptr
 
blocks::MBlockm1block = nullptr
 
blocks::UBlockublock = nullptr
 
blocks::CBlockcblock = nullptr
 
blocks::IBlockiblock = nullptr
 
blocks::SHBlockshblock = nullptr
 

Static Public Attributes

static constexpr auto CLASS_ = entities::EntityClass::CLUSTER
 

Additional Inherited Members

- Protected Member Functions inherited from entities::Entity
utils::status config_children_from_json (JsonObjectConst &cfg)
 Deserialize a new configuration for all child entities from a JsonObject.
 
virtual void config_self_to_json (JsonObject &cfg)
 Serialize the configuration of this entity to a JsonObject.
 
void config_children_to_json (JsonObject &cfg)
 Serialize the configuration of the child entities of this entity to a JsonObject.
 
- Protected Attributes inherited from entities::Entity
std::string entity_id
 
EntityClassifier classifier
 

Detailed Description

The Lucidac class represents a single cluster.

A cluster holds a number of "blocks" (also refered to as DIMM modules) where the interconnection matrix is composed by the U/C/I blocks and the computing elements by the M blocks.

Definition at line 20 of file cluster.h.

Constructor & Destructor Documentation

◆ Cluster()

FLASHMEM platform::Cluster::Cluster ( uint8_t cluster_idx = 0)
explicit

Definition at line 69 of file cluster.cpp.

References CLASS_, and entities::Entity::classifier.

Member Function Documentation

◆ add_constant()

FLASHMEM bool platform::Cluster::add_constant ( blocks::UBlock::Transmission_Mode signal_type,
uint8_t u_out,
float c_factor,
uint8_t i_out )

◆ calibrate_offsets()

FLASHMEM bool platform::Cluster::calibrate_offsets ( )

◆ calibrate_routes()

◆ config_self_from_json()

FLASHMEM utils::status platform::Cluster::config_self_from_json ( JsonObjectConst cfg)
overridevirtual

Deserialize a new configuration for this entity from a JsonObject.

Implementations shall not traverse to children,

See also
config_children_from_json() instead.
Returns
true in case of success, else false

Implements entities::Entity.

Definition at line 302 of file cluster.cpp.

References utils::status::success().

◆ get_blocks()

FLASHMEM std::array< blocks::FunctionBlock *, 6 > platform::Cluster::get_blocks ( ) const

Definition at line 15 of file cluster.cpp.

References cblock, iblock, m0block, m1block, shblock, and ublock.

◆ get_child_entities()

FLASHMEM std::vector< entities::Entity * > platform::Cluster::get_child_entities ( )
overridevirtual

Implements entities::Entity.

Definition at line 311 of file cluster.cpp.

◆ get_child_entity()

FLASHMEM entities::Entity * platform::Cluster::get_child_entity ( const std::string & child_id)
overridevirtual

Implements entities::Entity.

Definition at line 286 of file cluster.cpp.

◆ get_cluster_idx()

FLASHMEM uint8_t platform::Cluster::get_cluster_idx ( ) const

Definition at line 318 of file cluster.cpp.

Referenced by carrier::Carrier::calibrate_routes_in_cluster().

◆ get_entity_eui()

metadata::eui_t platform::Cluster::get_entity_eui ( ) const
inlineoverridevirtual

Implements entities::Entity.

Definition at line 40 of file cluster.h.

◆ init()

FLASHMEM bool platform::Cluster::init ( )
virtual

◆ reset()

FLASHMEM void platform::Cluster::reset ( entities::ResetAction action)
virtual

Reimplemented from entities::Entity.

Definition at line 279 of file cluster.cpp.

Referenced by blocks::MIntBlock_V_1_1_X::calibrate(), and blocks::MMulBlock::calibrate().

◆ route()

FLASHMEM bool platform::Cluster::route ( uint8_t u_in,
uint8_t u_out,
float c_factor,
uint8_t i_out )

Register a route throught the cluster.

Note that this does not immediately configure hardware but just prepares the in-memory representations of the individual blocks. Use write_to_hardware() to flush all blocks.

Note that previously existing routes (also from previous IC/OP cycles) most certainly still exist both in-memory representation and in the hardware. Use reset() to flush both of them.

Note that this currently yields undefined behaviour if a route on the same u_out already exists.

  • u_in Row index [0..15] for U-Block input (corresponding to some M-Block output)
  • u_out Column index [0..31] to use for routing through U/C/I block
  • c_factor Coefficient value [-20,+20] for coefficient at position idx=u_out
  • i_out Row index [0..15] for I-Block output (corresponding to some M-Block input)
    Returns
    false in case of illegal input data, else true

Definition at line 230 of file cluster.cpp.

◆ route_in_external()

FLASHMEM bool platform::Cluster::route_in_external ( uint8_t input,
uint8_t i_out )

Allows to route in an external signal from the lucidac front panel. input can be between 0 - 7.

Definition at line 263 of file cluster.cpp.

◆ route_out_external()

FLASHMEM bool platform::Cluster::route_out_external ( uint8_t u_in,
uint8_t output,
float c_factor )

Allows to route an signal to the external outputs on the lucidac front panel.

Output can be between 0 - 7.

Definition at line 270 of file cluster.cpp.

◆ write_to_hardware()

FLASHMEM utils::status platform::Cluster::write_to_hardware ( )
nodiscardoverridevirtual

returns true in case of success

Reimplemented from entities::Entity.

Definition at line 219 of file cluster.cpp.

References utils::status::failure(), LOG, and utils::status::success().

Referenced by blocks::MIntBlock_V_1_1_X::calibrate(), and blocks::MMulBlock::calibrate().

Member Data Documentation

◆ cblock

blocks::CBlock* platform::Cluster::cblock = nullptr

◆ CLASS_

auto platform::Cluster::CLASS_ = entities::EntityClass::CLUSTER
staticconstexpr

Definition at line 32 of file cluster.h.

Referenced by Cluster().

◆ iblock

blocks::IBlock* platform::Cluster::iblock = nullptr

Definition at line 29 of file cluster.h.

Referenced by get_blocks().

◆ m0block

blocks::MBlock* platform::Cluster::m0block = nullptr

Definition at line 25 of file cluster.h.

Referenced by get_blocks().

◆ m1block

blocks::MBlock* platform::Cluster::m1block = nullptr

Definition at line 26 of file cluster.h.

Referenced by get_blocks().

◆ shblock

blocks::SHBlock* platform::Cluster::shblock = nullptr

Definition at line 30 of file cluster.h.

Referenced by get_blocks().

◆ ublock

blocks::UBlock* platform::Cluster::ublock = nullptr

The documentation for this class was generated from the following files: