1#ifndef PFLIB_POLARFIRETARGET_H
2#define PFLIB_POLARFIRETARGET_H
9#include "pflib/WishboneInterface.h"
10#include "pflib/Backend.h"
11#include "pflib/Hcal.h"
166 void prepareNewRun();
229 void elink_relink(
int ilink,
int min_delay = 0,
int max_delay = 128);
240 void delay_loop(
int ilink,
int min_delay,
int max_delay);
255 bool bitslip_loop(
int ilink,
int& best_slip,
int& best_count);
258 int samples_per_event_;
Abstract interface for various backend manipulations.
Definition: Backend.h:16
representing a standard HCAL motherboard
Definition: Hcal.h:17
Abstract interface for wishbone transactions, used by ~all classes in pflib.
Definition: WishboneInterface.h:15
Polarfire Interaction Library.
Definition: Backend.h:8
std::map< std::string, std::map< std::string, int > > decompile(const std::map< int, std::map< int, uint8_t > > &compiled_config, bool be_careful)
unpack register values into the page names, parameter names and parameter values mapping
Definition: Compile.cxx:474
Interface to a single polarfire.
Definition: PolarfireTarget.h:33
bool loadBiasSettings(const std::string &file_name)
Definition: PolarfireTarget.cxx:441
Backend * backend
handle to opened backend connection
Definition: PolarfireTarget.h:39
PolarfireTarget(T *t)
If only a single pointer is provided, assume that object is BOTH the WBI and backend.
Definition: PolarfireTarget.h:77
void loadDefaultROCParameters()
Loads the default ROC config on boards where it is specified.
Definition: PolarfireTarget.cxx:205
void daqStatus(std::ostream &os)
Print a decoded daq status to the input ostream MOVE TO DAQ.
Definition: PolarfireTarget.cxx:289
void enableZeroSuppression(int link, bool full_suppress)
Enable zero suppression in the input link.
Definition: PolarfireTarget.cxx:331
void elinkStatus(std::ostream &os)
Print a decoded elink status to the input ostream MOVE TO ELINKS.
Definition: PolarfireTarget.cxx:115
~PolarfireTarget()
Cleanup the wishbone interface and backend checking if they are the same.
Definition: PolarfireTarget.cxx:90
WishboneInterface * wb
handle to opened wishbone interface
Definition: PolarfireTarget.h:37
static const int N_REGISTERS_PER_PAGE
number of registers per page of HGC ROC
Definition: PolarfireTarget.h:45
void dumpSettings(int roc, const std::string &file_name, bool decompile)
Request all of the ROC setting register values.
Definition: PolarfireTarget.cxx:217
void loadIntegerCSV(const std::string &file_name, const std::function< void(const std::vector< int > &)> &Action)
Load an integer CSV and pass the rows one at a time to the input Action.
Definition: PolarfireTarget.cxx:157
bool bitslip_loop(int ilink, int &best_slip, int &best_count)
check all bitslip values and find the one with the most correct idle patterns
Definition: PolarfireTarget.cxx:491
static int NLINKS
number of links
Definition: PolarfireTarget.h:51
void delay_loop(int ilink, int min_delay, int max_delay)
Go from min_delay up to max_delay stopping only if alignment is achieved.
Definition: PolarfireTarget.cxx:474
std::vector< uint32_t > elinksBigSpy(int ilink, int presamples, bool do_l1a)
Entire ldmx_link function commented out pretty much.
Definition: PolarfireTarget.cxx:107
void daqSoftReset()
daq soft reset stays here becauses uses FC as well as DAQ
Definition: PolarfireTarget.cxx:350
std::vector< uint32_t > daqReadEvent()
daq read event make sure to prepareNewRun before!
Definition: PolarfireTarget.cxx:378
void elink_relink(int ilink, int min_delay=0, int max_delay=128)
Carries out the standard elink alignment process.
Definition: PolarfireTarget.cxx:465
Hcal hcal
object representing hcal motherboard
Definition: PolarfireTarget.h:41
std::vector< uint32_t > daqReadDirect()
daq read direct uses backend
Definition: PolarfireTarget.cxx:368
void daqHardReset()
daq hard reset stays here because uses backend
Definition: PolarfireTarget.cxx:362
bool wb_be_same
are the WBI and Backend the same object?
Definition: PolarfireTarget.h:35
void findDefaultROCParameters(std::vector< std::string > paths)
Stores paths of default ROC config files, as given by the pftoolrc.
Definition: PolarfireTarget.cxx:201
void setBiasSetting(int board, bool led, int hdmi, int val)
set a single bias setting
Definition: PolarfireTarget.cxx:435
void loadROCRegisters(int roc, const std::string &file_name)
Load register values onto ROC chip from inptu file.
Definition: PolarfireTarget.cxx:174
std::pair< int, int > getFirmwareVersion()
deduce firmware major/minor version
Definition: PolarfireTarget.cxx:102
static const int N_PAGES
number of availabe pages on HGC ROC
Definition: PolarfireTarget.h:43
void loadROCParameters(int roc, const std::string &file_name, bool prepend_defaults)
Compile the input YAML file including the defaults if prepend_defaults is true, otherwise using curre...
Definition: PolarfireTarget.cxx:187
PolarfireTarget(WishboneInterface *wbi, Backend *be, bool same=false)
Define where the polarfire we will be talking to is.
Definition: PolarfireTarget.cxx:87