Skip to content
Snippets Groups Projects
Commit 0a5128d7 authored by Pieter Donker's avatar Pieter Donker
Browse files

Bugid:335

Moved all files from MAC-RTC-6_0devel1 branch to the HEAD.
parent f4361bd9
No related branches found
No related tags found
No related merge requests found
SUBDIRS = src
DISTCHECK_CONFIGURE_FLAGS=\
--with-common=$(prefix) \
--with-gcfcommon=$(prefix) \
--with-gcftm=$(prefix) \
--with-rtccommon=$(prefix)
EXTRA_DIST = \
Makefile.common \
TBB_Protocol.spec \
autoconf_share/compiletool
include $(top_srcdir)/Makefile.common
# -*- Mode:rpm-spec -*-
# TBB_Protocol.spec.in
#
##############################################################################
#
# Preamble
#
##############################################################################
Summary:TBB_Protocol contains the library and headers necessary to communicate with the TBB board
%define release @RPM_RELEASE@
%define version @VERSION@
%define pkgname @PACKAGE@
%define pkgdir %{pkgname}-%{version}-%{release}
%define prefix /opt/lofar
%define configure_args @RPM_CONFIGURE_ARGS@
##define build_kernel_version @BUILD_KERNEL_VERSION@
Name: %{pkgname}
Version: %{version}
Release: %{release}
Copyright: LGPL
Group: Application/System
Source: %{pkgname}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{pkgdir}-root
URL: http://www.astron.nl
Prefix: %{prefix}
BuildArchitectures: i386 # Target platforms, i.e., i586
##Requires: Common = 1.2 ## define dependent packages here
Packager: %{packager}
Distribution: The LOFAR project
Vendor: ASTRON
AutoReqProv: no
%description
TBB_Protocol is a package containing the library and headers needed to communicate
with the TBBDriver. All events and any classes in the events are contained in the
library and header files.
##############################################################################
#
# prep
#
##############################################################################
%prep
echo $prefix
# create the build directory, untar the source
%setup
##############################################################################
#
# build
#
##############################################################################
%build
./configure %{configure_args} --prefix=%{prefix} && make
##############################################################################
#
# install
#
##############################################################################
%install
# To make things work with BUILDROOT
if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ]
then
echo
echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
echo @ @
echo @ RPM_BUILD_ROOT is not what I expected. Please clean it yourself. @
echo @ @
echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
echo
else
echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT"
rm -rf "$RPM_BUILD_ROOT"
fi
mkdir -p $RPM_BUILD_ROOT%{prefix}
make DESTDIR="$RPM_BUILD_ROOT" install
#uninstall
##############################################################################
#
# verify
#
##############################################################################
#verify
##############################################################################
#
# clean
#
##############################################################################
%clean
# Call me paranoid, but I do not want to be responsible for nuking
# someone's harddrive!
if [ "$RPM_BUILD_ROOT" != "%{_tmppath}/%{pkgdir}-root" ]
then
echo
echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
echo @ @
echo @ RPM_BUILD_ROOT is not what I expected. Please clean it yourself. @
echo @ @
echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
echo
else
echo Cleaning RPM_BUILD_ROOT: "$RPM_BUILD_ROOT"
rm -rf "$RPM_BUILD_ROOT"
fi
##############################################################################
#
# files
#
##############################################################################
# empty 'files' means all distributed files
%files
%defattr(-, root, root)
%{prefix}
# Your application file list goes here
# %{prefix}/lib/lib*.so*
# Documentation
# doc COPYING ChangeLog README AUTHORS NEWS
# doc doc/*
# link the module to the correct path
%post
# before uninstall
%preun
# after uninstall
%postun
##############################################################################
#
# package devel
#
##############################################################################
#package devel
#Summary: Development files for %{pkgname}
#Group: Applications/System
#description devel
#Development files for %{pkgname}.
#files devel
# Your development files go here
# Programmers documentation goes here
#doc doc
# end of file
#!/bin/sh
../../../../autoconf_share/bootstrap ../../../../autoconf_share
dnl
dnl Process this file with autoconf to produce a configure script.
dnl
AC_INIT
dnl AC_CONFIG_AUX_DIR(config)
dnl AM_CONFIG_HEADER(config/config.h)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(TBB_Protocol, 1.0, no-define)
dnl Initialize for LOFAR (may set compilers)
lofar_INIT
dnl Checks for programs.
AC_PROG_AWK
AC_PROG_YACC
AC_PROG_CC
AC_PROG_CXX
AM_PROG_LEX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_DISABLE_SHARED
AC_PROG_LIBTOOL
dnl Checks for libraries.
dnl dnl Replace `main' with a function in -lfl:
dnl AC_CHECK_LIB(fl, main)
dnl dnl Replace `main' with a function in -lcosev_r:
dnl AC_CHECK_LIB(cosev_r, main)
dnl dnl Replace `main' with a function in -lcosnm_r:
dnl AC_CHECK_LIB(cosnm_r, main)
dnl dnl Replace `main' with a function in -lorb_r:
dnl AC_CHECK_LIB(orb_r, main)
dnl dnl Replace `main' with a function in -lpthread:
dnl AC_CHECK_LIB(pthread, main)
dnl dnl Replace `main' with a function in -lvport_r:
dnl AC_CHECK_LIB(vport_r, main)
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
dnl Checks for library functions.
AC_FUNC_VPRINTF
dnl
dnl Check for LOFAR specific things
dnl
lofar_GENERAL
lofar_BLITZ
dnl lofar_MPI
lofar_INTERNAL(LCS/Common, common, LCS-Common-3_0, 1, Common/LofarTypes.h,,)
lofar_INTERNAL(MAC/GCF/TM, GCFTM, MAC-GCF-6_1rc2, 1, GCF/TM/GCF_Control.h,,)
lofar_INTERNAL(MAC/APL/RTCCommon, RTCCommon, MAC-RTC-6_0devel1, 1, APL/RTCCommon/Marshalling.h,,)
dnl
dnl Output Makefiles
dnl
AC_OUTPUT(
include/Makefile
include/APL/Makefile
dnl include/APL/TP_Protocol/Makefile
src/Makefile
Makefile
TBB_Protocol.spec
)
AM_CPPFLAGS = \
-I$(top_builddir)/include
AUTOGEN = autogen
SUFFIXES = .ph
%.cc: %.prot
$(AUTOGEN) --writable -L $(datadir)/GCF/TM $<
cp $*.ph $(top_builddir)/include/APL/TBB_Protocol
%.ph: %.prot
$(AUTOGEN) --writable -L $(datadir)/GCF/TM $<
cp $*.ph $(top_builddir)/include/APL/TBB_Protocol
EXTRA_DIST = \
TBB_Protocol.prot\
TP_Protocol.prot
BUILT_SOURCES = \
TBB_Protocol.ph\
TBB_Protocol.cc\
TP_Protocol.ph \
TP_Protocol.cc
pkgincludedir=$(includedir)/APL/TBB_Protocol
pkginclude_HEADERS = \
$(BUILT_SOURCES)
lib_LTLIBRARIES = libtbb_protocol.la
libtbb_protocol_la_SOURCES = \
$(BUILT_SOURCES)
clean-local:
rm -f *.ph
include $(top_srcdir)/Makefile.common
// -*- mode: c++ -*-//
// Protocol definition for the TBB driver
//
autogen definitions protocol;
description = "Protocol for the TBB driver interface";
prefix = "TBB"; // for the signal names
id = "(LOFAR::GCF::TM::F_APL_PROTOCOL+22)"; // !! look if 22 is still available
// specify extra include files
// e.g.
include = '<sys/time.h>';
include = '<linux/types.h>';
include = '<bitset>';
include = '<Common/LofarTypes.h>';
include = '<APL/RTCCommon/Timestamp.h>';
prelude = << PRELUDE_END
static const int MAX_N_TBBBOARDS = 12;
static const int SUCCESS = 1;
static const int FAILURE = 0;
typedef class TBBVersion
{
uint32 boardid;
uint32 swversion;
uint32 boardversion;
uint32 tp_version;
uint32 mp_version[4];
};
PRELUDE_END;
//
// An "event" has a "signal" and a "dir" (direction)
// and zero or more "param"s.
// "dir" can be one of "IN" or "OUT".
// A "param" has a "name" and a "type".
// Userdefine types are
//
//
// info about status type
//
// type uint32 (4 bytes)
//
// bit0 = 1, SUCCESS, all boards have responded
// = 0, FAILURE, one of the boards is not responding
//
// bit16 = bit0 and bit31 = bit15 from tbbmask
// bit16 .. bit31, = 1, if board response was OK
// = 0, if board response was not ok
//
//
// if boardid = 0 is returnd, then the board was not on this driver
//
// TBB events
// data recording
event = {
signal = ALLOC;
dir = IN;
param = {
name = "tbbmask";
type = "uint32";
};
param = {
name = "channel";
type = "uint32";
};
param = {
name = "pageaddr";
type = "uint32";
};
param = {
name = "pagelength";
type = "uint32";
};
};
event = {
signal = ALLOCACK;
dir = OUT;
param = {
name = "status";
type = "uint32";
};
};
event = {
signal = FREE;
dir = IN;
param = {
name = "tbbmask";
type = "uint32";
};
param = {
name = "channel";
type = "uint32";
};
};
event = {
signal = FREEACK;
dir = OUT;
param = {
name = "status";
type = "uint32";
};
};
event = {
signal = RECORD;
dir = IN;
param = {
name = "tbbmask";
type = "uint32";
};
param = {
name = "channel";
type = "uint32";
};
};
event = {
signal = RECORDACK;
dir = OUT;
param = {
name = "status";
type = "uint32";
};
};
event = {
signal = STOP;
dir = IN;
param = {
name = "tbbmask";
type = "uint32";
};
param = {
name = "channel";
type = "uint32";
};
};
event = {
signal = STOPACK;
dir = OUT;
param = {
name = "status";
type = "uint32";
};
};
// Triggering
event = {
signal = TRIGGER;
dir = OUT;
param = {
name = "tbbmask";
type = "uint32";
};
param = {
name = "channel";
type = "uint32";
};
param = {
name = "time";
type = "uint32";
};
param = {
name = "sample";
type = "uint32";
};
};
event = {
signal = TRIGGERACK;
dir = IN;
param = {
name = "status";
type = "uint32";
};
};
event = {
signal = TRIGCLR;
dir = IN;
param = {
name = "tbbmask";
type = "uint32";
};
param = {
name = "channel";
type = "uint32";
};
};
event = {
signal = TRIGCLRACK;
dir = OUT;
param = {
name = "status";
type = "uint32";
};
};
// Data reading
event = {
signal = READ;
dir = IN;
param = {
name = "tbbmask";
type = "uint32";
};
param = {
name = "channel";
type = "uint32";
};
param = {
name = "time";
type = "uint32";
};
param = {
name = "period";
type = "uint32";
};
};
event = {
signal = READACK;
dir = OUT;
param = {
name = "status";
type = "uint32";
};
};
event = {
signal = UDP;
dir = IN;
param = {
name = "tbbmask";
type = "uint32";
};
param = {
name = "udp";
type = "uint32[2]";
};
param = {
name = "ip";
type = "uint32[5]";
};
param = {
name = "mac";
type = "uint32[2]";
};
};
event = {
signal = UDPACK;
dir = OUT;
param = {
name = "status";
type = "uint32";
};
};
// Operation and Maintenance
// Board information
event = {
signal = VERSION;
dir = IN;
param = {
name = "tbbmask";
type = "uint32";
};
};
event = {
signal = VERSIONACK;
dir = OUT;
param = {
name = "status";
type = "uint32";
};
param = {
name = "tbbversion";
type = "TBBVersion[MAX_N_TBBBOARDS]";
};
};
event = {
signal = SIZE;
dir = IN;
param = {
name = "tbbmask";
type = "uint32";
};
};
event = {
signal = SIZEACK;
dir = OUT;
param = {
name = "status";
type = "uint32";
};
param = {
name = "size";
type = "uint32[MAX_N_TBBBOARDS]";
};
};
// Board status
event = {
signal = ERROR;
dir = OUT;
param = {
name = "code";
type = "uint32";
};
};
event = {
signal = ERRORACK;
dir = IN;
param = {
name = "status";
type = "uint32";
};
};
// Board control
event = {
signal = CLEAR;
dir = IN;
param = {
name = "tbbmask";
type = "uint32";
};
};
event = {
signal = CLEARACK;
dir = OUT;
param = {
name = "status";
type = "uint32";
};
};
event = {
signal = RESET;
dir = IN;
param = {
name = "tbbmask";
type = "uint32";
};
};
event = {
signal = RESETACK;
dir = OUT;
param = {
name = "status";
type = "uint32";
};
};
event = {
signal = CONFIG;
dir = IN;
param = {
name = "tbbmask";
type = "uint32";
};
param = {
name = "image";
type = "uint32";
};
};
event = {
signal = CONFIGACK;
dir = OUT;
param = {
name = "status";
type = "uint32";
};
};
// Remote system update
event = {
signal = ERASEF;
dir = IN;
param = {
name = "boardid";
type = "uint32";
};
param = {
name = "addr";
type = "uint32";
};
};
event = {
signal = ERASEFACK;
dir = OUT;
param = {
name = "boardid";
type = "uint32";
};
param = {
name = "status";
type = "uint32";
};
};
event = {
signal = READF;
dir = IN;
param = {
name = "boardid";
type = "uint32";
};
param = {
name = "addr";
type = "uint32";
};
};
event = {
signal = READFACK;
dir = OUT;
param = {
name = "boardid";
type = "uint32";
};
param = {
name = "addr";
type = "uint32";
};
param = {
name = "data";
type = "uint32[256]";
};
};
event = {
signal = WRITEF;
dir = IN;
param = {
name = "boardid";
type = "uint32";
};
param = {
name = "addr";
type = "uint32";
};
param = {
name = "data";
type = "uint32[256]";
};
};
event = {
signal = WRITEFACK;
dir = OUT;
param = {
name = "boardid";
type = "uint32";
};
param = {
name = "status";
type = "uint32";
};
};
// DDR2 Access
event = {
signal = READW;
dir = IN;
param = {
name = "boardid";
type = "uint32";
};
param = {
name = "mp";
type = "uint32";
};
param = {
name = "addr";
type = "uint32";
};
};
event = {
signal = READWACK;
dir = OUT;
param = {
name = "boardid";
type = "uint32";
};
param = {
name = "mp";
type = "uint32";
};
param = {
name = "addr";
type = "uint32";
};
param = {
name = "wordlo";
type = "uint32";
};
param = {
name = "wordhi";
type = "uint32";
};
};
event = {
signal = WRITEW;
dir = IN;
param = {
name = "boardid";
type = "uint32";
};
param = {
name = "mp";
type = "uint32";
};
param = {
name = "addr";
type = "uint32";
};
param = {
name = "wordlo";
type = "uint32";
};
param = {
name = "wordhi";
type = "uint32";
};};
event = {
signal = WRITEWACK;
dir = OUT;
param = {
name = "boardid";
type = "uint32";
};
param = {
name = "status";
type = "uint32";
};
};
// -*- mode: c++ -*-//
// Protocol definition for the TBB board driver
//
autogen definitions protocol;
description = "Protocol for the TBB driver interface";
prefix = "TP"; // for the signal names
id = "(LOFAR::GCF::TM::F_APL_PROTOCOL+21)"; // !! look if 21 is still available
// specify extra include files
// e.g.
include = '<sys/time.h>';
include = '<linux/types.h>';
include = '<bitset>';
include = '<Common/LofarTypes.h>';
include = '<APL/RTCCommon/Timestamp.h>';
prelude = << PRELUDE_END
static const int MAX_N_TBBBOARDS = 12;
static const int SUCCESS = 1;
static const int FAILURE = 0;
PRELUDE_END;
//
// An "event" has a "signal" and a "dir" (direction)
// and zero or more "param"s.
// "dir" can be one of "IN" or "OUT".
// A "param" has a "name" and a "type".
// Userdefine types are
//
//
// TP events
//
// data recording
event = {
noheader;
signal = ALLOC;
dir = INOUT;
param = {
name = "opcode";
type = "uint32";
};
param = {
name = "channel";
type = "uint32";
};
param = {
name = "pageaddr";
type = "uint32";
};
param = {
name = "pagelength";
type = "uint32";
};
};
event = {
noheader;
signal = FREE;
dir = INOUT;
param = {
name = "opcode";
type = "uint32";
};
param = {
name = "channel";
type = "uint32";
};
};
event = {
noheader;
signal = RECORD;
dir = INOUT;
param = {
name = "opcode";
type = "uint32";
};
param = {
name = "channel";
type = "uint32";
};
};
event = {
noheader;
signal = STOP;
dir = INOUT;
param = {
name = "opcode";
type = "uint32";
};
param = {
name = "channel";
type = "uint32";
};
};
// Triggering
event = {
noheader;
signal = TRIGGER;
dir = INOUT;
param = {
name = "opcode";
type = "uint32";
};
param = {
name = "channel";
type = "uint32";
};
param = {
name = "time";
type = "uint32";
};
param = {
name = "sample";
type = "uint32";
};
};
event = {
noheader;
signal = TRIGCLR;
dir = INOUT;
param = {
name = "opcode";
type = "uint32";
};
param = {
name = "channel";
type = "uint32";
};
};
// Data reading
event = {
noheader;
signal = READ;
dir = INOUT;
param = {
name = "opcode";
type = "uint32";
};
param = {
name = "channel";
type = "uint32";
};
param = {
name = "time";
type = "uint32";
};
param = {
name = "period";
type = "uint32";
};
};
event = {
noheader;
signal = UDP;
dir = INOUT;
param = {
name = "opcode";
type = "uint32";
};
param = {
name = "udp";
type = "uint32[2]";
};
param = {
name = "ip";
type = "uint32[5]";
};
param = {
name = "mac";
type = "uint32[2]";
};
};
// Operation and Maintenance
// Board information
event = {
noheader;
signal = VERSION;
dir = INOUT;
param = {
name = "opcode";
type = "uint32";
};
param = {
name = "boardid";
type = "uint32";
};
param = {
name = "swversion";
type = "uint32";
};
param = {
name = "boardvertsion";
type = "uint32";
};
param = {
name = "tp_version";
type = "uint32";
};
param = {
name = "mp_version";
type = "uint32[4]";
};
};
event = {
noheader;
signal = SIZE;
dir = INOUT;
param = {
name = "opcode";
type = "uint32";
};
param = {
name = "size";
type = "uint32";
};
};
// Board status
event = {
noheader;
signal = ERROR;
dir = INOUT;
param = {
name = "opcode";
type = "uint32";
};
param = {
name = "code";
type = "uint32";
};
};
// Board control
event = {
noheader;
signal = CLEAR;
dir = INOUT;
param = {
name = "opcode";
type = "uint32";
};
};
event = {
noheader;
signal = RESET;
dir = INOUT;
param = {
name = "opcode";
type = "uint32";
};
};
event = {
noheader;
signal = CONFIG;
dir = INOUT;
param = {
name = "opcode";
type = "uint32";
};
param = {
name = "image";
type = "uint32";
};
};
// Remote system update
event = {
noheader;
signal = ERASEF;
dir = INOUT;
param = {
name = "opcode";
type = "uint32";
};
param = {
name = "addr";
type = "uint32";
};
};
event = {
noheader;
signal = READF;
dir = INOUT;
param = {
name = "opcode";
type = "uint32";
};
param = {
name = "addr";
type = "uint32";
};
param = {
name = "data";
type = "uint32[256]";
};
};
event = {
noheader;
signal = WRITEF;
dir = INOUT;
param = {
name = "opcode";
type = "uint32";
};
param = {
name = "addr";
type = "uint32";
};
param = {
name = "data";
type = "uint32[256]";
};
};
// DDR2 Access
event = {
noheader;
signal = READW;
dir = INOUT;
param = {
name = "opcode";
type = "uint32";
};
param = {
name = "mp";
type = "uint32";
};
param = {
name = "addr";
type = "uint32";
};
param = {
name = "wordlo";
type = "uint32";
};
param = {
name = "wordhi";
type = "uint32";
};
};
event = {
noheader;
signal = WRITEW;
dir = INOUT;
param = {
name = "opcode";
type = "uint32";
};
param = {
name = "mp";
type = "uint32";
};
param = {
name = "addr";
type = "uint32";
};
param = {
name = "wordlo";
type = "uint32";
};
param = {
name = "wordhi";
type = "uint32";
};
};
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