pflib v2.7.0-1-gd371ab6a
Polarfire Interaction Library
uhalWishboneInterface.h
1#ifndef UHAL_WISHBONE_INTERFACE_H_
2#define UHAL_WISHBONE_INTERFACE_H_ 1
3
4#include "pflib/WishboneInterface.h"
5#include "pflib/Backend.h"
6#include <memory>
7
8// Forward declarations of the TCP client
9namespace uhal {
10class HwInterface;
11class Node;
12}
13
14namespace pflib {
15namespace uhal {
16
18 public:
20 uhalWishboneInterface(const std::string& target, const std::string& ipbus_map_path);
21
22 virtual ~uhalWishboneInterface();
23
28 virtual void wb_write(int target, uint32_t addr, uint32_t data);
29
34 virtual uint32_t wb_read(int target, uint32_t addr);
35
39 virtual void wb_reset();
40
47 virtual void wb_errors(uint32_t& crcup_errors, uint32_t& crcdn_errors, uint32_t& wb_errors);
48
52 virtual void wb_clear_counters();
53
54
56 virtual void fc_sendL1A();
57 virtual void fc_linkreset();
58 virtual void fc_bufferclear();
59 virtual void fc_calibpulse();
60 virtual void fc_setup_calib(int pulse_len, int l1a_offset);
61 virtual void fc_get_setup_calib(int& pulse_len, int& l1a_offset);
62 virtual void fc_read_counters(int& spill_count, int& header_occ, int& header_occ_max, int& event_count, int& vetoed_counter) override;
63 virtual void fc_clear_run() override;
64 virtual void fc_advance_l1_fifo() override;
65 virtual void fc_enables_read(bool& ext_l1a, bool& ext_spill, bool& timer_l1a) override;
66 virtual void fc_enables(bool ext_l1a, bool ext_spill, bool timer_l1a) override;
67 virtual void fc_veto_setup_read(bool& veto_daq_busy, bool& veto_l1_occ, int& l1_occ_busy, int& l1_occ_ok) override;
68 virtual void fc_veto_setup(bool veto_daq_busy, bool veto_l1_occ, int l1_occ_busy, int l1_occ_ok) override;
69
70
71 virtual void daq_reset();
72 virtual void daq_advance_ptr();
73 virtual void daq_status(bool& full, bool& empty, int& nevents, int& next_event_size);
75 private:
76 void dispatch();
78};
79
80}
81}
82
83
84#endif // UHAL_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: uhalWishboneInterface.h:17
virtual void fc_veto_setup(bool veto_daq_busy, bool veto_l1_occ, int l1_occ_busy, int l1_occ_ok) override
set the enables for various trigger/spill sources
Definition: uhalWishboneInterface.cxx:240
virtual void daq_advance_ptr()
advance the daq pointer along buffer
Definition: uhalWishboneInterface.cxx:284
virtual void fc_read_counters(int &spill_count, int &header_occ, int &header_occ_max, int &event_count, int &vetoed_counter) override
read counters from the FC side
Definition: uhalWishboneInterface.cxx:145
virtual void fc_veto_setup_read(bool &veto_daq_busy, bool &veto_l1_occ, int &l1_occ_busy, int &l1_occ_ok) override
check the setup for various busy/veto
Definition: uhalWishboneInterface.cxx:211
virtual void daq_reset()
reset the daq buffers
Definition: uhalWishboneInterface.cxx:278
uhalWishboneInterface(const std::string &target, const std::string &ipbus_map_path)
Construct a TCP bridge.
Definition: uhalWishboneInterface.cxx:10
virtual uint32_t wb_read(int target, uint32_t addr)
read a 32-bit word from the given target and address
Definition: uhalWishboneInterface.cxx:62
virtual void daq_status(bool &full, bool &empty, int &nevents, int &next_event_size)
readout the daq status into the passed variables
Definition: uhalWishboneInterface.cxx:290
virtual void fc_enables(bool ext_l1a, bool ext_spill, bool timer_l1a) override
set the enables for various trigger/spill sources
Definition: uhalWishboneInterface.cxx:185
virtual void wb_reset()
reset the wishbone bus (on/off cycle)
Definition: uhalWishboneInterface.cxx:87
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: uhalWishboneInterface.cxx:95
virtual void fc_calibpulse()
send a single calib pulse
Definition: uhalWishboneInterface.cxx:123
virtual void fc_sendL1A()
Backend implementation.
Definition: uhalWishboneInterface.cxx:105
virtual void wb_write(int target, uint32_t addr, uint32_t data)
write a 32-bit word to the given target and address
Definition: uhalWishboneInterface.cxx:37
virtual void fc_linkreset()
send a link reset
Definition: uhalWishboneInterface.cxx:111
virtual void fc_setup_calib(int pulse_len, int l1a_offset)
calib pulse setup
Definition: uhalWishboneInterface.cxx:129
virtual void fc_clear_run() override
reset counters for a new run
Definition: uhalWishboneInterface.cxx:163
virtual void fc_get_setup_calib(int &pulse_len, int &l1a_offset)
calib pulse setup
Definition: uhalWishboneInterface.cxx:136
virtual void fc_enables_read(bool &ext_l1a, bool &ext_spill, bool &timer_l1a) override
check the enables for various trigger/spill sources
Definition: uhalWishboneInterface.cxx:169
virtual std::vector< uint32_t > daq_read_event()
read the aquired event and return it
Definition: uhalWishboneInterface.cxx:304
virtual void wb_clear_counters()
Clear the monitoring counters.
Definition: uhalWishboneInterface.cxx:101
virtual void fc_bufferclear()
send a single L1A
Definition: uhalWishboneInterface.cxx:117
virtual void fc_advance_l1_fifo() override
advance the FC fifo
Definition: uhalWishboneInterface.cxx:272
Polarfire Interaction Library.
Definition: Backend.h:8