pflib v2.7.0-1-gd371ab6a
Polarfire Interaction Library
RogueWishboneInterface.h
1#ifndef ROGUE_WISHBONE_INTERFACE_H_
2#define ROGUE_WISHBONE_INTERFACE_H_ 1
3
4#include "pflib/WishboneInterface.h"
5#include "pflib/Backend.h"
6#include <memory>
7
8// Forward declaration of the TCP client
9namespace rogue {
10namespace interfaces {
11namespace memory {
12class TcpClient;
13class Master;
14}
15namespace stream {
16class TcpClient;
17class Slave;
18}
19}
20namespace utilities {
21namespace fileio {
22class StreamWriter;
23}
24}
25}
26
27namespace pflib {
28namespace rogue {
29
31 public:
33 RogueWishboneInterface(const std::string& host, int port);
34
36
41 virtual void wb_write(int target, uint32_t addr, uint32_t data);
42
47 virtual uint32_t wb_read(int target, uint32_t addr);
48
52 virtual void wb_reset();
53
60 virtual void wb_errors(uint32_t& crcup_errors, uint32_t& crcdn_errors, uint32_t& wb_errors);
61
65 virtual void wb_clear_counters();
66
67
69 virtual void fc_sendL1A();
70 virtual void fc_linkreset();
71 virtual void fc_bufferclear();
72 virtual void fc_calibpulse();
73 virtual void fc_clear_run();
74 virtual void fc_setup_calib(int pulse_len, int l1a_offset);
75 virtual void fc_get_setup_calib(int& pulse_len, int& l1a_offset);
76 virtual void fc_read_counters(int& spill_count, int& header_occ, int& header_occ_max, int& event_count, int& vetoed);
77 virtual void fc_enables_read(bool& ext_l1a, bool& ext_spill, bool& timer_l1a);
78 virtual void fc_enables(bool ext_l1a, bool ext_spill, bool timer_l1a);
79 virtual int fc_timer_setup_read();
80 virtual void fc_timer_setup(int usdelay);
81 virtual void fc_veto_setup_read(bool& veto_daq_busy, bool& veto_l1_occ, int& l1_occ_busy, int& l1_occ_ok);
82 virtual void fc_veto_setup(bool veto_daq_busy, bool veto_l1_occ, int l1_occ_busy, int l1_occ_ok);
83 virtual void fc_advance_l1_fifo();
84
85 virtual void daq_reset();
86 virtual void daq_advance_ptr();
87 virtual void daq_status(bool& full, bool& empty, int& nevents, int& next_event_size);
89 virtual void daq_setup_event_tag(int run, int day, int month, int hour, int min);
90
92 void daq_dma_enable(bool enable);
93 void daq_dma_setup(uint8_t fpga_id, uint8_t samples_per_event);
94 void daq_get_dma_setup(uint8_t& fpga_id, uint8_t& samples_per_event, bool& enabled);
95 uint32_t daq_dma_status();
96 void daq_dma_dest(const std::string& fname);
98 void daq_dma_run(const std::string& cmd, int run, int nevents, int rate);
99 void daq_dma_close();
100
101 private:
104
105 // for dma readout, these will just sit silently while dma is disabled
108};
109
110}
111}
112
113
114#endif // ROGUE_WISHBONE_INTERFACE_H_
Abstract interface for various backend manipulations.
Definition: Backend.h:16
Abstract interface for wishbone transactions, used by ~all classes in pflib.
Definition: WishboneInterface.h:15
Definition: RogueWishboneInterface.h:30
virtual void daq_advance_ptr()
advance the daq pointer along buffer
Definition: RogueWishboneInterface.cxx:238
virtual void fc_calibpulse()
send a single calib pulse
Definition: RogueWishboneInterface.cxx:127
virtual void fc_enables(bool ext_l1a, bool ext_spill, bool timer_l1a)
set the enables for various trigger/spill sources
Definition: RogueWishboneInterface.cxx:198
virtual void wb_reset()
reset the wishbone bus (on/off cycle)
Definition: RogueWishboneInterface.cxx:62
virtual void fc_bufferclear()
send a single L1A
Definition: RogueWishboneInterface.cxx:121
virtual void fc_setup_calib(int pulse_len, int l1a_offset)
calib pulse setup
Definition: RogueWishboneInterface.cxx:133
virtual void fc_get_setup_calib(int &pulse_len, int &l1a_offset)
calib pulse setup
Definition: RogueWishboneInterface.cxx:143
virtual void wb_errors(uint32_t &crcup_errors, uint32_t &crcdn_errors, uint32_t &wb_errors)
Read the monitoring counters crcup_errors – CRC errors observed on the uplink (wraps) crcdn_errors – ...
Definition: RogueWishboneInterface.cxx:65
virtual void daq_setup_event_tag(int run, int day, int month, int hour, int min)
Set the event tagging information.
Definition: RogueWishboneInterface.cxx:304
virtual void fc_sendL1A()
Backend implementation.
Definition: RogueWishboneInterface.cxx:115
virtual void wb_clear_counters()
Clear the monitoring counters.
Definition: RogueWishboneInterface.cxx:71
RogueWishboneInterface(const std::string &host, int port)
Construct a TCP bridge.
Definition: RogueWishboneInterface.cxx:14
virtual void fc_linkreset()
send a link reset
Definition: RogueWishboneInterface.cxx:118
virtual void fc_timer_setup(int usdelay)
set the period in us for the timer trigger
Definition: RogueWishboneInterface.cxx:186
virtual uint32_t wb_read(int target, uint32_t addr)
read a 32-bit word from the given target and address
Definition: RogueWishboneInterface.cxx:50
virtual void fc_enables_read(bool &ext_l1a, bool &ext_spill, bool &timer_l1a)
check the enables for various trigger/spill sources
Definition: RogueWishboneInterface.cxx:192
virtual void fc_advance_l1_fifo()
advance the FC fifo
Definition: RogueWishboneInterface.cxx:130
virtual void daq_status(bool &full, bool &empty, int &nevents, int &next_event_size)
readout the daq status into the passed variables
Definition: RogueWishboneInterface.cxx:241
virtual void wb_write(int target, uint32_t addr, uint32_t data)
write a 32-bit word to the given target and address
Definition: RogueWishboneInterface.cxx:39
virtual void daq_reset()
reset the daq buffers
Definition: RogueWishboneInterface.cxx:235
void daq_dma_enable(bool enable)
specific items related to DMA which are not part of the general interface
Definition: RogueWishboneInterface.cxx:271
virtual void fc_read_counters(int &spill_count, int &header_occ, int &header_occ_max, int &event_count, int &vetoed)
read counters from the FC side
Definition: RogueWishboneInterface.cxx:167
virtual std::vector< uint32_t > daq_read_event()
read the aquired event and return it
Definition: RogueWishboneInterface.cxx:248
virtual int fc_timer_setup_read()
get the period in us for the timer trigger
Definition: RogueWishboneInterface.cxx:183
virtual void fc_clear_run()
reset counters for a new run
Definition: RogueWishboneInterface.cxx:124
virtual void fc_veto_setup(bool veto_daq_busy, bool veto_l1_occ, int l1_occ_busy, int l1_occ_ok)
set the enables for various trigger/spill sources
Definition: RogueWishboneInterface.cxx:156
virtual void fc_veto_setup_read(bool &veto_daq_busy, bool &veto_l1_occ, int &l1_occ_busy, int &l1_occ_ok)
check the setup for various busy/veto
Definition: RogueWishboneInterface.cxx:148
Polarfire Interaction Library.
Definition: Backend.h:8