-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsysid.h
More file actions
78 lines (60 loc) · 2.06 KB
/
sysid.h
File metadata and controls
78 lines (60 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#ifndef SYS_ID_H
#define SYS_ID_H
#include <memory>
#include <vector>
#include "controllers.h"
#include "decoders.h"
namespace sys_id {
/* forward declaration */
struct wb_fofb_sys_id_regs;
class distortion_levels {
public:
distortion_levels(size_t);
std::vector<int16_t> prbs_0, prbs_1;
};
class Core: public RegisterDecoder {
std::unique_ptr<struct wb_fofb_sys_id_regs> regs_storage;
struct wb_fofb_sys_id_regs ®s;
void decode() override;
void read_monitors() override;
void decode_monitors() override;
public:
Core(struct pcie_bars &);
~Core() override;
void print(FILE *, bool) const override;
distortion_levels setpoint_distortion;
distortion_levels posx_distortion, posy_distortion;
};
class Controller: public RegisterController {
protected:
std::unique_ptr<struct wb_fofb_sys_id_regs> regs_storage;
struct wb_fofb_sys_id_regs ®s;
void set_devinfo_callback() override;
void encode_params() override;
public:
Controller(struct pcie_bars &);
~Controller();
/** First BPM ID whose position will be stored in SYSID acquisitions;
* MAX_NUM_CTE BPMs will be stored */
uint8_t base_bpm_id = 0;
/** Enable PRBS reset via trigger */
bool prbs_reset = false;
/** Duration of each PRBS step. Must be at least 1 */
uint16_t step_duration = 1;
/** Set length of internal LFSR. Must be at least 2 */
uint8_t lfsr_length = 2;
/** Enable PRBS-based distortion on BPM positions */
bool bpm_pos_distort_en = false;
/** Enable PRBS-based distortion on accumulator setpoints */
bool sp_distort_en = false;
/** Set moving average samples for FOFBAcc distortion */
uint8_t sp_mov_avg_samples;
/** Distortion levels to apply on setpoint for each PRBS state */
distortion_levels setpoint_distortion;
/** Distortion levels to apply on X position for each PRBS state */
distortion_levels posx_distortion;
/** Distortion levels to apply on Y position for each PRBS state */
distortion_levels posy_distortion;
};
} /* namespace sys_id */
#endif