Skip to content
Snippets Groups Projects
Commit c000c6d3 authored by Erik von Reis's avatar Erik von Reis
Browse files

awgtpman, mbuf_probe: added testpoint config table to mbuf_probe.

parent 9b02db61
No related branches found
No related tags found
1 merge request!227mbuf_probe, awgtpman, fron end: new testpoint mbuf added
......@@ -7,7 +7,8 @@ add_executable(mbuf_probe
analyze_rmipc.cc
analyze_awg_data.cc
analyze_header.cc
check_size.cc)
check_size.cc
analyze_tp_cfg.cpp)
target_include_directories(mbuf_probe PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/..
${CMAKE_CURRENT_SOURCE_DIR}/../../include
......
......@@ -28,6 +28,9 @@ namespace analyze
detected_type = MBUF_AWG_DATA;
cout << "Detected AWG_DATA struct ";
break;
case TESTPOINT_CFG_ID:
detected_type = MBUF_TP_CFG;
cout << "Detected TESTPOINT_CFG struct ";
}
}
else
......
//
// Created by erik.vonreis on 5/20/21.
//
#include <iostream>
#include "analyze_tp_cfg.hh"
#include "shmem_testpoint.h"
#include "analyze_header.hh"
using namespace std;
namespace analyze
{
#define PRINTVAL(X) printf(#X " = %d\n", X);
static void dump_tp_cfg(volatile TESTPOINT_CFG *tp_cfg)
{
auto detected_type = analyze_header(tp_cfg);
if(detected_type != MBUF_TP_CFG)
{
cout << "WARNING: attempting to analyze AWG_DATA structure, but structure was of type " << detected_type << endl;
}
PRINTVAL(sizeof(TESTPOINT_CFG));
for(;;)
{
cout << "ex:";
for(int i=0; i<4; ++i)
{
cout << " " << tp_cfg->excitations[i];
}
cout << endl;
cout << "tp:";
for(int i=0; i<4; ++i)
{
cout << " " << tp_cfg->testpoints[i];
}
cout << endl;
cout << "ew:";
for(int i=0; i<4; ++i)
{
cout << " " << tp_cfg->excitations_writeback[i];
}
cout << endl;
cout << "tw:";
for(int i=0; i<4; ++i)
{
cout << " " << tp_cfg->testpoints_writeback[i];
}
cout << endl;
usleep(2000);
}
}
void analyze_tp_cfg( volatile void* buffer,
std::size_t size,
const ConfigOpts& options )
{
dump_tp_cfg(
reinterpret_cast<volatile TESTPOINT_CFG *>(buffer)
);
}
}
\ No newline at end of file
//
// Created by erik.vonreis on 5/20/21.
//
#ifndef DAQD_TRUNK_ANALYZE_TP_CFG_HH
#define DAQD_TRUNK_ANALYZE_TP_CFG_HH
#include <cstddef>
#include "mbuf_probe.hh"
namespace analyze
{
void analyze_tp_cfg( volatile void* buffer,
std::size_t size,
const ConfigOpts& options );
}
#endif // DAQD_TRUNK_ANALYZE_TP_CFG_HH
......@@ -28,6 +28,7 @@
#include "analyze_daq_multi_dc.hh"
#include "analyze_rmipc.hh"
#include "analyze_awg_data.hh"
#include "analyze_tp_cfg.hh"
#include "gap_check.hh"
#include "check_size.hh"
......@@ -75,6 +76,7 @@ usage( const char* progname )
std::cout
<< "\tdaq_multi_cycle Analyze the output of a streamer/local_dc\n";
std::cout << "\tAWG_DATA Analyze the data streaming from awg.\n";
std::cout << "\tTP_CFG Analyze the test point configuration shared memory.\n";
}
ConfigOpts
......@@ -98,6 +100,8 @@ parse_options( int argc, char* argv[] )
std::make_pair( "daq_multi_cycle", MBUF_DAQ_MULTI_DC ) );
struct_lookup.insert( std::make_pair( "awg_data", MBUF_AWG_DATA ) );
struct_lookup.insert( std::make_pair( "AWG_DATA", MBUF_AWG_DATA ) );
struct_lookup.insert( std::make_pair( "tp_cfg", MBUF_TP_CFG ) );
struct_lookup.insert( std::make_pair( "TP_CFG", MBUF_TP_CFG ) );
std::deque< std::string > args;
for ( int i = 1; i < argc; ++i )
......@@ -362,6 +366,9 @@ handle_analyze( const ConfigOpts& opts )
case MBUF_AWG_DATA:
analyze::analyze_awg_data( buffer, opts.buffer_size, opts );
break;
case MBUF_TP_CFG:
analyze::analyze_tp_cfg(buffer, opts.buffer_size, opts);
break;
case MBUF_INVALID:
default:
std::cout << "Unknown analysis type: " << opts.analysis_type
......
......@@ -36,6 +36,7 @@ enum MBufStructures
MBUF_RMIPC,
MBUF_DAQ_MULTI_DC,
MBUF_AWG_DATA,
MBUF_TP_CFG,
};
struct ConfigOpts
......
......@@ -309,7 +309,7 @@ CDS_HARDWARE cdsPciModules;
_exit(2);
}
if(!OpenTestpointCfgSharedMemory())
if(!OpenTestpointCfgSharedMemory(system_name))
{
fprintf(stderr, "Failed to open testpoint configuration shared memory.\n");
_exit(2);
......
......@@ -63,6 +63,6 @@ extern volatile TESTPOINT_CFG * shmemTestpointCfg;
* memory is mapped to global shmemTestpointCfg
* @return true if successful
*/
int OpenTestpointCfgSharedMemory();
int OpenTestpointCfgSharedMemory(const char *model_name);
#endif // DAQD_TRUNK_SHARED_MEMORY_H
......@@ -154,7 +154,7 @@ static char *versionId = "Version $Id$" ;
/* list of preselected testpoints */
testpoint_t preselect[TP_MAX_PRESELECT];
/* list of TP active TPs */
tpEntry_t indx[TP_MAX_INTERFACE][TP_MAX_INDEX];
tpEntry_t indx[TP_MAX_INTERFACE][DAQ_GDS_MAX_TP_NUM];
/* points directly into RM IPC area
rmIpcStr* ipc[TP_MAX_INTERFACE]; */
/* points directly into RM channel info area
......@@ -1113,14 +1113,21 @@ static char *versionId = "Version $Id$" ;
int addr; /* RM address of tp index */
t = (tainsec_t) time * _ONESEC + (tainsec_t) epoch * _EPOCH;
if (tpNode.valid)
{
MUTEX_GET (servermux);
/* loop over interfaces */
for (j = 0; j < TP_MAX_INTERFACE; j++) {
/* make index */
for (i = 0, size = 0; i < DAQ_GDS_MAX_TP_NUM; i++) {
if(tpNode.indx[j][i].id)
{
printf("setting interface %d node %d = %d\n",
j, i, tpNode.indx[j][i].id);
}
switch(j)
{
case TP_LSC_EX_INTERFACE:
......
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