diff --git a/applications/arts/doc/python/arts_sc1_v1.py b/applications/arts/doc/python/arts_sc1_v1.py new file mode 100644 index 0000000000000000000000000000000000000000..552733b38aebf9cd1126d0a5864ae26b617a5808 --- /dev/null +++ b/applications/arts/doc/python/arts_sc1_v1.py @@ -0,0 +1,115 @@ +############################################################################### +# +# Copyright (C) 2016 +# ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/> +# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands +# +# 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 3 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, see <http://www.gnu.org/licenses/>. +# +############################################################################### + +# Author +# . Daniel van der Schuur +# Purpose +# . Use stream.py to model the ARTS SC1 data path +# Description +# . This stream model matches ASTRON-SP-062, chapter 5. + +############################################################################### +# Import our StreamArray class +############################################################################### +from stream import * + +############################################################################### +# Constants: definitions from SP-062, page 8 +############################################################################### +# Parallel (physical) dimensions +N_DISH = 12 # Number of dishes +N_POL = 2 # Number of polarizations +N_BAND = 16 # Number of bands +N_BU = 4 + +# Serial (time) dimensions +nof_intervals = 0 # Unlimited runtime +T_INT_X = 1.024 # Correlator intergration period +N_INT_X = 800000 # Number of time samples per corrrelator intergration period +N_SLOT = (256, (0, 16383, 1)) # index 0..16383, stepsize 1 = increment horizontally + +# Complex beamlet data width +W_BEAMLET = 6 +N_COMPLEX = 2 +DATA_WIDTH = N_COMPLEX*W_BEAMLET + +############################################################################### +# Equation 1 a +############################################################################### +# StreamArray definition +parallel_definition = (('dish', N_DISH), ('polarization', N_POL), ('band', N_BAND), ('BU', N_BU)) +serial_definition = (('interval', nof_intervals, T_INT_X),('timesample', N_INT_X), ('slot', N_SLOT)) + +CB480 = StreamArray(parallel_definition, serial_definition, DATA_WIDTH, block_size=256, nof_blocks=1) #Set to 0 (=unlimited) for 1b onwards + +print 'CB480', CB480.shape, CB480.get_data_rate(), 'Gbps' + +for i in CB480[0][0][0]: # dish 11, pol 0, band 0 + for bfu in i: # bf unit streams 0..3 + print bfu['slot'] # serial data + + +############################################################################### +# Equation 1 b (NOTE - not in document): forward first 240/256 beamlets +################################################################################ +CB480_sel = dp_split(CB480, 240) + +#print 'CB480_sel', CB480_sel.shape, CB480_sel[0][0][0].get_data_rate(), 'Gbps' +#for i in CB480_sel[0][0][0]: +# for bfu in i: +# print bfu['slot'] + +############################################################################### +# Equation 2: transpose the band and dish (physical) dimensions of CB480 +# . flip dimensions 0 and 2 +############################################################################### +#print 'CB480_sel', CB480_sel.shape +#for i in CB480_sel[0][0][1]: +# for bfu in i: +# print bfu[['dish','band']] + +CB480_T = CB480_sel.transpose((2,1,0,3)) + +#print CB480_T.shape +#for i in CB480_T[0][0][1]: +# for bfu in i: +# print bfu[['dish','band']] + +############################################################################### +# Equation 7: resize dimensions polarizations*dishes = 2*12 to +# processing_nodes*10GbE RX = 8*3 +# . Total reshape: (16*2*12*4 -> 16*8*3*4) +############################################################################### +N_PROCESSING_NODES=8 +N_10G_RX=3 + +CB480_TR = CB480_T.reshape((N_BAND, N_PROCESSING_NODES, N_10G_RX, N_BU)) + +#print CB480_TR.shape +#print CB480_TR[0][0].get_data_rate() # Input data rate on UniBoard 0, FN0 +#for i in CB480_TR[0][0][0]: # beamlets slots incoming on UniBoard0, FN0, RX0 +# for bfu in i: +# print bfu['slot'] + +############################################################################### +# Equation 10: FIXME - Not implemented as documented. +############################################################################### +