Skip to content
Snippets Groups Projects
Commit 4bb2b905 authored by Rocco Ardino's avatar Rocco Ardino :registered: Committed by Thomas Owen James
Browse files

TCP input filter for TCP-based firmware

parent 2e7a659e
No related branches found
No related tags found
1 merge request!62TCP input filter for TCP-based firmware
Pipeline #6196331 passed
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
# "dma" for XILINX DMA driver # "dma" for XILINX DMA driver
# "filedma" for reading from file and simulating DMA # "filedma" for reading from file and simulating DMA
# "micronDMA" for PICO driver # "micronDMA" for PICO driver
# "tcpip" for TCP/IP input receving
input:wzdma input:wzdma
## Settings for DMA input ## Settings for DMA input
...@@ -26,8 +27,8 @@ dma_number_of_packet_buffers:1000 ...@@ -26,8 +27,8 @@ dma_number_of_packet_buffers:1000
# Print report each N packets, use 0 to disable # Print report each N packets, use 0 to disable
packets_per_report:200000 packets_per_report:200000
# number of orbits per DMA packet, in decimal # number of orbits per packet, in decimal
NOrbitsPerDMAPacket:20 nOrbitsPerPacket:20
# prescale factor, used for *calo* data only # prescale factor, used for *calo* data only
prescale_factor:1 prescale_factor:1
...@@ -37,6 +38,9 @@ prescale_factor:1 ...@@ -37,6 +38,9 @@ prescale_factor:1
#input_file:/dev/shm/testdata.bin #input_file:/dev/shm/testdata.bin
input_file:testdata.bin input_file:testdata.bin
## Extra settings for "tcpip" input
tcpDestPort:10000
################################################################################ ################################################################################
## ##
...@@ -94,6 +98,9 @@ quality_cut:12 ...@@ -94,6 +98,9 @@ quality_cut:12
## ##
################################################################################ ################################################################################
# enable development functionalities (e.g. TCP input filter)
dev_TCPAutoReconnectOnFailure:false
## Logging, supported LOG severities: ## Logging, supported LOG severities:
# TRACE # TRACE
# DEBUG # DEBUG
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
TARGET = scdaq TARGET = scdaq
# source files # source files
SOURCES = config.cc DmaInputFilter.cc elastico.cc FileDmaInputFilter.cc InputFilter.cc OutputFileHandler.cc OutputBySize.cc OutputByOrbit.cc processor.cc scdaq.cc session.cc slice.cc tools.cc WZDmaInputFilter.cc MicronDmaInputFilter.cc SOURCES = config.cc DmaInputFilter.cc elastico.cc FileDmaInputFilter.cc InputFilter.cc MicronDmaInputFilter.cc OutputByOrbit.cc OutputBySize.cc OutputFileHandler.cc processor.cc scdaq.cc session.cc slice.cc TcpInputFilter.cc tools.cc WZDmaInputFilter.cc
C_SOURCES = wz_dma.c C_SOURCES = wz_dma.c
# work out names of object files from sources # work out names of object files from sources
...@@ -70,6 +70,7 @@ processor.o: processor.h slice.h format.h log.h bril_histo.h FRDEventHeader_V6.h ...@@ -70,6 +70,7 @@ processor.o: processor.h slice.h format.h log.h bril_histo.h FRDEventHeader_V6.h
session.o: session.h log.h session.o: session.h log.h
slice.o: slice.h slice.o: slice.h
WZDmaInputFilter.o: WZDmaInputFilter.h InputFilter.h tools.h log.h WZDmaInputFilter.o: WZDmaInputFilter.h InputFilter.h tools.h log.h
TcpInputFilter.o: TcpInputFilter.h InputFilter.h tools.h log.h
wz_dma.o: wz_dma.h wz_dma.o: wz_dma.h
MicronDmaInputFilter.o: MicronDmaInputFilter.h MicronDmaInputFilter.o: MicronDmaInputFilter.h
tools.o: tools.h log.h tools.o: tools.h log.h
...@@ -41,7 +41,7 @@ void OutputByOrbitStream::OutputFixedOrbits(Slice &out) { ...@@ -41,7 +41,7 @@ void OutputByOrbitStream::OutputFixedOrbits(Slice &out) {
n = fwrite(out.begin(), 1, out.size(), n = fwrite(out.begin(), 1, out.size(),
output_file_handler_.getFile(control.run_number, index).getFilePtr()); output_file_handler_.getFile(control.run_number, index).getFilePtr());
output_file_handler_.upFileSize(n); output_file_handler_.upFileSize(n);
output_file_handler_.upNOrbits(conf.getNOrbitsPerDMAPacket()); output_file_handler_.upNOrbits(conf.getNOrbitsPerPacket());
} else if (output_file_handler_.hasFile()) { } else if (output_file_handler_.hasFile()) {
// the run has been stopped so drop but first check if there is a last // the run has been stopped so drop but first check if there is a last
// file to close // file to close
......
#include "TcpInputFilter.h"
#include <fcntl.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <cassert>
#include <cerrno>
#include <cstdio>
#include <iostream>
#include <sstream>
#include <system_error>
#include "log.h"
#include "tools.h"
TcpInputFilter::TcpInputFilter(int destPort, size_t packetBufferSize, size_t nbPacketBuffers,
const uint32_t nOrbitsPerPacket, ctrl &control, config &conf)
: InputFilter(packetBufferSize, nbPacketBuffers, control),
nOrbitsPerPacket_{nOrbitsPerPacket},
destPort_{destPort} {
// open socket
if ((sock_ = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
throw std::system_error(errno, std::system_category(), "Error opening socket.");
}
// set SO_REUSEADDR on a socket to bypass TIME_WAIT state
const int enable = 1;
if (setsockopt(sock_, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(int)) == -1) {
throw std::system_error(errno, std::system_category(),
"Cannot set socket option to bypass TIME_WAIT state.");
}
// server socket address
server_addr_.sin_family = AF_INET;
server_addr_.sin_addr.s_addr = INADDR_ANY;
server_addr_.sin_port = htons(destPort_);
bzero(&(server_addr_.sin_zero), 8);
// bind socket to address
if (bind(sock_, (struct sockaddr *)&server_addr_, sizeof(struct sockaddr)) == -1) {
throw std::system_error(errno, std::system_category(), "Unable to bind.");
}
// check if listen is possible
if (listen(sock_, 1) == -1) {
throw std::system_error(errno, std::system_category(), "Unable to listen.");
}
LOG(TRACE) << "Created TCP input filter";
}
TcpInputFilter::~TcpInputFilter() {
close(connected_);
LOG(TRACE) << "Destroyed TCP input filter";
}
static inline ssize_t read_tcp_socket_to_buffer(int sock, char *buffer, uint64_t size) {
ssize_t rc;
uint64_t bytesRecvd = 0;
// get data from socket until requested size is reached
while (bytesRecvd < size) {
rc = recv(sock, buffer + bytesRecvd, size - bytesRecvd, 0);
// if connection is closed, recv return value is negative
// return the negative result to signal it
if (rc < 0) {
return rc;
} else if (rc == 0) {
throw std::runtime_error("ERROR: TCP connection was unexpectedly closed by peer.");
}
bytesRecvd += rc;
}
return bytesRecvd;
}
// open connection
void TcpInputFilter::openConnection() {
LOG(TRACE) << "Waiting for connection to be opened";
sin_size_ = sizeof(struct sockaddr_in);
connected_ = accept(sock_, (struct sockaddr *)&client_addr_, &sin_size_);
if (connected_ < 0) {
connection_open_ = false;
throw std::system_error(errno, std::system_category(),
"Error during opening of the connection.");
}
LOG(TRACE) << "Connection opened";
connection_open_ = true;
return;
}
// close connection
void TcpInputFilter::closeConnection() {
if (connection_open_) {
close(connected_);
LOG(TRACE) << "Connection closed";
}
connection_open_ = false;
return;
}
// read packet from TCP socket expecting header frame
// + header frame has to be the first one received
// + extract the payload size encoded in the header frame
// + the logic receives until the given size is reached
ssize_t TcpInputFilter::readPacketFromTcp(char **buffer, size_t bufferSize) {
// start to read header block size
// then update read size from header content
ssize_t blockSize = 32;
ssize_t bytesRecvd = 0;
ssize_t rc;
int skip = 0;
// header frame
packet_header *header;
// if connection is still closed, open it
if (!connection_open_) {
openConnection();
}
bool firstRead = true;
while (true) {
// receive requested size from TCP connected socket
rc = read_tcp_socket_to_buffer(connected_, *buffer + bytesRecvd, blockSize);
// if recv gave negative results, restart connection
if (rc < 0) {
closeConnection();
openConnection();
// avoid the case where:
// + header is received and blockSize decoded
// + connection is closed and HBM pointers have been reset on FPGA board
// + receive invalid blockSize
// thus, be ready to received a new header + payload
blockSize = 32;
bytesRecvd = 0;
firstRead = true;
continue;
}
// update bytes received counter
bytesRecvd += rc;
// check if we are at the first read (header) or not
if (firstRead) {
// interpret header
header = reinterpret_cast<packet_header *>(*buffer);
// check if header marker is in the frame
// if not, try again N times
if (header->feedbeef != 0xfeedbeeffeedbeef) {
printf("Frame 0x%16llx_%16llx_%16llx_%16llx\n", header->feedbeef,
header->frames_in_packet, header->orbit_dropped_counter, header->orbit_seen_counter);
stats.nbHeaderDesync++;
throw std::runtime_error("FATAL: Header not found.");
}
// header found, disable firstRead flag and get packet size
firstRead = false;
blockSize = (header->frames_in_packet + nOrbitsPerPacket_ + 1) * 32;
if (blockSize > (ssize_t)bufferSize) {
stats.nbOversizedPackets++;
}
} else {
// packet has been read, return bytes in packet
return bytesRecvd;
}
}
}
/**************************************************************************
* Entry points are here
* Overriding virtual functions
*/
// Print some additional info
void TcpInputFilter::print(std::ostream &out) const {
out << ", oversized " << stats.nbOversizedPackets << ", scouting packet header desync "
<< stats.nbHeaderDesync;
}
// Read a packet from TCP socket
ssize_t TcpInputFilter::readInput(char **buffer, size_t bufferSize) {
// call function with header read and blocks breaker
return readPacketFromTcp(buffer, bufferSize);
}
#ifndef TCP_INPUT_H
#define TCP_INPUT_H
#include <arpa/inet.h>
#include <netinet/in.h>
#include <memory>
#include <string>
#include "InputFilter.h"
#include "config.h"
#include "tbb/pipeline.h"
#include "tbb/tick_count.h"
class TcpInputFilter : public InputFilter {
public:
TcpInputFilter(int port, size_t packetBufferSize, size_t nbPacketBuffers,
uint32_t nOrbitsPerPacket, ctrl &control, config &conf);
~TcpInputFilter();
protected:
ssize_t readInput(char **buffer, size_t bufferSize); // Override
void print(std::ostream &out) const; // Override
private:
void openConnection();
void closeConnection();
ssize_t readPacketFromTcp(char **buffer, size_t bufferSize);
struct Statistics {
uint64_t nbOversizedPackets = 0;
uint64_t nbHeaderDesync = 0;
} stats;
struct packet_header {
uint64_t feedbeef;
uint64_t frames_in_packet;
uint64_t orbit_dropped_counter;
uint64_t orbit_seen_counter;
};
const uint32_t nOrbitsPerPacket_;
sockaddr_in server_addr_;
sockaddr_in client_addr_;
int destPort_;
int sock_;
unsigned int sin_size_;
int connected_;
bool connection_open_ = false;
};
typedef std::shared_ptr<TcpInputFilter> TcpInputFilterPtr;
#endif
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
class config { class config {
public: public:
enum class InputType { WZDMA, DMA, FILEDMA, MICRONDMA, FILE }; enum class InputType { WZDMA, DMA, FILEDMA, TCPIP, MICRONDMA, FILE };
config(std::string filename); config(std::string filename);
...@@ -30,6 +30,9 @@ class config { ...@@ -30,6 +30,9 @@ class config {
if (input == "filedma") { if (input == "filedma") {
return InputType::FILEDMA; return InputType::FILEDMA;
} }
if (input == "tcpip") {
return InputType::TCPIP;
}
if (input == "micronDMA") { if (input == "micronDMA") {
return InputType::MICRONDMA; return InputType::MICRONDMA;
} }
...@@ -39,6 +42,10 @@ class config { ...@@ -39,6 +42,10 @@ class config {
throw std::invalid_argument("Configuration error: Wrong input type '" + input + "'"); throw std::invalid_argument("Configuration error: Wrong input type '" + input + "'");
} }
bool getDev_TCPAutoReconnectOnFailure() const {
return (vmap.at("dev_TCPAutoReconnectOnFailure") == "true");
}
LOG_LEVEL getLogMinSeverity() const { LOG_LEVEL getLogMinSeverity() const {
const std::string &input = vmap.at("log_min_severity"); const std::string &input = vmap.at("log_min_severity");
if (input == "TRACE") { if (input == "TRACE") {
...@@ -64,6 +71,11 @@ class config { ...@@ -64,6 +71,11 @@ class config {
const std::string &getDmaDevice() const { return vmap.at("dma_dev"); } const std::string &getDmaDevice() const { return vmap.at("dma_dev"); }
uint64_t getTcpDestPort() const {
std::string v = vmap.at("tcpDestPort");
return boost::lexical_cast<uint32_t>(v.c_str());
}
uint64_t getDmaPacketBufferSize() const { uint64_t getDmaPacketBufferSize() const {
std::string v = vmap.at("dma_packet_buffer_size"); std::string v = vmap.at("dma_packet_buffer_size");
return boost::lexical_cast<uint64_t>(v.c_str()); return boost::lexical_cast<uint64_t>(v.c_str());
...@@ -123,8 +135,8 @@ class config { ...@@ -123,8 +135,8 @@ class config {
bool getOutputForceWrite() const { return (vmap.at("output_force_write") == "yes"); } bool getOutputForceWrite() const { return (vmap.at("output_force_write") == "yes"); }
uint32_t getNOrbitsPerDMAPacket() const { uint32_t getNOrbitsPerPacket() const {
std::string v = vmap.at("NOrbitsPerDMAPacket"); std::string v = vmap.at("nOrbitsPerPacket");
return boost::lexical_cast<uint32_t>(v.c_str()); return boost::lexical_cast<uint32_t>(v.c_str());
} }
......
...@@ -13,6 +13,6 @@ struct ctrl { ...@@ -13,6 +13,6 @@ struct ctrl {
bool verbosity; bool verbosity;
uint64_t max_file_size; uint64_t max_file_size;
int packets_per_report; int packets_per_report;
int n_orbits_per_dma_packet; int n_orbits_per_packet;
}; };
#endif #endif
...@@ -241,7 +241,7 @@ struct constants { ...@@ -241,7 +241,7 @@ struct constants {
static constexpr uint32_t orbit_header_size = 32; static constexpr uint32_t orbit_header_size = 32;
static constexpr uint32_t dma_trailer_size = 32; static constexpr uint32_t dma_trailer_size = 32;
// Note: total number of bytes of overhead per packet is: // Note: total number of bytes of overhead per packet is:
// (orbit_trailer_size+orbit_header_size)*NOrbitsPerDMAPacket + // (orbit_trailer_size+orbit_header_size)*nOrbitsPerPacket +
// dma_trailer_size // dma_trailer_size
static constexpr uint32_t intermediate = 0x00000001; static constexpr uint32_t intermediate = 0x00000001;
static constexpr uint32_t final = 0x00000001; static constexpr uint32_t final = 0x00000001;
......
...@@ -14,15 +14,14 @@ ...@@ -14,15 +14,14 @@
StreamProcessor::Statistics StreamProcessor::stats; StreamProcessor::Statistics StreamProcessor::stats;
StreamProcessor::StreamProcessor(size_t max_size_, const bool doZS_, ProcessorType processorType_, StreamProcessor::StreamProcessor(size_t max_size_, const bool doZS_, ProcessorType processorType_,
const uint32_t nOrbitsPerDMAPacket_, const uint32_t nOrbitsPerPacket_, const uint32_t prescaleFactor_,
const uint32_t prescaleFactor_, const bool cmsswHeaders_, const bool cmsswHeaders_, const uint16_t sourceID_, ctrl &control_)
const uint16_t sourceID_, ctrl &control_)
: tbb::filter(parallel), : tbb::filter(parallel),
max_size(max_size_), max_size(max_size_),
nbPackets(0), nbPackets(0),
doZS(doZS_), doZS(doZS_),
processorType(processorType_), processorType(processorType_),
nOrbitsPerDMAPacket(nOrbitsPerDMAPacket_), nOrbitsPerPacket(nOrbitsPerPacket_),
prescaleFactor(prescaleFactor_), prescaleFactor(prescaleFactor_),
cmsswHeaders(cmsswHeaders_), cmsswHeaders(cmsswHeaders_),
sourceID(sourceID_), sourceID(sourceID_),
...@@ -39,8 +38,7 @@ StreamProcessor::~StreamProcessor() {} ...@@ -39,8 +38,7 @@ StreamProcessor::~StreamProcessor() {}
// minus the header/trailers // minus the header/trailers
bool StreamProcessor::CheckFrameMultBlock(size_t inputSize) { bool StreamProcessor::CheckFrameMultBlock(size_t inputSize) {
int bsize = sizeof(blockMuon); int bsize = sizeof(blockMuon);
if ((inputSize - nOrbitsPerDMAPacket * constants::orbit_trailer_size - 32 * nOrbitsPerDMAPacket - if ((inputSize - nOrbitsPerPacket * constants::orbit_trailer_size - 32 * nOrbitsPerPacket - 32) %
32) %
bsize != bsize !=
0) { 0) {
stats.n_consistent_sized_packets = 0; stats.n_consistent_sized_packets = 0;
...@@ -442,7 +440,7 @@ void StreamProcessor::process(Slice &input, Slice &out) { ...@@ -442,7 +440,7 @@ void StreamProcessor::process(Slice &input, Slice &out) {
meta = FillOrbitMuon(trailer, rd_ptr, wr_ptr, rd_end_ptr, wr_end_ptr); meta = FillOrbitMuon(trailer, rd_ptr, wr_ptr, rd_end_ptr, wr_end_ptr);
orbitCount = meta.counts; orbitCount = meta.counts;
++orbit_per_packet_count; ++orbit_per_packet_count;
if (orbit_per_packet_count > nOrbitsPerDMAPacket) { if (orbit_per_packet_count > nOrbitsPerPacket) {
stats.excess_orbits_per_packet_count++; stats.excess_orbits_per_packet_count++;
return; return;
} }
...@@ -494,11 +492,11 @@ void StreamProcessor::process(Slice &input, Slice &out) { ...@@ -494,11 +492,11 @@ void StreamProcessor::process(Slice &input, Slice &out) {
return; return;
} }
if (orbit_per_packet_count > nOrbitsPerDMAPacket) { if (orbit_per_packet_count > nOrbitsPerPacket) {
if (control.verbosity) { if (control.verbosity) {
LOG(WARNING) << "expected DMA trailer word deadbeef, found " << std::hex LOG(WARNING) << "expected DMA trailer word deadbeef, found " << std::hex
<< *dma_trailer_word << ". Orbits per packet count " << *dma_trailer_word << ". Orbits per packet count "
<< orbit_per_packet_count << ", > expected, (" << nOrbitsPerDMAPacket << orbit_per_packet_count << ", > expected, (" << nOrbitsPerPacket
<< ") skipping packet."; << ") skipping packet.";
} }
if (stats.excess_orbits_per_packet_count % 10000 == 0) { if (stats.excess_orbits_per_packet_count % 10000 == 0) {
......
...@@ -25,7 +25,7 @@ class StreamProcessor : public tbb::filter { ...@@ -25,7 +25,7 @@ class StreamProcessor : public tbb::filter {
enum class ProcessorType { PASS_THROUGH, GMT, CALO, BRIL }; enum class ProcessorType { PASS_THROUGH, GMT, CALO, BRIL };
StreamProcessor(size_t max_size_, bool doZS_, ProcessorType processorType_, StreamProcessor(size_t max_size_, bool doZS_, ProcessorType processorType_,
const uint32_t nOrbitsPerDMAPacket_, const uint32_t prescaleFactor_, const uint32_t nOrbitsPerPacket_, const uint32_t prescaleFactor_,
const bool cmsswHeaders_, const uint16_t sourceID, ctrl &control); const bool cmsswHeaders_, const uint16_t sourceID, ctrl &control);
void *operator()(void *item) /*override*/; void *operator()(void *item) /*override*/;
~StreamProcessor(); ~StreamProcessor();
...@@ -49,7 +49,7 @@ class StreamProcessor : public tbb::filter { ...@@ -49,7 +49,7 @@ class StreamProcessor : public tbb::filter {
uint64_t nbPackets; uint64_t nbPackets;
const bool doZS; const bool doZS;
const ProcessorType processorType; const ProcessorType processorType;
const uint32_t nOrbitsPerDMAPacket; const uint32_t nOrbitsPerPacket;
const uint32_t prescaleFactor; const uint32_t prescaleFactor;
const bool cmsswHeaders; const bool cmsswHeaders;
const uint16_t sourceID; const uint16_t sourceID;
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "MicronDmaInputFilter.h" #include "MicronDmaInputFilter.h"
#include "OutputByOrbit.h" #include "OutputByOrbit.h"
#include "OutputBySize.h" #include "OutputBySize.h"
#include "TcpInputFilter.h"
#include "WZDmaInputFilter.h" #include "WZDmaInputFilter.h"
#include "config.h" #include "config.h"
#include "controls.h" #include "controls.h"
...@@ -40,6 +41,8 @@ int run_pipeline(int nbThreads, ctrl &control, config &conf) { ...@@ -40,6 +41,8 @@ int run_pipeline(int nbThreads, ctrl &control, config &conf) {
size_t packetBufferSize = conf.getDmaPacketBufferSize(); size_t packetBufferSize = conf.getDmaPacketBufferSize();
size_t nbPacketBuffers = conf.getNumberOfDmaPacketBuffers(); size_t nbPacketBuffers = conf.getNumberOfDmaPacketBuffers();
uint32_t prescaleFactor = conf.getPrescaleFactor(); uint32_t prescaleFactor = conf.getPrescaleFactor();
uint32_t tcpDestPort = conf.getTcpDestPort();
// Create empty input reader, will assign later when we know what is the data // Create empty input reader, will assign later when we know what is the data
// source // source
std::shared_ptr<InputFilter> input_filter; std::shared_ptr<InputFilter> input_filter;
...@@ -67,6 +70,18 @@ int run_pipeline(int nbThreads, ctrl &control, config &conf) { ...@@ -67,6 +70,18 @@ int run_pipeline(int nbThreads, ctrl &control, config &conf) {
// create MicronDmaInputFilter reader // create MicronDmaInputFilter reader
input_filter = input_filter =
std::make_shared<MicronDmaInputFilter>(packetBufferSize, nbPacketBuffers, control, conf); std::make_shared<MicronDmaInputFilter>(packetBufferSize, nbPacketBuffers, control, conf);
} else if (input == config::InputType::TCPIP) {
// create TcpInputFilter reader
if (conf.getDev_TCPAutoReconnectOnFailure()) {
input_filter =
std::make_shared<TcpInputFilter>(tcpDestPort, packetBufferSize, nbPacketBuffers,
conf.getNOrbitsPerPacket(), control, conf);
} else {
throw std::invalid_argument(
"Configuration error: enable developmentMode to use TCP input filter");
}
} else { } else {
throw std::invalid_argument("Configuration error: Unknown input type was specified"); throw std::invalid_argument("Configuration error: Unknown input type was specified");
} }
...@@ -77,7 +92,7 @@ int run_pipeline(int nbThreads, ctrl &control, config &conf) { ...@@ -77,7 +92,7 @@ int run_pipeline(int nbThreads, ctrl &control, config &conf) {
// Create reformatter and add it to the pipeline // Create reformatter and add it to the pipeline
// TODO: Created here so we are not subject of scoping, fix later... // TODO: Created here so we are not subject of scoping, fix later...
StreamProcessor stream_processor(packetBufferSize, conf.getDoZS(), conf.getProcessorType(), StreamProcessor stream_processor(packetBufferSize, conf.getDoZS(), conf.getProcessorType(),
conf.getNOrbitsPerDMAPacket(), prescaleFactor, conf.getNOrbitsPerPacket(), prescaleFactor,
conf.getCMSSWHeaders(), conf.getSourceID(), control); conf.getCMSSWHeaders(), conf.getSourceID(), control);
if (conf.getEnableStreamProcessor()) { if (conf.getEnableStreamProcessor()) {
pipeline.add_filter(stream_processor); pipeline.add_filter(stream_processor);
...@@ -158,7 +173,7 @@ int main(int argc, char *argv[]) { ...@@ -158,7 +173,7 @@ int main(int argc, char *argv[]) {
control.packets_per_report = conf.getPacketsPerReport(); control.packets_per_report = conf.getPacketsPerReport();
control.output_force_write = conf.getOutputForceWrite(); control.output_force_write = conf.getOutputForceWrite();
control.verbosity = conf.getVerbosity(); control.verbosity = conf.getVerbosity();
control.n_orbits_per_dma_packet = conf.getNOrbitsPerDMAPacket(); control.n_orbits_per_packet = conf.getNOrbitsPerPacket();
// Firmware needs at least 1MB buffer for DMA // Firmware needs at least 1MB buffer for DMA
if (conf.getDmaPacketBufferSize() < 1024 * 1024) { if (conf.getDmaPacketBufferSize() < 1024 * 1024) {
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
# "dma" for XILINX DMA driver # "dma" for XILINX DMA driver
# "filedma" for reading from file and simulating DMA # "filedma" for reading from file and simulating DMA
# "micronDMA" for PICO driver # "micronDMA" for PICO driver
# "tcpip" for TCP/IP input receving
# #
input:filedma input:filedma
...@@ -27,7 +28,7 @@ dma_number_of_packet_buffers:1000 ...@@ -27,7 +28,7 @@ dma_number_of_packet_buffers:1000
packets_per_report:2000 packets_per_report:2000
# number of orbits per DMA packet, in decimal # number of orbits per DMA packet, in decimal
NOrbitsPerDMAPacket:1 nOrbitsPerPacket:1
# prescale that will be used for *calo* data only # prescale that will be used for *calo* data only
prescale_factor:1 prescale_factor:1
...@@ -37,6 +38,9 @@ prescale_factor:1 ...@@ -37,6 +38,9 @@ prescale_factor:1
#input_file:/dev/shm/testdata.bin #input_file:/dev/shm/testdata.bin
input_file:test/data/calo_testfile.dat input_file:test/data/calo_testfile.dat
## Extra settings for "tcpip" input
tcpDestPort:10000
################################################################################ ################################################################################
## ##
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
# "dma" for XILINX DMA driver # "dma" for XILINX DMA driver
# "filedma" for reading from file and simulating DMA # "filedma" for reading from file and simulating DMA
# "micronDMA" for PICO driver # "micronDMA" for PICO driver
# "tcpip" for TCP/IP input receving
# #
input:filedma input:filedma
...@@ -27,7 +28,7 @@ dma_number_of_packet_buffers:1000 ...@@ -27,7 +28,7 @@ dma_number_of_packet_buffers:1000
packets_per_report:2000 packets_per_report:2000
# number of orbits per DMA packet, in decimal # number of orbits per DMA packet, in decimal
NOrbitsPerDMAPacket:1 nOrbitsPerPacket:1
# prescale that will be used for *calo* data only # prescale that will be used for *calo* data only
prescale_factor:1 prescale_factor:1
...@@ -37,6 +38,9 @@ prescale_factor:1 ...@@ -37,6 +38,9 @@ prescale_factor:1
#input_file:/dev/shm/testdata.bin #input_file:/dev/shm/testdata.bin
input_file:test/data/calo_testfile.dat input_file:test/data/calo_testfile.dat
## Extra settings for "tcpip" input
tcpDestPort:10000
################################################################################ ################################################################################
## ##
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
# "dma" for XILINX DMA driver # "dma" for XILINX DMA driver
# "filedma" for reading from file and simulating DMA # "filedma" for reading from file and simulating DMA
# "micronDMA" for PICO driver # "micronDMA" for PICO driver
# "tcpip" for TCP/IP input receving
# #
input:filedma input:filedma
...@@ -27,7 +28,7 @@ dma_number_of_packet_buffers:1000 ...@@ -27,7 +28,7 @@ dma_number_of_packet_buffers:1000
packets_per_report:2000 packets_per_report:2000
# number of orbits per DMA packet, in decimal # number of orbits per DMA packet, in decimal
NOrbitsPerDMAPacket:5 nOrbitsPerPacket:5
# prescale factor applied to *calo* data only # prescale factor applied to *calo* data only
prescale_factor:1 prescale_factor:1
...@@ -37,6 +38,9 @@ prescale_factor:1 ...@@ -37,6 +38,9 @@ prescale_factor:1
#input_file:/dev/shm/testdata.bin #input_file:/dev/shm/testdata.bin
input_file:test/data/gmt_testfile.dat input_file:test/data/gmt_testfile.dat
## Extra settings for "tcpip" input
tcpDestPort:10000
################################################################################ ################################################################################
## ##
## Stream processor settings ## Stream processor settings
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
# "dma" for XILINX DMA driver # "dma" for XILINX DMA driver
# "filedma" for reading from file and simulating DMA # "filedma" for reading from file and simulating DMA
# "micronDMA" for PICO driver # "micronDMA" for PICO driver
# "tcpip" for TCP/IP input receving
# #
input:filedma input:filedma
...@@ -27,7 +28,7 @@ dma_number_of_packet_buffers:1000 ...@@ -27,7 +28,7 @@ dma_number_of_packet_buffers:1000
packets_per_report:2000 packets_per_report:2000
# number of orbits per DMA packet, in decimal # number of orbits per DMA packet, in decimal
NOrbitsPerDMAPacket:5 nOrbitsPerPacket:5
# prescale factor applied to *calo* data only # prescale factor applied to *calo* data only
prescale_factor:1 prescale_factor:1
...@@ -37,6 +38,9 @@ prescale_factor:1 ...@@ -37,6 +38,9 @@ prescale_factor:1
#input_file:/dev/shm/testdata.bin #input_file:/dev/shm/testdata.bin
input_file:test/data/gmt_testfile.dat input_file:test/data/gmt_testfile.dat
## Extra settings for "tcpip" input
tcpDestPort:10000
################################################################################ ################################################################################
## ##
## Stream processor settings ## Stream processor settings
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
# "dma" for XILINX DMA driver # "dma" for XILINX DMA driver
# "filedma" for reading from file and simulating DMA # "filedma" for reading from file and simulating DMA
# "micronDMA" for PICO driver # "micronDMA" for PICO driver
# "tcpip" for TCP/IP input receving
# #
input:micronDMA input:micronDMA
...@@ -27,7 +28,7 @@ dma_number_of_packet_buffers:1000 ...@@ -27,7 +28,7 @@ dma_number_of_packet_buffers:1000
packets_per_report:1 packets_per_report:1
# number of orbits per DMA packet, in decimal # number of orbits per DMA packet, in decimal
NOrbitsPerDMAPacket:20 nOrbitsPerPacket:20
# prescale factor applied to *calo* data only # prescale factor applied to *calo* data only
prescale_factor:20 prescale_factor:20
...@@ -37,6 +38,9 @@ prescale_factor:20 ...@@ -37,6 +38,9 @@ prescale_factor:20
#input_file:/dev/shm/testdata.bin #input_file:/dev/shm/testdata.bin
input_file:test/data/gmt_testfile.dat input_file:test/data/gmt_testfile.dat
## Extra settings for "tcpip" input
tcpDestPort:10000
################################################################################ ################################################################################
## ##
## Stream processor settings ## Stream processor settings
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment