μHAL
fofb_processing.h
1#ifndef FOFB_PROCESSING_H
2#define FOFB_PROCESSING_H
3
4#include <memory>
5#include <vector>
6
7#include "controllers.h"
8#include "decoders.h"
9
10namespace fofb_processing {
11
12/* forward declaration */
13struct wb_fofb_processing_regs;
14
15class Core : public RegisterDecoder {
16 std::unique_ptr<struct wb_fofb_processing_regs> regs_storage;
17 struct wb_fofb_processing_regs &regs;
18
19 void decode() override;
20 void read_monitors() override;
21 void print(FILE *, bool) const override;
22
23public:
24 Core(struct pcie_bars &);
25 ~Core();
26
27 std::vector<int32_t> ref_orb_x, ref_orb_y;
28 std::vector<std::vector<double>> coefficients_x, coefficients_y;
29};
30
32protected:
33 std::unique_ptr<struct wb_fofb_processing_regs> regs_storage;
34 struct wb_fofb_processing_regs &regs;
35
36 void set_devinfo_callback() override;
37 void encode_params() override;
38
39 unsigned fixed_point_coeff, fixed_point_gains;
40
41public:
42 Controller(struct pcie_bars &);
44
45 bool intlk_sta_clr = false, intlk_en_orb_distort = false,
46 intlk_en_packet_loss = false;
47 unsigned orb_distort_limit = 0, min_num_packets = 0;
48
49 std::vector<int32_t> ref_orb_x, ref_orb_y;
50
51 struct parameters {
52 std::vector<double> coefficients_x, coefficients_y;
53 bool acc_clear = false, acc_freeze = false;
54 double acc_gain = 0;
55 uint32_t sp_limit_max = 0, sp_limit_min = 0;
57 uint32_t sp_decim_ratio = 1;
58 };
59 std::vector<struct parameters> parameters;
60
61 void write_params() override;
62};
63
64} /* namespace fofb_processing */
65
66#endif
Definition: controllers.h:7
Definition: decoders.h:97
Definition: fofb_processing.h:31
void set_devinfo_callback() override
Definition: fofb_processing.cc:222
void encode_params() override
Definition: fofb_processing.cc:231
void write_params() override
Definition: fofb_processing.cc:276
Definition: fofb_processing.h:15
void read_monitors() override
Definition: fofb_processing.cc:83
void decode() override
Definition: fofb_processing.cc:97
Definition: fofb_processing.h:51
uint32_t sp_decim_ratio
Definition: fofb_processing.h:57
Definition: pcie-defs.h:19