Requirements, Software Architecture & Design

Similar documents
MONSOON Software Design & Status

The MONSOON Libraries API for Linux

MONSOON Master Control Board Test Procedures

Prototyping NGC. First Light. PICNIC Array Image of ESO Messenger Front Page

MONSOON Generic Pixel Server Communications, Command/Response and Data Stream Interface Description

MONSOON IR Acquisition Board Test Procedures

The MONSOON Implementation of the Generic Pixel Server

MOSAIC Operations Concept Document

MONSOON Torrent Production Readiness Review

MONSOON Data Handling System Interface Status and Data Stream Transfer

Mosaic 1.1 Final Design Review

MONSOON. TORRENT DHE Architecture. DHE Architecture Document NOAO Document TRNT-AD Revision: 5.0

The Mosaic Data Capture Agent

SAMI software description

Detector Data Acquisition Hardware Designs and Features of NGC (New General Detector Controller)

Hera-B DAQ System and its self-healing abilities

MONSOON. PAN Run-time Configuration, Setup and Operating Mode Definition Interface Description. NOAO Document ICD 5.1 Revision: 1.

Automated Software Configuration in the MONSOON System

WP 14 and Timing Sync

D R A F T ICD 1.8/4.4. Target Acquisition System to Telescope Control System. Bret Goodrich, Eric Hansen. Version: Draft A2. Issued By: Software Group

Heavy Photon Search Data Acquisition

New Software-Designed Instruments

Teledyne Imaging Sensors SIDECAR ASIC Development Kit & Focal Plane Electronics

Update on PRad GEMs, Readout Electronics & DAQ

ADQ14 Development Kit

Best Practices for Architecting Embedded Applications in LabVIEW Jacques Cilliers Applications Engineering

Adapter Modules for FlexRIO

NOCTURN XL: Getting Started. For Win 7 Evaluation GUI Version February 21, 2013 Frisco, Texas

Data Acquisition in Particle Physics Experiments. Ing. Giuseppe De Robertis INFN Sez. Di Bari

SOFTWARE FOR THE ESO NEW GENERAL DETECTOR CONTROLLER

Functional Specification

1.1 Errors and Event list

Controller Command Description

The hardware implementation of PXI/PXIe consists of a chassis, controller or computer interface, and peripheral cards.

MONSOON. TORRENT DHE PSM TSM INTERFACE DESCRIPTION Interface Control Document 7.6 NOAO Document TRNT-AD Version: 0. Authored by: Peter Moore

Data Acquisition. Amedeo Perazzo. SLAC, June 9 th 2009 FAC Review. Photon Controls and Data Systems (PCDS) Group. Amedeo Perazzo

Chapter 2: Operating-System Structures. Operating System Concepts Essentials 8 th Edition

EMUL-PPC-PC. Getting Started Guide. Version 1.0

FEATURES. APPLICATIONS Machine Vision Embedded Instrumentation Motion Control Traffic Monitoring Security

Practical Hardware Debugging: Quick Notes On How to Simulate Altera s Nios II Multiprocessor Systems Using Mentor Graphics ModelSim

Chapter 2: Operating-System

IronSync File Synchronization Server. IronSync FILE SYNC SERVER. User Manual. Version 2.6. May Flexense Ltd.

Windows 7 Overview. Windows 7. Objectives. The History of Windows. CS140M Fall Lake 1

Chapter 3: Operating-System Structures

TORRENT Local Control Board Test Procedure

PXDAC4800. Product Information Sheet. 1.2 GSPS 4-Channel Arbitrary Waveform Generator FEATURES APPLICATIONS OVERVIEW

Improvement of the Communication Protocol Conversion Equipment Based on Embedded Multi-MCU and μc/os-ii

TDDI04, K. Arvidsson, IDA, Linköpings universitet Operating System Structures. Operating System Structures Overview. Operating System Services

Architecture Specification

Intel CoFluent Studio in Digital Imaging

DIGITAL SYSTEM. Technology Overview Nordco. All rights reserved. Rev C

ARM Processors for Embedded Applications

Operating- System Structures

Lecture Topics. Announcements. Today: Operating System Overview (Stallings, chapter , ) Next: Processes (Stallings, chapter

EECS 3221 Operating System Fundamentals

EECS 3221 Operating System Fundamentals

Advanced NI-DAQmx Programming Techniques with LabVIEW

PROCESS CONTROL BLOCK TWO-STATE MODEL (CONT D)

Announcement. Exercise #2 will be out today. Due date is next Monday

ni.com High-Speed Digital I/O

ECE 550D Fundamentals of Computer Systems and Engineering. Fall 2017

Chapter 3: Operating-System Structures

Objectives. Chapter 2: Operating-System Structures. 2.1 Operating System Services

Readout Systems. Liquid Argon TPC Analog multiplexed ASICs SiPM arrays. CAEN 2016 / 2017 Product Catalog

Chapter 3: Operating-System Structures

CSX600 Runtime Software. User Guide

464K PRELIMINARY 3-STAGE SOLID STATE SWITCH SYSTEMS 464K SALIENT FEATURES SYSTEM OPERATION 464K DESCRIPTION

ECE 485/585 Microprocessor System Design

File systems: management 1

ni.com Best Practices for Architecting Embedded Applications in LabVIEW

Linux Driver and Embedded Developer

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy

Introduction Technology Equipment Performance Current developments Conclusions. White Rabbit. A quick introduction. Javier Serrano

Visual Profiler. User Guide

Engineer-to-Engineer Note

SMT943 APPLICATION NOTE 1 APPLICATION NOTE 1. Application Note - SMT372T and SMT943.doc SMT943 SUNDANCE MULTIPROCESSOR TECHNOLOGY LTD.

NI-XNET Python API Documentation

VXS-621 FPGA & PowerPC VXS Multiprocessor

CompuScope Ultra-fast waveform digitizer card for PCI bus. APPLICATIONS. We offer the widest range of

SBC-COMe FEATURES DESCRIPTION APPLICATIONS SOFTWARE. EnTegra Ltd Tel: 44(0) Web:

spwr_base & spwr_chan

SMT-FMC211. Quad DAC FMC. Sundance Multiprocessor Technology Limited

Chapter 11: Implementing File Systems

BES-III off-detector readout electronics for the GEM detector: an update

Virtex-II Architecture. Virtex II technical, Design Solutions. Active Interconnect Technology (continued)

CS450/550 Operating Systems

AMC516 Virtex-7 FPGA Carrier for FMC, AMC

Chapter 2: Operating-System Structures

S2C K7 Prodigy Logic Module Series

SR3_Analog_32. User s Manual

LASER INTERFEROMETER GRAVITATIONAL WAVE OBSERVATORY -LIGO-

Process Concepts. CSC400 - Operating Systems. 3. Process Concepts. J. Sumey

MD2 High-Speed Digitizer Instrument Drivers

NI Linux Real-Time. Fanie Coetzer. Field Sales Engineer SA North. ni.com

VXS-610 Dual FPGA and PowerPC VXS Multiprocessor

The Use of LabVIEW FPGA in Accelerator Instrumentation.

Chapter 3: Computer Assembly

cpci-dart Base-Board & Daughter-Board

European Organization for Astronomical Research in the Southern

KEEP CONTROL: PULPO 2 ESO s new cryostat housekeeping unit

Transcription:

Requirements, Software Architecture & Design 1

Contents Hardware Overview Underlying Assumptions & Requirements for MONSOON Software Design Philosophy & Software System Architecture Functional Decomposition, Interfaces and Libraries Top Level Data Flows PAN Process Architecture and Coordination Software Management, Test Plan, Resources and Schedule 2

Hardware Overview 3

MONSOON Hardware Requirements Scalable, low-cost, high-performance system. Support both IR and OUV devices. Detector-Limited performance. Device independent data acquisition architecture. Small modular packaging. Low power dissipation. Low total cost of ownership. 4

MONSOON Image Acquisition System Scalable multi-channel high-speed Image Acquisition System. Scalable at all levels based on cost/performance trade-offs. Specifically designed to address the needs of next-generation IR & CCD mosaic systems. ORION (2k x 2k) InSb & HgCdTe development. NEWFIRM (4k x 4k). WYIN QUOTA (8k x 8k) => ODI (32k x 32k). LSST (40k x 40k) and growing. Increased performance over existing solutions. With reduced cost, size and power consumption. 5

MONSOON System Communications 3 Critical Networks. 1. 1 GHz (2.4 GHz) COTS fiber optic network. Hi-speed, lo-latency latency - 50 Mpixel/s SL100, 120 Mpixel/s SL240. Handles all communication to DHE. 2. Ethernet. Provides power control for DHE for system error recovery. 3. Controller Controller synchronization. Key system element, hard-synchronized controllers. Distributed 40 Mhz master system clock and sync pulse. Controlled impedance, skew adjusted LVDS signal distribution. 6

MONSOON ANALOG Performance Current dynamic range: > 60,000:1 16-bit 1mhz ADC resolution, supporting S/N > 90db Future support for higher resolutions Non-linearity: < 0.1% over entire range Read noise: < 10% contribution to total noise Channel to channel cross talk: < 0.0015% (16-bit resolution) Pixel to pixel cross talk: < 0.01% 7

MONSOON Key Technologies Low-cost GHz class PC s. Removes the need for embedded DSPs in system, (PC cost ~ 2.5k). Scalable commercial high-bandwidth fiber optic networks. Buy not build, use a well-supported commercial product.» Systran FiberExtreme SL100/SL240.» SL100: 100 Mbyte/s => 50 <Mpix/s, SL240 240 Mbyte/s => 120 Mpix/s. Standard software systems. Use dependable components with large user base.» Redhat LINUX.» Existing software components or systems or design patterns. State-of of-the art analog & mixed signal electronic components. Increased performance with reduced power, size, and cost.» Allows construction of large channel count systems. 8

MONSOON DHE Design CLK/SYNC IN CLK/SYNC OUT Master Control Board CLK DIST NET- WORK RABBIT FPGA To EMBEDDED Handle Configuration CONTROLLER And Integration Timing FIBER INTERFACE LOGIC SEQUENCER LOGIC Pixel Data Bus 64 5 cpci Backplane Serial Cfg Bus Sequence Ctl Bus 64 Clk & Bias Board Video Acquisition Board To FPAs FIBEROPTIC SL100 PIXEL PIPE LOGIC 64 64 64 Video Acquisition Board

MONSOON 3 Board / 3 Bus System 3 Boards 1. Master Control Board (MCB) - Common to all systems 2. Clock & Bias Board (C&B) - Designed to meet FPA needs, 2 or more versions planned (IR & CCD) 3. Acquisition Board - Designed to meet FPA needs, 2 or more versions planned (IR & CCD) 3 Buses (40-66MHz ) 1. 64-Bit Pixel Bus - Synchronous transfer of 64 Synchronous transfer of 64-bit pixel data from Acq board to MCB 2. Sequencer Bus - Hi Speed Timing Bus (MCB to Acq & C&B Boards) for all controller timing 3. Serial Configuration Bus - JTAG Serial Configuration Bus to configure & read back Acq/C&B boards 10

Master Control Board Provides all timing & sequencing to system. Provides MONSOON system synchronization. Employs FPGA (Xilinx Virtex) hardware sequencer. Provides interface to Systran fiber. Fiber handles all primary cmd/response and pixel data. Provides interface to optional embedded Ethernet processor. Ethernet used for back-door reset. 11

Clock & Bias Board Model Board may be tailored to FPA & system req s. All interface to MONSOON bus through FPGA:» PCI compatible signals - reconfiguration of bus interface signals if needed - room for added functionality & lots of flexibility. All clock voltages & bias voltages have read back. Bias voltages & clock rails set by Serial Cfg Bus. IR board will support high-speed parallel DACs for some nodes. High channel count density on 6U format: Advances in CMOS dacs allow 100 s s of channels on 6U format. 12

Acquisition Board Model All interface to MONSOON bus through FPGA:» PCI compatible signals - reconfiguration of bus interface signals if needed - room for added functionality & lots of flexibility. High channel counts on 6U format. 36 channel IR board in PCB fabrication. Cost & power for 36 1mhz IR channels. 5W 10W for 36x1MHz IR channels ( < 500mW/MHz/ch). < $5000 component cost (< $200 / MHz / ch) 13

PAN-DHE Communications ICD 6.1 - MONSOON PAN to DHE Command/Response Interface. Four Commands from PAN to DHE. Read memory, Write Memory, AsyncResponse, startexposure. DHE echoes every word sent to it except startexposure command. DHE sends a AsyncMsg on hardware reset or power up. This message can have information on cause embedded in it. Memory Addresses allow for: 10 board select Bits - expandable to 14. 65536 memory locations on each board.» 0-31 are considered 32 bits wide.» 32-65535 are 16 bits wide. 14

PAN-DHE Communications 15

Underlying Assumptions & Requirements for MONSOON Software 16

MONSOON Pixel Server SUPERVISORY NODE LINUX PC PIXEL ACQUISITION NODE 1 Ethernet Link 100Mb/s PIXEL ACQUISITION NODE 2 Ethernet Link 100Mb/s PIXEL ACQUISITION NODE 3 Ethernet Link 100Mb/s 10Mb/s Ethernet LINUX PC PCI FIBER CARD 1Gb/s Fiber (50Mpixel/s) DETECTOR HEAD ELECTRONICS NODE 1 SYNC 10Mb/s Ethernet 1Gb/s Fiber (50Mpixel/s) LINUX PC PCI FIBER CARD DETECTOR HEAD ELECTRONICS NODE 2 SYNC 10Mb/s Ethernet 1Gb/s Fiber (50Mpixel/s) LINUX PC PCI FIBER CARD DETECTOR HEAD ELECTRONICS NODE 3 N NODES CCD or FPA CCD or FPA CCD or FPA CCD or FPA CCD or FPA CCD or FPA CCD or FPA CCD or FPA CCD or FPA CCD or FPA CCD or FPA CCD or FPA 17

Underlying Assumptions PCI bus system with GIGA-Hz class CPU(s). PCI system in console-less less operation. Will use an Open Source well-known OS. (Linux). Hardware and Software Systems to be Open Source. Command & Data communication by ethernet. DHE Communication over COTS Fiber (3 Km). Multi-tiered tiered security policy. Connection location/source (firewalls, name/address). Privileged system (password security). Remote (ethernet) power control on DHE. 18

Requirements for MONSOON Software Science Generated Requirements Detector Development Requirements System Generated Requirements Software Development Requirements 19

Science Software Requirements 1. Support detector safe operations. 2. Support detector limited performance. 3. Support both IR and OUV detector systems. 4. Extensible to Very Large Focal Planes. 5. Able to treat mosaics as single focal plane. 6. Support science observation by named modes. 20

Science Software Requirements (cont) 7. Provide for efficient science operation support. 8. Support high observing efficiency. 9. Support existing and new observing paradigms. 10. Provide ROI support for readout speed up. 11. Provide ROI support for data compression. 12. Support technical imaging. (Guiders, etc.). 21

Science Software Requirements (cont) 13. Array configuration by standard parameter set. 14. Parameter sets determined in the Detector Lab. 15. Provide limited tuning of detector performance. 16. Provide limited on-the-fly reconfiguration. 17. Allow addition of new processing algorithms. 18. Provide for an instrument calibration mode. 22

Detector Development Requirements Support detector characterization operations. Low-level control of detector parameters. Automated control of characterization process. New data reduction algorithm development. Support detector research and development. Incorporation of new detector types. Development of new operation modes. Support hardware development & debugging. 23

System Software Requirements 22. Support efficient boot-up and initialization. 23. Start-up & initialisation without intervention. 24. Support system operations logging. 25. Support connection security. 26. Support convenient error detection/recovery. 27. Support remote diagnosis, debug & operation. 28. System to include simulation capabilities. 24

System Software Requirements (cont) 29. Help available for commands/parameters. 30. System layered to allow maximum reuse. 31. Pixel data processing chain re-configurable. 32. Support efficient configuration for new systems. 33. Configurable w/o re-compile of base code. 34. Features added without rebuilding system. 35. Software to use well-defined interfaces. 25

System Software Requirements (cont) 36. Interfaces documented and published. 37. Use GPX Interface to outside world. 38. Documentation maintained with code base. 39. Documentation in standardized format. 40. Support Package-like installation. 41. Support verification & removal of versions. 42. Develop source code maintenance manual. 26

Development Software Requirements 43. All Software to be Open Source. 44. Use widely available software technologies. 45. Use free tools to the greatest extent possible. 46. Support multi-site distributed development. 47. Use source code version control (CVS). 48. Testing and verification built into development. 27

Design Philosophy & Software System Architecture 28

Design Philosophy Make maximum use of facilities provided by the OS. Isolate & limit scope of software functions. Use libraries to provide ease of use & modification. Layer functionality in libraries for ease of change. Separate generic and hardware specific layers. Insure isolation between layers. Use processes to perform identifiable tasks. 29

Design Philosophy (cont) Build-in in monitoring of system processes. Allow kill/restart of rogue processes. User interface concerns left to client systems. MSL and PAN are software program interfaces. Idiosyncrasies left to observatory staffers. Unique DHS requirements. Observatory specific systems (EPICS, WIYN router, etc). Unique GUI tools. 30

GPX Data Flows MONSOON Concept Data flows Client System (Engineering Lab Console) (Instrument Control System) (Observation Control System) Observatory Status Interface Commands Responses Asynchronous Messages Status Request & Response Asynchronous M essage Reports System Status Local DHS Interface Routines MONSOON GPX Pixel Server Pixel Data Stream Fits Image on Disk 31

MONSOON Level 0 Context Monsoon System Context Diagram Client System (Engineering Lab Console) (Level 0) Science Client System (Instrum ent Control System) (Observation Control System) Local Status Interface Df1.1 Command String Connection Df1.2 Response String Connection ICD 4.0 GPX Interface ICD 4.1 MONSOON Restrictions (TBD) 1.0 Supervisor Layer Df1.3 Asynchronous Status Con nection TBD Df1.4 Pixel Data Stream Local DHS Interface Df1.5 Status Data Connection ICD 5.0 PPX Interface 2.0 PAN System Df1.4 Pixel Data Stream MONSOON GPX (Pixel Server) ICD 6.0 Generic DHE ICD 6.1 MONSOON DHE 3.0 DHE System Fits Image on Disk External Entity or Process Interface Definition Label Data Flow 1.0 2.1 Internal Process Df 1.1 Data Flow Label MONSOON External Process 32

Three Layer System Architecture 1. MONSOON Supervisor (MSL) Layer. 2. Pixel Acquisition Node (PAN) Layer. 3. Detector Head Electronics (DHE) Layer. 33

Three Layer System Architecture (cont) 1. MONSOON Supervisor Layer. (MSL). A command/control Layer, (no pixel data). Provides GPX interface to clients. Provide single point contact to system. Provides client access security. Provides data transfer control. Provides multiple client connections. Provides error monitoring & recovery. Handles Command/response to/from multiple PANs. Understands observing modes. May run remotely or on a PAN. 34

Three Layer System Architecture (cont) 2. Pixel Acquisition Node (PAN) Layer. No knowledge of other PAN-DHE pairs. Provides PPX interface to MSL or users. Provides run-time configuration of PAN/DHE. Provides first level data archiving. Provides multiple image processing modes.» Fowler Sampling, coadds, MSR techniques, OT imaging. Provides parameter verification/control/help. Deals with IR/OUV/etc. differences. 35

Three Layer System Architecture (cont) 2. Pixel Acquisition Node (PAN) Layer (cont). 2. Handles single exposure sequencing. Handles raw data pre-processing. processing. Provides interface to DHE hardware. Provides sequence configuration/download. Provides PAN error monitoring/reporting. Provides PAN process error recovery. Provides support for speed ROI. Provides support for compression ROI s. 36

Three Layer System Architecture (cont) 3. Detector Head Electronics (DHE) Layer. 3. Handles array hardware control.» Voltage levels, sequencing, monitoring. Handles integration timing. Handles detector readout sequencing. Handles digital averaging. Handles shutter control. Can handle array temperature control. Board Self Identification and Version tracking. In Current DHE implementation this is all in FPGA firmware 37

Functional Decomposition, Interfaces and Libraries 38

Supervisor Layer Functions System start-up and initialization. (multiple PAN s). Network/client connection control/security. Multiple connection accept & Setup. Connection error detection and recovery. Primary client communications interface (GPX). Command distribution to multiple pans. Response gathering from multiple PANs. Data transfer control (organizing the transfer). Configuration/Mode name->database translation. 39

PAN (Pixel Acquisition Node) Functions Connection Control & Security (MSL & Client). Secondary communications interface (PPX). PAN/DHE start-up and initialization. Command/parameter verification. Command/parameter setting security. Parameter name/address translation. Configuration security/control. 40

PAN Functions (cont) Mid-level exposure control (multiple identical images). Pixel data capture. Image data pre-processing. processing. Immediate image archiving (FITS image on disk). DHE interface and control. DHS notification of image availability. Status Tracking, Notification, Logging. 41

PAN Functions (cont) Operations and error logging. Data capture error recovery. Diagnosis and debug support. Self-test support. Operation verification. 42

DHE (Detector Head Electronics) Functions Low level hardware control. Detector timing pattern control. Integration timing (if master node). Image data conversion and transmission. Hardware housekeeping & status response. Detector protection. Bias power control, hardware test facilities, ESD Protection. Error Detection and Recovery. Power glitches/outages, Electronic component failures. In Current DHE implementation this is all in FPGA firmware 43

Interface Definitions Client System to Generic Pixel Server. ICD 4.0 Generic Pixel Server - Communications, Command/Response and Data Stream Interface Description. (GPX). MONSOON Restrictions on Science Client Access. ICD 4.1 MONSOON Command and Parameter Restriction Lists. Supervisor Layer to Pixel Acquisition Node. ICD 5.0 Generic Pixel Acquisition Node Communications, Command & Response Description. (PPX). PAN to Generic DHE (Detector Controller) (Detector Controller). ICD 6.0 Generic Detector Head Electronics - Command and Data Stream Interface Description. (A Command Interface). MONSOON PAN to MONSOON DHE. NICD 6.1 MONSOON Detector Head Electronics - Command and Data Stream Interface Description. (Hardware/Software Interface Details). Published interface TBD 44

Interfaces and Software Layering Science or Engineering Clients ICD 4.0 Generic Pixel Server - Communications, Command/Response and Data Stream Interface Description Supervisor Layer Software ICD 5.0 PAN Pixel Node - Communications, Command/Response & Data Stream Interface Description Pixel Acquisition Node Software ICD 6.0 Generic Detector Head Electronics Command and Data Stream Interface Description Communications to Simulator ICD 6.1 MONSOON DHE Interface & Design ICD 6.2 SDSU-II DHE Interface & Design ICD 6.99 Other DHE Interface & Design ICD 6.1 MONSOON DHE Interface & Design MONSOON DHE Interface Software SDSU-II DHE Interface Software OTHER DHE Interface Software Systran Fiber Drivers SDSU-II Fiber Drivers OTHER Fiber Drivers Systran Fiber Hdwr SDSU-II Fiber Hdwr OTHER Fiber Hdwr Simulated MONSOON Detector Head Electronics MONSOON Detector Head Electronics ICD 7.0 MONSOON Backplane SDSU-II Detector Head Electronics OTHER Detector Head Electronics 45

MONSOON Software Review Questions Session 46

Break Southern Lunch 47

Monsoon Layers and ICD's MONSOON GPX Image Acquisition system ICD and Software Layer relationship Monsoon Supervisory Layer Monsoon PAN Interface Layer Pixel Acquisition Node Monsoon DHE Utility Library (libdheutil) Monsoon DHE Hardware Library (libmonsoon) Monsoon Com Utility Library (libcomutil) Monsoon Com Hardware Library (libsystran) Systran SL240 Drivers (libfxslapi) Systran SL240 Hardware Monsoon DHE (Detector Head Electronics) (ICD 4.0 GPX) (ICD 5.0 PPX) (ICD 6.0 Generic DHE) (ICD 6.1 MONSOON DHE) (Com Util Library API) (Com Hdw Library API) (FXSL Library API) Not started Processes in Coding In coding Complete (in use) Complete (in use) Complete (in use) Complete (in use) COTS (Complete) COTS Hardware NOAO/CTIO Hdw 48

MONSOON Libraries Library Structure & Architecture General Functionality Libraries Generic Interface Libraries Hardware Specific Libraries 49

Library Structure & Architecture Libraries divided into classes of function. Call sequence similar for all functions. Functions provide inherited status value. Functions provide text status string. Libraries provide user selectable debug levels. Simulation mode included in: Hardware specific libraries. Generic interface libraries. 50

Library Structure & Architecture Individual test program built for each library. Library API document provided with libraries. API documentation extracted from source code. Generic Makefile. Static and shared library versions built. 51

General Functionality Libraries libavutil - Attribute-Value pair search, add & modify routines. libcliutil- command line interface; parse, search & help. libqueutil - queue functions; new, add, remove, full, empty. libsemutil - semaphore functions; new, init, give, take, release libshmutil - shared memory functions; attach, detach libsockutil - socket functions; new, listen, accept, read, write libmiscutil - a set of routines used by many pan processes. 52

Generic Interface Libraries libppxutil - the PAN pixel server interface routines. the PAN pixel server interface routines. (ICD 5.0). Pan implementation of simplified ICD 4.0 (GPX). Converts gpxxxx->ppxxxx. Single Attribute-Value pair set/read. Low level Set/Read implemented for engineering consoles. libdheutil - generic DHE interface routines generic DHE interface routines (ICD 6.0). Open, Close, Read, Write, IOCTL. readvalue, writevalue, readdetector, resetdhe, abortreadout, dhepowercntl, shuttercntl, biaspwrcntl, startexp, pauseexp, stopexp, abortexp, resumeexp, readvalarray, writevalarray, loadwaveform, asyncresponse, testdatalink, testclockdrvr, testdcbiassup, 53

Generic Interface Libraries libcomutil - generic communications link routines. Modeled on POSIX I/O library facilities. Open, Close, Read, Write, IOCTL libpanutil - shared memory setup & init used by PAN processes. Shared Memory Allocate, Release, Shared Memory Initialization. Image data buffer setup and Initialization. Get/Set Attribute by name. 54

libdetector. Hardware Specific Libraries Implements routines unique to a detector/instrument. Implements OUV, IR, Guider, etc. differences. Integration Time Calculations, ROI checking & setup, Unique Array Initialization & Setup requirements. OTI details, charge/image shift commands, etc. User Function name to C function translation provided.» Same structure as runtime command configuration.» Translation compiled into library. Shared Library loaded at run time.» One Library for each unique detector/instrument combination.» Library loaded from detector/instrument directory. 55

libsystran. Hardware Specific Libraries Implements the SL240 specific interface to the com link. Open, Close, Configure hardware link & COTS software. Systran hardware functions, read, write, IOCTL functions. libmonsoon. Implements the MONSOON DHE access routines Open, Close, Reset, Read, Write, IOCTL, etc. (ICD6.1). asyncresponse, Test routines, error detection/recovery. MONSOON DHE Exposure control commands. MONSOON DHE Data Capture Routines. Specific command routines implementing ICD 6.0. 56

Top Level Data Flows 57

GPX Data Flows MONSOON Concept Data flows Client System (Engineering Lab Console) (Instrument Control System) (Observation Control System) Observatory Status Interface Commands Responses ICD 5.0 Asynchronous Messages Status Request & Response Asynchronous M essage Reports System Status Local DHS Interface Routines MONSOON GPX Pixel Server Pixel Data Stream Fits Image on Disk 58

Supervisory Layer DFD (Level 0) Monsoon Supervisory Layer Data Flow Diagram (Level 0) Science Client System (OCS, ICS) Engineering Console Client Local Status Interface Df1.5 Status Data Stream Df1.1 Command String Connection Df1.2 Response String Connection 1.0 Supervisor Level Df1.3 Asynchronous Status Connection Local DHS Interface Df1.4 Pixel Data Stream (ICD 4.1) Df1.5 Engineering Data Connection Fits Image on Disk ICD 5.0 (TBD) Df2.1 MONSOON Com man d Messages Df2.2 Command Respon se Messages Df2.3 Asynchronous Status Messages 2.0 Pixel Acqusition Node 2.0 Pixel Acqusition Node 2.0 Pixel Acqusition Node [ Optional Additional Pixel Acquisition Nodes ] 59

Pixel Acquisition Node DFD (Level 0) Science Client System (OCS, ICS) Engineering Console Client Df1.1 MONSOON Connection Requests Engineering Console Client Df1.2 MONSOON Command Messages Df1.3 Command Response Messages Df1.4 Asynchronous Status Messages 1.0 Supervisory Process Df2.1 MONSOON Command Messages Df2.2 Command Response Messages Df2.3 Asynchronous Status Messages Df2.1 MONSOON Command Messages Df2.2 Command Response Messages Df2.3 Asyn ch ronou s Status Messages Df2.4 MONSOON Connection Updates ICD 5.0 PPX Command, Response and Data Interface Local Status Interface Df1.5 Status Data Stream Df3.1 DHE Command Messages Df3.2 Command Response Messages 2.0 Pixel Acqusition Node Df3.3 Asynchronous Status Messages Df1.4 Pixel Data Stream (ICD 4.1) Local DHS Interface Df1.6 Engineering Data Connection (FITS) 3.0 Detector Head Electronics Df3.4 Pixel Data Blocks Fits Image on Disk 60

Detector Head Electronics DFD (Level 0) Pixel Acquisition Node Df3.1 DHE Command Messages Df3.2 Command Response Messages Df3.3 Asyn chronous Status Messages Df3.4 Pixel Data Blocks Diagnostic Command Console 3.0 Detector Head Electronics (DHE) Df3.5 Diagnostic Commands & Responses 61

System State Diagram MONSOON Top-Level System State Diagram Connection Request Reset or Restert MSL Initialization Complete Pixel Data Processing Complete System Inial ization Accept Connections Complete Pixel Data Achiving Connection Acceted (update Connection List] Accept Command String Process Captured Data Pass Data to DHS Exposure Requested Valid Attribute Cmd Error Detected Comp lete Pixel Data Capture Exposure Trigger Re ceived Arm or Trigger Exposure Capture Pixel Data Error Detected Response Sent Unable to recover from Error Error Detected Send OK Response Error Recovery Complete Error Detected Error Recovery Response Sent Command Completed Set Exposure Parameters State State Transition Reason for Transition Error Detected Send ERROR Response Attribute Error Detected 62

PAN Process Architecture & Coordination 63

PAN Layered Process Architecture libppx - Generic Pan Interface ICD 5.0 PanDaemon Socket interface and CLI to command processor High level DHE control Pan Process Startup and shutdown Process control for Pan processes Error checking and recovery PAN process Command or Semaphore access Data or data dddress flow path Shared memory access Shared Memory Interface fsaver (FITS Writer) exttrgger pancapture panprocalg pansaver libdetcmnd - Detector Specific Routines libdheutil - Generic DHE Interface ICD 6.0 libmonsoon - Monsoon DHE hardware interface ICD6.1 libcomutil - generic communications link routines libsystran - systran versions of communications link interface libfxslapi - Systran Sl240 Driver Well defined API's 64

PAN Detailed Process Interconnects 65

PAN Detailed Process Interconnects 66

PAN Detailed Process Interconnects 67

PAN Detailed Process Interconnects 68

PAN Process Coordination Controlling Client GPX Command GPX Responses MONSOON Supervisory Layer PPX Commands PPX Responces PPX Commands PPX Responses from pansaver pandaemon Take sysrdysem ICD6.1 Command ICD6.1 Response MONSOON DHE Hardware expstart Command Give expstartsem Next Command 69

PAN Process Coordination pancapture Forked Process fro m pandaemon from fs a ver Take expstartsem Initialize Process Loop exptrigger Take emptyfinbufsem Initialize Process Loop Prepare Finish Buffer from panprocalg Give readyfinbufsem Take emptyrawbufsem Calu late Timeou t etc. Give exptriggosem Take exptriggosem Loop Wait Predetermined delay time Setup Read/Wait for Pixels startexp Command Pixel Data Burst from panprocalg Take emptyrawbufsem Give fullrawbufsem MONSOON DHE Hardware Last Frame? NO YES Give fullrawbufsem Next Exposure 70

PAN Process Coordination panprocalg from pancapture Initialize Process Loop Take readyfinbufsem Gather Fits Info from pancapture Loop Take fullrawbufsem Frame ID NULL? YES NO Process Raw Data Buffer Give emptyraw BufSem Cont Give fullfinbufsem Next Exposure 71

PAN Process Coordination pansaver Initialize Process from panprocalg Loop Take fullfinbufsem Unscramble Finish Buffer Fork fsaver Process Forked Process fsaver Give sysrdysem Save FITS Header to disk Save Finish Data buffer to disk Zero Finish Data buffer Give emptyfinbufsem Exit Next Exposure 72

Process State Diagrams 73

MONSOON Software Review Questions Session 74

Break Northern Lunch 75

PAN Security Issues Preventing unauthorized access. Legal Connection List. Source IP address. Firewall. Verifying parameter values. Trusted routines. Internal parameter sets. Password restrictions. Restricting Parameter access. Password protection on privileged connection. No Client access to certain parameters. 76

Error Detection/Recovery Client-PAN communication link errors. Caught by reliable connection protocol. Command String verification. Socket connection errors. Client responsible for reconnection. Responses to pending commands dropped. Disk full errors. Spare disk partition for small number of frames. Exposure lockout until Data removed from disk. 77

Error Detection/Recovery PAN process errors. Process verification at key events. Process kill and restart automatic. Deadlock Detection/Recovery. High level time outs. Semaphore release on shutdown or failures. Queue content control. (Special buffer ID s). Livelock Prevention. Semaphore sequence control. Semaphore count control. Routine invariants. 78

PAN Semaphore Usage Monsoon PAN Semaphores expstartsem [2] pandaemon sysrdysem [1] expstartsem [0] datacapture em ptyfinbufsem [1] readyfinbufsem [2] emptyfinbufsem fsaver Spawn Process [2] sysrdylsem [3] pansaver exptriggosem [4] emptyrawbufsem [3] fullfinbufsem [1] fullrawbufsem [5] readyfinbufsem [1] emptyrawbufsem [3] fulfinbufsem [4] exptriggosem exptrigger rawdatardysem [2] panprocalg 79

Error Detection/Recovery DHE communication link errors. Timeouts. Echo-back errors. Systran driver errors. DHE parameter errors. DHE parameter verification errors. DHE parameter value drift. DHE access errors (bad address). DHE reset or power glitch. Async Message errors. 80

Software Management, Test Plan, Resources & Schedule 81

Design by Consensus. Management Depend on SWE experience. Pseudo-Code by lead designer. Final coding by lead or second programmer. Verification by second or lead programmer. Re-Verification by designer. Final test & verification in Use. 82

Documentation OCCD and FPRD published but not complete. System Architecture document in work. ICD s s Published and reviewed. Library API Published. Maintained with Source code. Process description documentation begun. Using source code Documentation system for processes. Manually produced text used to detail process interactions. Queues and Semaphores described in added text. 83

Test & Verification Much functionality in Libraries. Individual Library Test programs. Functions verified against description. Function invariants tested. Library functions tested and verified independently. Test program constructed for each library. Interactions tested w/multiple test program instances. In Debug system. Currently libraries are being used in dhehdwdbg. Revealed bugs fixed and re-verified in individual test. New version tested immediately. 84

Test & Verification (cont) In PAN process system. Processes tested against expected behavior using dhesim. Processes verified against functional description. Process invariants tested and verified. Revealed bugs fixed and re-verified in individual test. New version tested immediately. Pan process test bed planned. 85

Schedule & Resources Libraries tested & running in dhehdwdbg (May `03) Generic Interface Libraries Hardware Specific Libraries Some General Utility Libraries PAN Interface & processes running DHE (Sept `03) Remaining General Utility Libraries PPX interface Library complete TCL/TK Engineering Client (Sept. 03) Everything Needed for NEWFIRM (Nov `03) Multi-Pan system development starting (Jan 04) 86

Schedule & Resources (cont) 1.0 FTE Sr. Software Engineer NCB 0.5 FTE Sr. Software Engineer PND 0.1 FTE black market Software Engineer II PBR 1.1+.55+.11 = 1.76 FTE NOAO software engineers give 110% 87

MONSOON Software Review Questions Session 88

Panel Deliberation 89

Panel Verbal Report 90

MONSOON Software Review Appendices I. Methods to Achieve Requirements. II. Process State Diagrams. III. Interface Control documents. A. ICD 4.0 GPX Command, Status and Data Interface. B. ICD 5.0 PPX Command, Status and Data Interface. C. ICD 6.0 Generic DHE Command Interface. D. ICD 6.1 MONSOON PAN to DHE Interface. IV. Original Project Documents A. MONSOON OCCD B. MONSOON FPRD 91

Methods for Achieving MONSOON Software Requirements. Science Generated Requirements Detector Development Requirements System Generated Requirements Software Development Requirements 92

Science Software Requirements Support detector safe operations. Use Standard Parameter Sets. Parameter range restrictions in science operations. Only Limited parameter tuning permitted. Bias power off until detector voltages confirmed correct. Detector engineer determines safe operation. Support detector limited performance. Use high-end giga-hz CPU s. No restrictions on speed built into software. Allow overlap of execution to greatest extent possible. 93

Science Software Requirements (cont) Support both IR and OUV detector systems. Per detector runtime command configuration. Runtime pre-processing processing algorithm selection. Base system code non-specific. User interface left to Observatory/Instrument staff. Extensible to Very Large Focal Planes. Individual PAN s s know only about their FP section. Final image assembly left to DHS. MSL knows how to deliver commands to FP sections. 94

Science Software Requirements (cont) Able to treat mosaics as single focal plane. User view is of an image server. MSL deals with details of multiple PAN s. Data sent to DHS by individual PAN s s for reassembly. Support science observation by named modes. Mode database converts names to Parameter settings. MSL knows how to send parameter settings to PAN s. Instrument/detector scientists/engineers determine Modes. User can add features to base modes within restrictions. User modes savable in database. 95

Science Software Requirements (cont) Provide for efficient science operation support. Allow overlap of execution to greatest extent possible. Provide Modes to support Focus, Calibration frames, etc. Provide fast setup and configuration. Support high observing efficiency. Allow overlap of execution to greatest extent possible. Provide Modes to support Focus, Calibration frames, etc. Provide fast setup and configuration. Support existing and new observing paradigms. Connections permit Remote observing, Queue observing, Published Interfaces allow automation of observations. Facilities for adding functionality allow new modes. 96

Science Software Requirements (cont) Provide ROI support for readout speed up. Single ROI to reduce readout time. ROI spans chips in restricted ways. Allowed alternatives determined by mosaic layout. Provide ROI support for data compression. Readout time not reduced all pixels readout. Multiple ROI s s allowed. Only data within the ROI s s sent to DHS. Support technical imaging. (Guiders, etc.). Runtime configuration allows customization. Detector library permits unique handling for purpose. 97

Science Software Requirements (cont) Array configuration by standard parameter set. Detector setup by named Mode. Parameter set database converts names to parameter settings. Provision for expansion of Database by Users. Parameter sets determined in the Detector Lab. Initial database created by detector engineer. Instrument scientist can tune modes for instrument. User has limited ability to modify base operating mode. Provide limited tuning of detector performance. User can modify restricted range & class of parameters. 98

Science Software Requirements (cont) Provide limited on-the-fly reconfiguration. Allow addition of new processing algorithms. Processing algorithm can be restarted with new algorithm. New data taking algorithms can be loaded. New detector waveforms can be loaded as needed. Provide for an instrument calibration mode. Instrument Client can run MSL/PAN s s automatically. Password restriction allows access to restricted parameters. Engineering console can be used to tune parameters. 99

Detector Development Requirements Support detector characterization operations. ppx interface provides Low-level control of parameters. Interface allows automated control of process. on the fly reconfiguration allows new algorithm development. Library & process APIs allow convenient development. Support detector research and development. Runtime configuration allows new detector types. on the fly reconfiguration allows new operation modes. Support hardware development & debugging. Ppx interface allows Low-level hardware command support. 100

System Software Requirements Support efficient boot-up and initialization. Each PAN boots up independently. Boot-up only depends on local information. Runtime configuration sent to all PAN s. Communication mechanism universal & easy to use. Start-up & initialization without intervention. Startup scripts keyed to Instrument/system. MSL does Startup time checking to insure correct operation. Crashed/down nodes restarted automatically. Start-up monitored by logging mechanism. 101

System Software Requirements Support system operations logging. Error detection and recovery logging. Command sequence playback. Status display of current state saved with exposure. Support connection security. Multiple connections allowed. Connection security enforced (firewall, IP restrictions). On-Telescope connection priority observed. Engineering level commands password protected. 102

System Software Requirements Support convenient error detection/recovery. Routines track and inherit status. First error is reported and correction is attempted. Errors reported and corrected automatically if possible. Error help included in report. Support remote diagnosis, debug & operation. Multiple connections permitted. Engineering connection password protected. Test facilities built into system at several levels. 103

System Software Requirements (cont) System to include simulation capabilities. Hardware libraries provide simple simulation. Simulation automatic in absence of Hardware. Help available for commands/parameters. Help provided by Runtime Configuration process. Command help available for every command. Parameter help available for settable parameters. System layered to allow maximum reuse. General Purpose & Generic Interface libraries reusable. Top level process code reusable. Framework of Hardware Specific libraries reusable. 104

System Software Requirements (cont) Pixel data processing chain re-configurable. Multiple processing algorithms supported in panprocalg. Multiple panprocalg versions supportable. Process interconnects will be well defined and published. Support efficient configuration for new systems. Engineers define hardware with spread sheet. Runtime configuration derived from spread sheet. Configurable w/o re-compile of base code. Features added without rebuilding system. Hardware specific libraries compiled as shared libraries. New configurations read at runtime. 105

System Software Requirements (cont) Software to use well-defined interfaces. Interfaces documented and published. Use GPX Interface to outside world. Documentation maintained with code base. Documentation in standardized format. Library API created by make process and published. Process interface being documented and published. GPX or PPX interface used as interfaces to Clients. API s, ICD s s & Process interface externally available. Web publication planned. 106

System Software Requirements (cont) Support Package-like Installation. Planned. Support verification & removal of old versions. Planned. Develop Source code Maintenance Manual. Will be developed from source code API creator. Manual will include library and Process descriptions. 107

Development Software Requirements All Software to be Open Source. Code available on externally visible disk. WEB obtainable source code planned. Use widely available software technologies. Sockets, Semaphores, Shared Memory. ANSI standard C compiler. POSIX compliant standard Libraries. Use free tools to the greatest extent possible. C,, LINUX, TCL/TK. Firmware using XLINIX WEBPACK. 108

Development Software Requirement Support multi-site distributed development. CVS Tree on externally visible disk Individual modules obtainable through CVS. (NI). Use Source code version control (CVS). CVS Tree built and in use at NOAO. CVS Tree available on externally visible disk. Testing and verification built into development. Testing plan for Libraries. PAN process test-bed planned. dhesim complete and operating at rudimentary level. 109

Process State Diagrams 110

pandaemon State Diagram pandaemon State Diagram Request Invalid Reset or Start-up Unable to recover from Error Start-up Complete System Inialization Error Recovery Complete Process Start Failed Spawn Processes Processes Started Send Error Response Accept Connection Response Sent Connection Accepted Response Failed Error Recovery Execute Exposure Control Executed Stop/Abort Executed Pause/Resume Stop/Abort Failed Abort/Stop Exposure Response Failed Abort/Stop Comp le te Send OK Response Response Sent Command Invalid Wait for Command Valid Command NOT startexp Semaphore Error De tected Got Pause, Stop Abort, Resume Run-Wait Got sysrdysem Command Failed Command Complete Valid Command IS startexp Give expstartsem Semaphore Given Reject all Except Exposure Control Execute Command Processes Restarted Processes Rea dy Process Restart Failed Process Restart Process Error Detected Verify Processes State1 Reason for Transition State Transition State2 111

Start-up. pandaemon States Read detector configuration, Initialize data Buffers. Attach shared memory, Initialize shared memory. Read DHE configuration. Spawn PAN Processes. Start pancapture, panprocalg, pansaver. Accept connection. Accept connection requests. Verify permissions. Send Error Response. Send OK Response. 112

pandaemon States Wait for command. Accept, Parse & verify command string from socket or stdin. Execute Command. Execute appropriate command function. Run-Wait. Accept command string from socket or stdin. Parse command, reject all except Exposure control. Wait for sysrdysem. Execute Exposure Control. Abort/Stop Exposure. 113

Process Verify. pandaemon States Verify health of other PAN processes. Give expstartsem. Process Restart. Check on process existence, kill if required. Check on process resource use. Set resources to initial state. Restart process. Error Recovery. Determine error. Correct or abdicate responsibility to user. 114

pancapture State Diagram pancapture State Diagram Reset or Start-up Unable to recover from Error Start-up Complete System Inialization Process Start Failed Send Error Response Spawn exptrigger Process Response Sent Processes Started Command Complete Error Recovery Complete Response Failed Error Recovery Put Frame on Queue Last Frame Received Abort/Stop Failed Abort/Stop Exposure Abort/Stop Complete expstartsem Taken Wait for expstartsem Frame Received Expect more Frames Frame Incomplete exptriggosem Given Do Exposure Send OK Response Response Sent Do Process Verify Frame TimeOut Wait for Frame exptrigger Ready Got Pause, Stop Abort, Resume Process Restart Failed Process restarted Verify Process Process Restart Process Error Detected State1 Reason for Transition State Transition State2 115

Start-up. pancapture States Attach shared memory, Initialize shared memory. Spawn exptrigger Process. Spawn process check for startup. Wait for expstartsem. Do a semtake on expstartsem. Error Recovery. Determine error state. Correct or abdicate responsibility to user. Clean out image processing chain. 116

Do Exposure. pancapture States Obtain image finish buffer, Prepare meta-data buffers. Pass finish and meta-data to panprocalg. Obtain empty Raw Data Buffer. Give exptriggosem. Wait for Frame. Do dhegetdata to receive data buffer. Frame on Queue. Pass full raw data buffer ID to panprocalg. Abort/Stop Exposure. Clean out processing chain and image buffers. 117

Process verify. pancapture States Check on exptrigger process. Report own health. Process Restart. Restart exptrigger if necessary. Send OK Response. Send ERROR Response. 118

exptrigger State Diagram exptrigger State Diagram Reset or Start-up Start-up Complete Inial ization Recovery Co mplete Error Recovery Wait for exptriggosem Response Sent Send OK Response Sem Received do Verify Sem Received Do startexp startexp Sent startexp Failed Do Exposure Health OK Verify Processes Reason for Transition State1 State Transition State2 119

Start-up. exptrigger States Attach shared memory, Initialize shared memory. Wait for exptriggosem. Do a semtake on expstartsem. When taken go to Do Exposure or Process Verify. Do Exposure. Wait pre-determined delay time. Send startexp command to DHE. Process verify. Report process health. Error Recovery. 120

panprocalg State Diagram panprocalg State Diagram Reset or Start-up Start-up Complete System Inialization Abort/Stop Failed Unable to recover from Error Error Recovery Queue Put Failed ABORT/STOP Failed Abort/Stop Complete Exposure Finish Buffer on Queue NULL ID on Queue Wait for readyfinbuf Sem Processin complete Put Frame on Queue expstartsem Taken Process Frame Queue Put OK Do Exposure Frame Received Wait for Raw Frame Frame ID NULL Finished Pre-Process Send OK Response Response Sent Do Process Verify Frame TimeOut exptrigger Ready Response Sent Resp onse Failed Send ERROR Response Process Error Detected Verify Process State1 Reason for Transition State Transition State2 121

Start-up. panprocalg States Attach shared memory, Initialize shared memory. Wait for readyfinbufsem. Do a semtake on readyfinbufsem. When taken go to Do Exposure or Process Verify. Error Recovery. Determine error state. Correct or abdicate responsibility to user. Clean out image processing chain. 122

Do Exposure. panprocalg States Obtain finish image buffer, prepare meta-data buffers. Obtain full raw data buffer. If buffer ID valid.» Process Raw data buffer into Finish buffer.» Put raw buffer ID onto emptyrawbuf Queue.» Jump to arrowhead. If buffer ID NULL.» If state is ABORT Got to Abort Exposure. Otherwise Pass Finish buffer ID to pansaver & go to Wait.» Otherwise 123

Abort Exposure. panprocalg States dump finish data buffer, put on emptyfinbuf Queue. go to Wait for readyfinbufsem. Process verify. Report process health. 124

pansaver State Diagram pansaver State Diagram Reset or Start-up Start-up Complete System Inialization Wait for fullfinbuf Sem Unable to recover from Error Error Recovery Complete Resp onse Failed Send Error Response Re sp on se Sent Semaphore ERROR Give sysrdy Sem sysrdysem Given Semaphore Taken Check Disk Status Disk Full RROR Error Recovery Restart Failed Wait for Disk Space Disk Available sysrdy OK Error Detected Verify Processes Disk Space Available Activate Alternate Disk Try FSaver Restart Process Started sysrdy LOCKED Process Failed Spawn fsaver Process Started sysrdy OK Error Detected Prepare Meta Data Buffers fsaver Processes OK Alternate Disk Ready LOCK sysrdy Alternate Disk Ready Meta Data Ready Reason for Transition State1 State Transition State2 125

Start-up. pansaver States Attach shared memory, Initialize shared memory. Wait for fullfinbufsem. Do a semtake on fullfinbufsem. Check Disk Status In disk Full go to Activate Alternate Disk. Activate Alternate Disk Check Alternate Disk Available. Lock sysrdysem. Collect termination data on previous fsaver programs. 126

Process verify. pansaver States Verify fsaver processes health. Report process health. Prepare Meta Data. Obtain finished image buffer. Prepare meta-data buffers. Spawn fsaver. Provide fsaver with finish Buffer ID. If sysrdysem LOCKED go to Wait for Disk Space. If sysrdysem OK go to Give sysrdysem. 127

Give sysrdysem. pansaver States Give sysrdysem to pandaemon. Wait for Disk Space. Wait until disk space is available on Primary Disk. Move alternate Disk to primary disk. Unlock sysrdysem. Go to give sysrdysem. Send ERROR Response. 128

Try fsaver Restart pansaver States Try to start fsaver if Fail go to Error Recovery. Error Recovery. Determine error state. Correct or abdicate responsibility to user. Clean up file pointers, disk etc. Zero fullfinbuf return to emptyfinbuf Queue. 129

fsaver State Diagram fsaver State Diagram Reset or Start-up Start-up Complete Process Inialization Write Pixel Data Header Written Write ERROR Detected Save Meta Data Frame ID Valid Check Buffer ID Frame ID NULL Write ERROR Detected ERROR Recovery Complete ERROR Recovery Complete Error Recovery Unabl e to reco ver from Error Send ERROR Response Response Sent Response Failed Die Die Die State1 Reason for Transition State Transition State2 130

Start-up. fsaver States Attach shared memory, Initialize shared memory. Check buffer ID. If NULL got to Die! Die! Die! If valid go to save Meta Data. Save Meta-Data. Save Header data to disk. Zero meta-data. 131

Write Pixel Data. fsaver States Save pixel data in buffer to Disk. Zero fullfinbuf, Put on emptyfinbuf Queue. Error Recovery. Is successful return to previous state. If fail go to send ERROR Response. Send ERROR Response. Go to Die, Die, Die! Die, Die, Die! Terminate program. 132

Source Code In-line Documentation 133

/******************************************************************************* In-Line Documentation Examples /******************************************************************************* * * doc \subsection {dheutilopen} * doc \begin{description} * doc \item[\sc use:] \emph{void dheutilopen(long $\star$istat, char $\star$resp, u\_long unit, int $\star$fd, u\_long ($\star$cbfunc()) );} * doc \item[\sc description:] this function opens the DHE and communications device * doc referenced by the unit argument, a Handle to the dhe is returned in the fd argument. * doc The routine runs the dhehdwrinit and dhehdwropen routine to get the dhe ready for use * doc The inherited status is updated and returned. * doc \item[\sc argument(s):] * doc \begin{description} * doc \item[\ ] \ * doc \item[\emph{long $\star$istat}] the inherited status value. * doc \item[\emph{char $\star$resp}] a user supplied buffer for message strings. * doc \item[\emph{u\_long unit}] the unit number to open. * doc \item[\emph{int $\star$fd}] the handle to the open DHE device. * doc \item[\emph{u\_long ($\star$cbfunc())}] a call back function. * doc \end{description} * doc \item[\sc return(s):] void. * doc \item[\sc author(s):] Nick Buchholz (ncb), Phil Daly (pnd) * doc \item[\sc last modified:] Tuesday, 19 November 2002 * doc \item[\sc license:] (c) 2002 AURA Inc. All rights reserved. Released under the GPL. * doc \end{description} * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * ******************************************************************************/ /******************************************************************************* * include(s): *******************************************************************************/ #if!defined(_dheutil_h_) #include "dheutil.h" #endif 134

/*********************************************************************************************** ******************************** * dhehdwropen.c - hardware specific open routine * * doc \subsection {dhehdwr.h{ dhehdwr.h} * doc \begin{description} * doc \item[ item[\sc use:] \emph{void dhehdwropen ( long $\star$status, $ char $\star$response, $ ulong unitnum, dhehandle $\star$dheid $ );} * doc \item[ item[\sc description:] This function handles the details of opening the e dhe device. * doc it checks that the dhe hardware libray has been initialized, opens the communication * doc device, verifies the dhe hardware is connected and if there is a failure or we are simulating * doc it returns SIMULATION_OK. When this routine returns the dhe should be ready to go. * doc \end{description} * * History: * 20020903 - created file for Library - ncb * 20030226 - added function description documentation - ncb * ***********************************************************************************************/ ********************************/ #includes #define DEFAULT_MONSOON_FILE "monsoon.cfg #define DEFAULT_MONSOON_DIR ". void chk4dhehdwr(long *status, /* status return ulong */ char *response, /* optional string response to upper level */ dhehandle dheid /* handle to tell library which DHE to use (usually only one/machine) */ ) 135