Unverified Commit 2630ae61 authored by Giuseppe Carboni's avatar Giuseppe Carboni Committed by GitHub
Browse files

Skarab component (#819)



* implementing new Skarab component

* adapted to skarab component

* skarab components updates

* skarab components updates

---------

Co-authored-by: default avatarCarlo Migoni <migoni@oa-cagliari.inaf.it>
parent 06733f74
Loading
Loading
Loading
Loading
+138 −0
Original line number Diff line number Diff line
/* ******************************************************************************************* */
/* OAC Osservatorio Astronomico di Cagliari                                                    */
/* $Id: Skarab.idl,v 1.1 2011-03-14 14:54:11 c.migoni Exp $				       */
/*                                                                                             */
/* This code is under GNU General Public Licence (GPL).                                        */
/*                                                                                             */
/* Who                                 		When		What                           */
/* Carlo Migoni (migoni@oa-cagliari.inaf.it)	12/05/2015      Creation                       */


#ifndef _SKARAB_IDL_
#define _SKARAB_IDL_

#include <baci.idl>
#include <enumpropMACRO.idl>
#include "GenericBackend.idl"

#pragma prefix "alma"

module Backends {
	
	/**
	 * The Skarab is a digital backend. bla bla bla
	 * <br>
	 * <table border=2>
	 *	<tr><th>Feed</th><th>Carier board</th><th>Backend channel</th></tr>
	 * <tr><td>2L</td><td>1</td><td>Ch0</td></tr>
	 * <tr><td>2R</td><td>2</td><td>Ch1</td></tr>
	 * <tr><td>3L</td><td>3</td><td>Ch2</td></tr>
	 * <tr><td>3R</td><td>4</td><td>Ch3</td></tr>
	 * <tr><td>4L</td><td>5</td><td>Ch4</td></tr>
	 * <tr><td>4R</td><td>6</td><td>Ch5</td></tr>
	 * <tr><td>5L</td><td>7</td><td>Ch6</td></tr>
	 * <tr><td>5R</td><td>8</td><td>Ch7</td></tr>
	 * <tr><td>6L</td><td>9</td><td>Ch8</td></tr>
	 * <tr><td>6R</td><td>10</td><td>Ch9</td></tr>
	 * <tr><td>0L</td><td>11</td><td>Ch10</td></tr>
	 * <tr><td>0R</td><td>12</td><td>Ch11</td></tr>
	 * <tr><td>1L</td><td>13</td><td>Ch12</td></tr>
	 * <tr><td>1R</td><td>14</td><td>Ch13</td></tr>
	 * </table>
	 * With such a cabling in order to configure the input coming from the multi  feed central beam the inputs 10 and 11 must be configured. 
	 * @author <a href=mailto:a.orlati@ira.inaf.it>Andrea Orlati</a>,
	 * Istituto di Radioastronomia, Italia
	 * <br>
	 * @copybrief GenericBackend::time
	 * Since the multi feed total power backend is based on a FPGA that raturns the time with the precision of the second, the reported
	 * time has the same precision.
	 * @copybrief GenericBackend::frequency
	 * The backend has a fixed IF start frequecy which is 100 MHz, up to the bandwidth. The correct sky frequency can be set by changing
	 * the receivers local oscillator.
	 *  @copybrief GenericBackend::bandWidth
	 * The backend provides 4 bandwidths: 2000MHz,1330MHz,825MHz,330MHz. The retunerd sequence is 14 position long,
	 * one for each if section. A zero means that the value if not configured yet.
	 *  @copybrief GenericBackend::attenuation
	 * The values reported here correspond to the analog inputs. The attenuation range goes from 0 to 15.
	 * @copybrief GenericBackend::inputsNumber
	 * This value is hard coded and corresponds to the number of inputs of the backend. 
	 * @copybrief GenericBackend::sampleRate
	 * This value is times in a second that the total power is acquired by the backend. The maximum value is 0.001 Mhz corresponding
	 * to a period of 1 millisecond. 
	 * @copybrief GenericBackend::bins
	 * This value is fixed to 1 and cannot be changed.
	 * @copybrief GenericBackend::integration
	 * In this implementation the integration time is realized by the component using a very simple operation. Since the sample rate
	 * for this backend is somehow an integration time ( a sample rate of 4 Hz for example means that the total power counts are
	 * summed for 0.25 second) every sample is devided by the integration (seconds) and by the sample rate (Hz). Let's give a simple
	 *  example, let's suppose 4Hz of sample rate(K) and 3 seconds of integration(M). That means that the backend will produce an output
	 * every 3 seconds, that output is the average of 12 samples (4 for each of the 3 seconds): 
	 * \f$ U=\sum_{j=1}^M \sum_{i=1}^K \frac{s_{ij}}{MK} \f$.
	 * For better results this value should be a multiple of the sample period.
	 *  @copybrief GenericBackend::polarization
	 * This values cannot be changed since they are fixed by hardware. The even inputs are connected to left polarization, the odd are
	 * right polarization.
	 * @copybrief GenericBackend::status
	 * The bits have the following meaning:
	 * @arg \c 0 if set the backend time is not properly synchronized (error)
	 * @arg \c 1 if set the backend is busy and cannot accept any command
	 * @arg \c 2 if set the backend is in tranfer mode but the transfer is suspended
	 * @arg \c 3 if set the backend is sampling
	 * @arg \c 4 set if the command line is not properly working (error)
	 * @arg \c 5 set if the data lineis not properly working (error)
	 *  @copybrief GenericBackend::setTime()
	 *  In this implementation only the fpga clock is set. The resolution is of one second.
	 * @copybrief GenericBackend::setSection()
	 * Frequency, polarization, feed and bins parameters are ignored since they could not be changed. So the user should provide a negative value
	 * for them, otherwise the component will post a warning log message. Since the backend is not capable of different sample rates, 
	 * the given sampleRate is set for all the inputs.
	 * @copybrief GenericBackend::sendHeader()
	 * In this implementation the preparation for the data transfer takes some seconds. 
	 * @copybrief GenericBackend::sendData()
	 * The call to this method must respect the backend latency time, if not the execution i suspended util that time is matched. 
	 * The component must be suspended (transfer job started but data are not sent) in order for this function to complete succesfully.
	 * @copybrief GenericBackend::sendStop()
	 * The component must be active (not suspended) in order for this function to complete succefully.
	 * @copybrief GenericBackend::getTpi() 
	 * Since the backend is an integrator the user has to take into account that any change will affect the integration after the change. So for example if the cal diode is fired it is wise to
	 * wait twice the integration time in order for  the diode contribution to be fully measured. 
	 * In case a negative is provided as argument the integration set for the 'fast' mode (<i>setIntegration()</i>) is  used.
	 * @copybrief GenericBackend::getZero() 
	 * Since this measure requires an input signal switching the backend is forced to wait two times the integration to allow the
	 * new signal level to stabilize.
	*/
	interface Skarab : GenericBackend {
				
		/**
		 * This method can be called to activate or disactivate the switching of the calibration noise diode. The mode the switching is done is controlled
		 * by the parameter and by the <i>sampleRate</i> attribute. If the component is busy it is not allowed to call this method. This method is
		 * only available if the connected receiver support it. 
		 * @throw ComponentErrors::ComponentErrorsEx
 		 * @throw BackendsErrors::BackendsErrorsEx  
		 * @param interleave this parmater controls the switching frequency of the calibration diode. If it is zero (default) the diode is not 
		 *               switched (always turned off). if a one is given the backend will produce one sample (using the <i>sampleRate</i>)
		 *               with the mark switecehd off and one with the mark switched on. A two means two sample with the mark switched off and
		 * 	          one with the mark switched on.....and so on. A negative will not change the value of the parameter.
		*/
		// void activateNoiseCalibrationSwitching(in long interleave) raises (ComponentErrors::ComponentErrorsEx,BackendsErrors::BackendsErrorsEx);
				
		/**
		 * This method can be used to initialize the backend. Since this hardware can be connected to various receiver some parameter must be set before
		 * any further use. This parameter will stay fixed until a new initilization is issued. At start up a default initialization is commanded but can be 
		 * changed at any time.  If the component is busy it is not allowed to call this method.
 		 * @throw ComponentErrors::ComponentErrorsEx 
 		 * @throw BackendsErrors::BackendsErrorsEx
 		 * @param configuration this string must contain the sequence of character that identifies the configuration that must be loaded. If the sequence is not
 		 *               known an excpetion is thrown
		 */

		void initialize(in string configuration) raises (ComponentErrors::ComponentErrorsEx,BackendsErrors::BackendsErrorsEx);

		void getConfiguration(out string configuration);

		void getCommProtVersion(out string version);
	};
	
};

#endif
+2 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ CDB_SCHEMAS = GenericBackend DigitalXCorrelator Holography CalMuxTable
# 
# IDL Files and flags
# 
IDL_FILES = GenericBackend BackendsBoss TotalPower NoiseGenerator DigitalXCorrelator Holography DBBC DFBInterface Sardara CalDiodeController CalMux
IDL_FILES = GenericBackend BackendsBoss TotalPower NoiseGenerator DigitalXCorrelator Holography DBBC DFBInterface Sardara CalDiodeController CalMux Skarab
IDL_TAO_FLAGS =
USER_IDL =

@@ -49,6 +49,7 @@ HolographyStubs_LIBS = baciStubs GenericBackendStubs
DBBCStubs_LIBS = baciStubs GenericBackendStubs
DFBInterfaceStubs_LIBS = baciStubs GenericBackendStubs
SardaraStubs_LIBS = baciStubs GenericBackendStubs
SkarabStubs_LIBS = baciStubs GenericBackendStubs
CalDiodeControllerStubs_LIBS = baciStubs ComponentErrorsStubs
CalMuxStubs_LIBS = baciStubs ComponentErrorsStubs CalDiodeControllerStubs

+134 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
	- $Id: Skarab.xsd,v 1.3 2011-05-12 14:14:31 a.orlati Exp $
	- Author: Andrea Orlati
	-
	- History:
	-   18-09-2008  Created
-->

<xs:schema
	targetNamespace="urn:schemas-cosylab-com:Skarab:1.0"
	xmlns="urn:schemas-cosylab-com:Skarab:1.0"
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0"
	xmlns:baci="urn:schemas-cosylab-com:BACI:1.0"
	xmlns:mng="urn:schemas-cosylab-com:Managment:1.0"
	xmlns:bcknd="urn:schemas-cosylab-com:GenericBackend:1.0"
	elementFormDefault="qualified"
	attributeFormDefault="unqualified">
	<xs:import namespace="urn:schemas-cosylab-com:CDB:1.0" schemaLocation="CDB.xsd"/>
	<xs:import namespace="urn:schemas-cosylab-com:BACI:1.0" schemaLocation="BACI.xsd"/>
	<xs:import namespace="urn:schemas-cosylab-com:GenericBackend:1.0" schemaLocation="GenericBackend.xsd"/>
	<xs:import namespace="urn:schemas-cosylab-com:Managment:1.0" schemaLocation="Managment.xsd"/>
	
<!--
	<xs:simpleType name="TBkndConfiguration">
		<xs:annotation><xs:documentation>
			Enlist all possible configuration for the backend. many parameters can change for example the number of inputs,
			the input type (BWG,Gregorian....) the used devices and so on. All the configuration are hard coded in the component,
			so in order to add a configuration a piece of code in the component shoud reflect the addition.
		</xs:documentation></xs:annotation>
		<xs:restriction base="xs:string">
	    	<xs:enumeration value="KKC">
				<xs:annotation><xs:documentation>
					the backend is connected to the 14 inputs of the secondary focus 22GHz 7 feeds receiver 
				</xs:documentation></xs:annotation>	
	      	</xs:enumeration>
	    	<xs:enumeration value="CCC">
				<xs:annotation><xs:documentation>
					the backend is connected to the 2 inputs of the secondary focus 5GHz receiver, LCP and RCP are reported respectively 
				</xs:documentation></xs:annotation>	
	      	</xs:enumeration>
	    	<xs:enumeration value="XXP">
				<xs:annotation><xs:documentation>
					the backend is connected to the 2 inputs of the primary focus 8GHz receiver, RCP and LCP are reported respectively 
				</xs:documentation></xs:annotation>	
	      	</xs:enumeration>
		<xs:enumeration value="CCB">
			<xs:annotation><xs:documentation>
					the backend is connected to the 2 inputs of the 7GHz receiver of SRT, RCP and LCP are reported respectively 
				</xs:documentation></xs:annotation>	
		</xs:enumeration>

		</xs:restriction>
	</xs:simpleType>
-->
	
	<xs:complexType name="BackendStatusType">
		<xs:complexContent>
			<xs:restriction base="baci:ROpattern">
				<xs:attribute name="resolution" type="xs:unsignedLong" use="optional" default="64"/>
            	<xs:attribute name="bitDescription" type="xs:string" use="optional" default=
                	"Time_Sync,Busy,Suspended,Sampling,CmdLine,DataLine"/>
				<xs:attribute name="whenSet" type="xs:string" use="optional" default=
                	"0, 1, 1, 1, 0, 0"/>
            	<xs:attribute name="whenCleared" type="xs:string" use="optional" default=
            		"2, 3, 3, 3, 2, 2"/>
			</xs:restriction>
		</xs:complexContent>
	</xs:complexType>	
	
	<xs:complexType name="SkarabType">
		<xs:complexContent>
			<xs:extension base="bcknd:GenericBackendType">
				<xs:sequence>
					<xs:element name="time" type="baci:ROuLongLong" />
					<xs:element name="backendName" type="baci:ROstring" />
					<xs:element name="bandWidth" type="baci:ROdoubleSeq" />
					<xs:element name="frequency" type="baci:ROdoubleSeq" />
					<xs:element name="sampleRate" type="baci:ROdoubleSeq" />
					<xs:element name="attenuation" type="baci:ROdoubleSeq" />
					<xs:element name="polarization" type="baci:ROlongSeq" />
					<xs:element name="bins" type="baci:ROlongSeq" />
					<xs:element name="feed" type="baci:ROlongSeq" />
					<xs:element name="systemTemperature" type="baci:ROdoubleSeq" />
					<xs:element name="inputSection" type="baci:ROlongSeq" />
					<xs:element name="inputsNumber" type="baci:ROlong" />
					<xs:element name="sectionsNumber" type="baci:ROlong" />
					<xs:element name="integration" type="baci:ROlong" />
					<xs:element name="status" type="BackendStatusType" />
					<xs:element name="busy" type="mng:BooleanType" />
				</xs:sequence>
				<xs:attribute name="IPAddress" type="xs:string" use="required" />
				<xs:attribute name="Port" type="xs:unsignedShort" use="required" />
				<!-- timeout (microseconds) applied when trying to connect to the backend -->
				<xs:attribute name="ConnectTimeout" type="xs:unsignedLong" use="required" />
				<!-- timeout (microseconds) applied when trying to receive data from the to the backend -->
				<xs:attribute name="CommandLineTimeout" type="xs:unsignedLong" use="required" />
				<!-- this time (microseconds) is considered validity period of the properties. When this period is elapsed the component will equery
				         again the hardware -->
				<xs:attribute name="PropertyRefreshTime" type="xs:unsignedLong" use="required"/>	
				<!-- indicates the default configuration of the backend -->
				<xs:attribute name="Configuration" type="xs:string" use="required" />
				<!-- Tollerance used when dealing with time synchronization and checks, in particular to deal with jitter beween backend and host computer and with network latencies -->
				<xs:attribute name="TimeTollerance" type="xs:unsignedLong" use="required" />				
				<!-- the cache time (microseconds) for logging repetition filter -->
				<xs:attribute name="RepetitionCacheTime" type="xs:unsignedLong" use="required" />
				<!-- the expire time (microseconds) for logging repetition filter -->
				<xs:attribute name="RepetitionExpireTime" type="xs:unsignedLong" use="required" />
				<!-- data line tcp port -->
				<xs:attribute name="DataPort" type="xs:unsignedShort" use="required" />
				<!-- data line tcp address -->
				<xs:attribute name="DataIPAddress" type="xs:string" use="required" />
				<!-- data line latency (microseconds) -->
				<xs:attribute name="DataLatency" type="xs:unsignedLong" use="required" />
				<!-- Sender thread sleep time (microseconds), sender duty cycle-->
				<xs:attribute name="SenderSleepTime" type="xs:unsignedLong" use="required" />
				<!-- Sender thread response time (microseconds), hart beat time -->
				<xs:attribute name="SenderResponseTime" type="xs:unsignedLong" use="required" />
				<!-- Control thread sleep time (microseconds), that's its duty cycle-->
				<xs:attribute name="ControlSleepTime" type="xs:unsignedLong" use="required" />
				<!-- Control thread response time (microseconds), hart beat time -->
				<xs:attribute name="ControlResponseTime" type="xs:unsignedLong" use="required" />
				<!-- Total number of installed boards-->
				<xs:attribute name="BoardsNumber" type="xs:unsignedLong" use="required" />
				<!-- The size of the data buffer (bytes) -->
				<xs:attribute name="DataBufferSize" type="xs:unsignedLong" use="required" />
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

	<xs:element name="Skarab" type="SkarabType"/>
	
</xs:schema>
+141 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
	- $Id: SkarabSetup.xsd,v 1.1 2011-03-14 14:15:07 a.orlati Exp $
	- Author: Andrea Orlati
	-
	- History:
	-   17-01-2011  Created 
-->

<xs:schema
  targetNamespace="urn:schemas-cosylab-com:SkarabSetup:1.0"
  xmlns="urn:schemas-cosylab-com:SkarabSetup:1.0"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0"
  xmlns:baci="urn:schemas-cosylab-com:BACI:1.0"
  elementFormDefault="qualified"
  attributeFormDefault="unqualified">
	<xs:import namespace="urn:schemas-cosylab-com:CDB:1.0" schemaLocation="CDB.xsd"/>
	<xs:import namespace="urn:schemas-cosylab-com:BACI:1.0" schemaLocation="BACI.xsd"/>

	<xs:simpleType name="EnabledType">
		<xs:restriction base="xs:string">
	    	<xs:enumeration value="TRUE">
				<xs:annotation><xs:documentation>
					boolean true value
				</xs:documentation></xs:annotation>	
	      	</xs:enumeration>
	    	<xs:enumeration value="FALSE">
	    		<xs:annotation><xs:documentation>
	    			boolean flase value
	    		</xs:documentation></xs:annotation>
	    	</xs:enumeration>
		</xs:restriction>
	</xs:simpleType>
	
	<xs:simpleType name="SelectedPortType">
		<xs:annotation><xs:documentation>
			selects which port has to be selected for the present confuguration
		</xs:documentation></xs:annotation>
		<xs:restriction base="xs:string">
	    	<xs:enumeration value="PRIMARY">
				<xs:annotation><xs:documentation>
					the backend will selects input from primary focus
				</xs:documentation></xs:annotation>	
	      	</xs:enumeration>
	    	<xs:enumeration value="BWG">
	    		<xs:annotation><xs:documentation>
	    			the backend will selects input from Beam Wave Guide focus
	    		</xs:documentation></xs:annotation>
	    	</xs:enumeration>
	    	<xs:enumeration value="GREGORIAN">
	    		<xs:annotation><xs:documentation>
	    			the backend will selects input from Gregorian focus
	    		</xs:documentation></xs:annotation>
	    	</xs:enumeration>	    	
		</xs:restriction>
	</xs:simpleType>
	
	<xs:element name="inputPort">
		<xs:simpleType>
			<xs:list itemType="SelectedPortType" />
		</xs:simpleType>
	</xs:element>
	
	<xs:complexType name="TTableHeader">
 		<xs:sequence>
 		  <xs:element name="configurationID" type="xs:string">
 		  	<xs:annotation><xs:documentation>
 		  		identifier of the configuration 
 		  	</xs:documentation></xs:annotation>
 		  </xs:element> 		  	
 		  <xs:element name="sections" type="xs:long">
 		  	<xs:annotation><xs:documentation>
 		  		The number of sections exported for the present configuration
 		  	</xs:documentation></xs:annotation>
 		  </xs:element>
 		  <xs:element name="calSwitchingEnabled" type="EnabledType">
 		  	<xs:annotation><xs:documentation>
 		  		true if the calibration mark switching could be used
 		  	</xs:documentation></xs:annotation>
 		  </xs:element>
 		  <xs:element ref="inputPort" minOccurs="1" maxOccurs="unbounded">
 		  	<xs:annotation><xs:documentation>
 		  		selects from which port the RF inputs has to be taken for the present configuration, if more than one value is provided the inputs
 		  		are configured on sinble board basis. The numbero of enties shoudl be less than the numebr of installed boards. The board not directly
 		  		involved in the configuration (i.e stated on the section_boards section) will be configured with 0 attenuation andd full bandwidth
 		  	</xs:documentation></xs:annotation>
 		  </xs:element> 		  
 		  <xs:element name="beams" type="xs:long">
 		  	<xs:annotation><xs:documentation>
 		  		number of beams of the receiver attached to the backend
 		  	</xs:documentation></xs:annotation>
 		  </xs:element>
 		  <xs:element name="bandWidth" type="xs:double">
 		  	<xs:annotation><xs:documentation>
 		  		this set the default bandwidth of the RF input  
 		  	</xs:documentation></xs:annotation>
 		  </xs:element>
 		  <xs:element name="attenuation" type="xs:double">
 		  	<xs:annotation><xs:documentation>
 		  		this sets the default attenuation of all the RF input  
 		  	</xs:documentation></xs:annotation>
 		  </xs:element> 		  	   		  
 		  <xs:element name="section_boards" type="xs:string">
 		  	<xs:annotation><xs:documentation>
 		  		blank separated lists of boards implementing the section  
 		  	</xs:documentation></xs:annotation>
 		  </xs:element>
 		  <xs:element name="polarizations" type="xs:string">
 		  	<xs:annotation><xs:documentation>
 		  		for each section indicates which polarizations the section is processing, blank separated list  
 		  	</xs:documentation></xs:annotation>
 		  </xs:element> 		  
 		  <xs:element name="feed" type="xs:string">
 		  	<xs:annotation><xs:documentation>
 		  		for each sections indicates which is the linked feed  
 		  	</xs:documentation></xs:annotation>
 		  </xs:element>
 		  <xs:element name="IF" type="xs:string">
 		  	<xs:annotation><xs:documentation>
 		  		for each section, given the feed, indicates which is the linked IF  
 		  	</xs:documentation></xs:annotation>
 		  </xs:element>
		  <xs:element name="bins" type="xs:long">
 		  	<xs:annotation><xs:documentation>
 		  		number of bins of the configuration backend
 		  	</xs:documentation></xs:annotation>
 		  </xs:element>
 		</xs:sequence>
 	</xs:complexType>
  
 	<xs:complexType name="TSkarabSetup">
		<xs:sequence>
			<xs:element name="Configuration" type="TTableHeader" 
			  minOccurs="1" maxOccurs="unbounded" />
		</xs:sequence>
 	</xs:complexType>
  
	<xs:element name="SkarabSetup" type="TSkarabSetup"/>
  	
</xs:schema>
+793 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading