Skip to content
Snippets Groups Projects
Commit 021e7267 authored by Arthur Coolen's avatar Arthur Coolen
Browse files

Make sure blockgenerator is switched off b4 new values are written and

switched on again afterwards
parent f56536fc
Branches
No related tags found
No related merge requests found
......@@ -25,36 +25,70 @@ bg = pi_diag_block_gen.PiDiagBlockGen(tc, io, nofChannels=NOF_BG_OUTPUTS, ramSiz
###############################################################################
# Create an example 2d list of [24 inputs]*[64 channels]
# . All zeros except one input
# . As input 9 contains 64 channels with complex(1); we should see visibility
# 180 (autocorrelation of input 9) containing the value 12500.
# . 12500 = number of accumulations done per channel per integration period (1.024s)
# . 12500*64 channels = 800000 accumulations per integration period in total.
###############################################################################
example_list = [ NOF_CHANNELS*[complex(0)],\
NOF_CHANNELS*[complex(0)],\
NOF_CHANNELS*[complex(0)],\
NOF_CHANNELS*[complex(0)],\
NOF_CHANNELS*[complex(0)],\
NOF_CHANNELS*[complex(0)],\
NOF_CHANNELS*[complex(0)],\
NOF_CHANNELS*[complex(0)],\
NOF_CHANNELS*[complex(0)],\
NOF_CHANNELS*[complex(1)],\
NOF_CHANNELS*[complex(0)],\
NOF_CHANNELS*[complex(0)],\
NOF_CHANNELS*[complex(0)],\
NOF_CHANNELS*[complex(0)],\
NOF_CHANNELS*[complex(0)],\
NOF_CHANNELS*[complex(0)],\
NOF_CHANNELS*[complex(0)],\
NOF_CHANNELS*[complex(0)],\
NOF_CHANNELS*[complex(0)],\
NOF_CHANNELS*[complex(0)],\
NOF_CHANNELS*[complex(0)],\
NOF_CHANNELS*[complex(0)],\
NOF_CHANNELS*[complex(0)],\
NOF_CHANNELS*[complex(0)], ]
#
# list with only prime values on 2nd channel(channel 0 is alwasy flagged), rest channels all zero
# this way the visibilities are at least unique, disadvantage is they will be huge at a certain point
# the lines in list represents RT2 X, RT2 Y, RT3 X, RT3 Y ...... RTD X, RTD Y
# and each line has NOF_CHANNELS inputchannels
#
#example_list = [ (NOF_CHANNELS)*[complex(2)],\
# (NOF_CHANNELS)*[complex(3)],\
# (NOF_CHANNELS)*[complex(4)],\
# (NOF_CHANNELS)*[complex(5)],\
# (NOF_CHANNELS)*[complex(11)],\
# (NOF_CHANNELS)*[complex(13)],\
# (NOF_CHANNELS)*[complex(17)],\
# (NOF_CHANNELS)*[complex(19)],\
# (NOF_CHANNELS)*[complex(23)],\
# (NOF_CHANNELS)*[complex(29)],\
# (NOF_CHANNELS)*[complex(31)],\
# (NOF_CHANNELS)*[complex(37)],\
# (NOF_CHANNELS)*[complex(41)],\
# (NOF_CHANNELS)*[complex(43)],\
# (NOF_CHANNELS)*[complex(47)],\
# (NOF_CHANNELS)*[complex(53)],\
# (NOF_CHANNELS)*[complex(59)],\
# (NOF_CHANNELS)*[complex(61)],\
# (NOF_CHANNELS)*[complex(67)],\
# (NOF_CHANNELS)*[complex(71)],\
# (NOF_CHANNELS)*[complex(73)],\
# (NOF_CHANNELS)*[complex(79)],\
# (NOF_CHANNELS)*[complex(83)],\
# (NOF_CHANNELS)*[complex(89)] ]
#
# List with 1-24 on the first channel rest channels 0, disadvantage is that cross correlations are sometimes the same (p.e. 2x2 is same as 1x4)
# Advantage is that the values will stay small. this might be nicer when you make a plot to look for anomalies
# the lines in list represents RT2 X, RT2 Y, RT3 X, RT3 Y ...... RTD X, RTD Y
# and each line has NOF_CHANNELS inputchannels
#
example_list = [ (NOF_CHANNELS)*[complex(1)],\
(NOF_CHANNELS)*[complex(2)],\
(NOF_CHANNELS)*[complex(3)],\
(NOF_CHANNELS)*[complex(4)],\
(NOF_CHANNELS)*[complex(5)],\
(NOF_CHANNELS)*[complex(6)],\
(NOF_CHANNELS)*[complex(7)],\
(NOF_CHANNELS)*[complex(8)],\
(NOF_CHANNELS)*[complex(9)],\
(NOF_CHANNELS)*[complex(10)],\
(NOF_CHANNELS)*[complex(11)],\
(NOF_CHANNELS)*[complex(12)],\
(NOF_CHANNELS)*[complex(13)],\
(NOF_CHANNELS)*[complex(14)],\
(NOF_CHANNELS)*[complex(15)],\
(NOF_CHANNELS)*[complex(16)],\
(NOF_CHANNELS)*[complex(17)],\
(NOF_CHANNELS)*[complex(18)],\
(NOF_CHANNELS)*[complex(19)],\
(NOF_CHANNELS)*[complex(20)],\
(NOF_CHANNELS)*[complex(21)],\
(NOF_CHANNELS)*[complex(22)],\
(NOF_CHANNELS)*[complex(23)],\
(NOF_CHANNELS)*[complex(24)] ]
bg_list_complex = example_list
......@@ -121,12 +155,14 @@ bg_list = []
for input_signal in bg_list_complex_rewired:
bg_list.append( concat_complex(input_signal, COMPLEX_WIDTH) )
#disable the block generator
bg.write_disable()
###############################################################################
# OVerwrite block gen settings
# . Limit RAM high address to 2*64 channels
###############################################################################
bg.write_block_gen_settings(samplesPerPacket=NOF_BG_SAMPLES_PER_BLOCK, blocksPerSync=800000, gapSize=256-NOF_BG_SAMPLES_PER_BLOCK, memLowAddr=0, memHighAddr=2*NOF_CHANNELS-1, BSNInit=0)
###############################################################################
# Write the 12 waveform RAMs, one stream at a time
# . Our block generators has 12 output streams that carry 24 interleaved correlator inputs streams.
......@@ -137,4 +173,6 @@ for i in range(NOF_BG_OUTPUTS):
# Write this to the BG as RAM contents
bg.write_waveform_ram(ram_contents, i)
#Enable the block generator
bg.write_enable()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment