NRAO Home  >  Green Bank  |  Wiki Topic:    GB > Software > PlanOfRecordC32007 > ModificationRequest1C307
   Changes | Index | Contents | Search | Statistics | Go

Port Holography Backend Software

Modification Request #1 (C3, 2007)



1. Introduction

The holography backend was originally deployed years ago on a VxWorks system with an MCB interface. The system was limited to 200 ms dumps due to the combination of the VxWorks OS and the MCB interface. We need the backend to dump much faster in order to properly map the GBT's panels. As prelude to this enhancement (ModificationRequest12C507), the VxWorks based Holography manager software must be ported to run on the Linux platform.

2. Background

Back in the day, the Holography backend was connected to gbtaio1, a 68040 VxWorks single-board. This worked fairly well for slow dumps, but was the limiting factor in trying to do holography on the telescope panels. We are in the process of replacing this MCB interface with a parallel interface based on an off-the-shelf parallel interface card. The card will allow the backend to dump in less than 20 milliseconds, providing the order of magnitude increase in speed needed. The parallel card will be plugged into a Linux box co-located in the receiver room shielded rack with the backend. However, prior to this interface upgrade, a lateral upgrade must first be made; that is, porting the Holography manager software from VxWorks to the Linux platform, retaining the existing MCB interface. Holography manager software must also be modified to align it with current M&C manager software practices and system architecture.

3. Requirements

Requirements for this MR are fairly straightforward. A new host platform and operating system is required. No new manager parameters or sampler values will be needed; that is, the external interface to the M&C system will remain unchanged. It is not a requirement to maintain compatibility with the VxWorks platform.

Initial time-line requirement for completion of this MR is 01 August 2007.

4. Design

The Holography backend manager will be ported and the MCB interface retained. Porting will be accomplished in a series of stages; however, only the final product will be released. The port will involve a redesign to abstract the hardware interface, a merging of the FITS writing server (HoloServer) into a local FITS writer class, and a refactoring to replace the VxWorks task control and synchronization primitives with pthread or RTAI based replacements.

A hardware abstraction layer/class will define logical/functional methods for the manager to interact with, independent from the actual hardware interface. For example, setAttenuatorLevel(x) will be implemented by the hardware abstraction as a write call to the specific hardware via its abstracted interface. The MCB interface uses a busy-wait poll while waiting for data.

The data flow out of the backend will be managed by the hardware abstraction. When new data is available, the software will read the data through a MCB or PIO port and timestamp the data. A callback will be made to the manager, to indicate new data is available. The manager will then determine if the data is to be written, and if so the data will be sent to the FITS writer class for writing into a FITS file.

4.1 Hardware Architecture

The only change to the hardware architecture required to satisfy this MR is substitution of the VxWorks computer system with an RTAI "shoebox" computer system. This new RTAI Linux system will be an additional computer to be controlled by the TaskMaster system.

4.2 Software Architecture

The software architecture will be similar in nature to other M&C managers. Device functionality is encapsulated by the HolographyDevice class, which employs a "has-a" relationship with a device interface class such as the SIB or DIO driver (Modelled after the adapter/bridge patterns). The encapsulation should include a mechanism for simulation. Backend data is recorded by the HolographyFits writer class. At the core is the Holography manager, which ties everything together and provides an implementation of the device's parameter set.

Software Architecture
Holography_Diagrams_PortedDesign_TopLevel_r1.jpg
Figure 1

A number of items in the current code require rework, to bring into line with current M&C manager practices and design. These items include:

4.3 Software Code Modules

4.3.1 Hardware Abstraction Class

The hardware interface class (HolographyDevice) defines the following logical methods for interacting with the hardware. The implementation of the hardware interface will be controlled by values in a configuration file.

Each of these methods is described below:

set_starttime(TimeStamp&)
This method informs the hardware interface that data acquisition should begin at the time specified. If the specified time is zero, then the data acquisition should begin as soon as practicable.
reset()
This method will end data acquisition, and reset the hardware to a known quiescent state.
init_data_callback()
This method is used to setup the callback to a manager method, which will handle the incoming data. The manager method callback should take a single HolographyData parameter. Note that this method once registered will be called even after the scan stop-time is reached, until a reset() is called.
init_error_callback()
This method is used to setup the callback to a manager method, which will handle the errors from the Holography backend. The manager method callback should take a single HolographyError parameter.
set_integration_time(float)
This method sets the hardware integration time in seconds. The value must be in multiples of TBD. If a value cannot be exactly set, the value will be rounded to the nearest possible value.
set_cycles_per_integration(int)
This method set the number of integrations to be accumulated in the hardware before being read.
set_attenuator_level(float)
This method sets the attenuator level for the main signal (also designated as the 'test' signal). Possible values are: TBD If an intermediate value is given, the value will be rounded to the nearest legal value.
set_reference_attenuator_level(float)
This method sets the attenuator level for the reference signal. Possible values are TBD. If an intermediate value is given, the value will be rounded to the nearest legal value.

Typical manager-hardware interface class will be as follows:

  1. Construct the HolographyDevice
  2. Setup data and error callbacks by calling init_data_callback() and init_error_callback()
  3. From the manager parameter activate methods, set the corresponding values. (e.g. set_cycles_per_integration() .)
  4. From the manager's doActivate() method, call set_starttime() with the activated starttime.
  5. Handle data callbacks as data arrives.
  6. Handle error conditions when the error callback occurs.
  7. Call reset() to end data acquisition.
  8. Repeat 3-7 as necessary.
  9. Destruct HolographyDevice Object. (This will call reset() prior to deletion.)

4.3.2 The FITS Writer Class

The current VxWorks-based system uses an obsolete FITS writing class, in a solaris based server. The original motivation behind the client-server architecture for writing FITS files was primarily due to concerns about VxWorks's handling of file I/O. The ported version of the holography manager will use a FITS writing class based upon our standard M&C FitsIO class and the cfitsio library from NASA. The system will be further simplified by eliminating the FITS server, and instead using a local instance writer. The FITS output format will remain compatible with current data reduction scripts as much as possible. A list of the minor changes is available in the updated Holography FITS data documentation.

There has been some discussion about the addition of a few new data table columns. The addition should have minimal or no impact on the implementation.

The class interface consists of the following methods:

set_periods_per_integration(int)
Sets the value for the NCYCLE header keyword.
set_period_length(double)
Sets the value for the DURATION keyword.
set_integration_time(double)
Sets the value for the CYCLETIME keyword.
set_start_time(TimeStamp const &)
Sets the start-time. This method must be called prior to the open() method, as the value is used for the file name.
set_scan_number(int)
Sets the value for the SCAN keyword.
set_project_id(String const &)
Sets the value for the PROJID header keyword. This method must becalled prior to the open() method, as the value is used for the file name.
set_scan_id(String const &)
Sets the value for the OBSID keyword.
set_source_id(String const &)
Sets the value for the OBJECT keyword.
set_test_attenuation(int)
Sets the value for the TESTATTN keyword. The value is in db of attenuation.
set_ref_attenuation(int)
Sets the value for the REFATTN keyword. The value is in db of attenuation.
open()
Causes the writer to open a new file based on the current settings of starttime, and project_id.
write(HolographyData &)
This method queues a row of data to be written to the FITS file. If the file is not currently open, the data is ignored.
close()
Closes an open FITS file.

Typical manager-FITS writer interactions will be:

  1. Construct the HolographyFits object.
  2. In each parameter's check method, if the check passes, call the corresponding set method. For the manager base class parameters, call the set method from the associated activate method. (e.g. activateStartTime(), activateProjectId(), activateScanLength(), activateSource activateNextScanNumber() and so on.)
  3. Call the method open() from the manager's doActivate() method, after the call to the Manager::doActivate(). Note: open() should be called only if the starttime is non-zero, this indicates a scan is starting.
  4. Call write() when data is available to write to the file.
  5. Call close() from the doComplete() method.
  6. Repeat steps 2-5 for every scan.
  7. Destruct the HolographyFits object. This will automatically call the close() method if a file is open.

4.3.3 Classes Removed

The following classes have been removed: HoloTransporter, HoloController, HoloServer, HoloProtocol.

4.4 Supporting Software Environment

The new RTAI Linux host shall have software installed and configured to provide TaskMaster services for controlling the Holography Manager, and making it available to other applications such as the Astrid and CLEO software suites.

5. Documents and Specifications

The documents required for this modification are found in the drawing archive in the directory /home/doc/drawings/archive/gbtelec/35205. Project 35205 is the Holography project. The schematic for the interface is 35205S008. Documentation on the Holography backend can be found in the document http://www.gb.nrao.edu/GBT/memos/memo101.html. A simple writeup in MS-Word format can be found in d006.doc in the 35205 directory. The author of this document is not declared, it was written in 1997 at the time of the new interface card implementation. A more detailed document, in MS-Excel format, can be found in the 35205 directory named CorrelatorREVA.xls (this link is to a local copy - check the project folder 35205 for most current version). This document was originally written by Steve White then later updated by Tim Weadon in May 2007. This document provides layout of the command registers and data registers. The memo gives you detailed information about each register.

Within the SDD documentation set, GBT Software Project Note GBT/SPN/009 descrbing the Holography FITS data file format and content will be restored or created, and updated to reflect data pedigree.

6. Deployment Checklist

What has to get done to integrate this completely into the system. This checklist must be completed before Cycle Integration Testing begins.

7. Test Plan

We will set up the Holography system (backend, VxWorks system for initial testing and RTAI Linux system for final product testing) in the lab for testing. A simulator for the interface should be developed to allow testing apart from the backend hardware to avoid linking the hardware and software modifications more than necessary. A full system test will include dumping simulated data through the simulated port, and writing it to disk.

7.1 Internal Testing

7.1.1 Original Configuration Testing

Because the original MCB interface card has been modified, then had those modifications removed, our initial test will require reassembling and testing the original configuration in a lab. Holography backend with MCB interface card, interfaced to a VxWorks computer executing the current Holography manager (release 7.2 of M&C software), with a test data card activated in the Holography backend to emulate a data stream. This configuration will be used with the M&C and Sparrow software testbed, and tested to verify that test data is received from the backend, and that full control of the backend is available via the CLEO Holography screen.

7.1.2 Testing Ported Holography Software

The modified and rehosted system should be throughly tested both using a simulated data stream, and the actual backend. The following tests should be completed at a minimum:

An RTAI-linux based machine is identified for use in testing, hostname cetus.

7.2 Sponsor Testing

7.3 Integration/Regression Tests

Confirm that the Astrid/Cleo/FITS writers are all cooperating


Signatures

APPROVED: I acknowledge that my request is mostly contained in this MR, and if the SDD delivers exactly what I specified, I might be happy.

ACCEPTED: I acknowledge that I have validated the completed code according to the acceptance tests, and I am happy with the results.

Written DONE - RonGrider - 24 July 2007
Checked DONE - TimWeadon - 24 July 2007
Approved by Sponsor DONE - JohnFord - 07 Aug 2007
Approved by CCC DONE - RonMaddalena - 10 Aug 2007
Tested with hardware DONE - StevenWhite - 20 Sep 2007
Accepted/Delivered by Sponsor DONE - ToddHunter - 20 Sep 2007

Symbols:


CCC Discussion Area

-- JohnFord - 30 Mar 2007

Attachment: sort Action: Size: Date: Who: Comment:
Holography_Diagrams_PortedDesign_TopLevel_r1.jpg action 57373 23 Jul 2007 - 15:37 RonGrider  
CorrelatorREVA.xls action 23552 24 Jul 2007 - 20:36 RonGrider  

Topic ModificationRequest1C307 . { Edit | Attach | Ref-By | Printable | Diffs | r1.26 | > | r1.25 | > | r1.24 | More }
Revision r1.26 - 20 Sep 2007 - 20:37 GMT - ToddHunter
Parents: PlanOfRecordC32007
Content copyright © 1999-2007 by the contributing authors.
All material on this collaboration platform is the property of the contributing authors.