From 814288ec9a583bf4ca09d79a86803b9e331a539e Mon Sep 17 00:00:00 2001
From: Erik Kooistra <kooistra@astron.nl>
Date: Mon, 20 Nov 2017 09:01:48 +0000
Subject: [PATCH] More useful commands.

---
 .../apertif_fpga_firmware_overview_erko.txt   | 206 +++++++++++++++++-
 .../doc/apertif_wsrt_useful_commands_erko.txt |  51 ++++-
 2 files changed, 253 insertions(+), 4 deletions(-)

diff --git a/applications/apertif/doc/apertif_fpga_firmware_overview_erko.txt b/applications/apertif/doc/apertif_fpga_firmware_overview_erko.txt
index 2b53e5a0f2..7b02b67621 100755
--- a/applications/apertif/doc/apertif_fpga_firmware_overview_erko.txt
+++ b/applications/apertif/doc/apertif_fpga_firmware_overview_erko.txt
@@ -121,7 +121,7 @@ $RADIOHDL/applications/apertif/designs/
  - ppsh.vhd decrease c_pipeline_output : NATURAL := 100;
  
 9) Task_1275
- Possible suspects: WPFB, ADUH, node, PPSH, DP
+9a) Possible suspects: WPFB, ADUH, node, PPSH, DP
  r 17739 : Merged /RadioHDL/trunk:r16580-16658 and compaan stuff
  r ..... : Merged technology, base, io (so including ppsh, aduh)
            > cd technology
@@ -131,5 +131,207 @@ $RADIOHDL/applications/apertif/designs/
            > cd io
            > svn merge ^/RadioHDL/trunk/libraries/io
  
+ svn up -r #       # update to -r
+ svn up            # update to HEAD
+ svn status -q     # status van working copy tov laatste svn up -r #
+ svn status -u -q  # status van working copy tov HEAD
+
+9b) Delete and recreate branch
+ Merge per function instead of in sequence, because not every revision yields a stable image. Start with only
+ merging the technology library.
+
+ svn rm ^/RadioHDL/branches/Task_1275  # remove branch directly in SVN, so no need to do svn commit afterwards
+ cd RadioHDL/branches
+ rm -rf Task_1275/                     # remove the working copy with all its local dir and files (e.g. build)
+ svn cp ^/RadioHDL/trunk@16579 ^/RadioHDL/branches/Task_1275/     # recreate the branch
  
- 
\ No newline at end of file
+ 31-10-2017
+ # Merge technology/ from HEAD to Task_1275 working copy
+ cd Task_1275/
+ svn merge ^/RadioHDL/trunk/libraries/technology libraries/technology/
+ generate IP, run_sopc, run_qcomp --> rbf 17744 fails on HW, the mesh BSN monitors at the FN show timeout.
+    Can be an issue with the BSN source, because often one or more BN show an offset in BSN compared to the rest
+    or it can be an issue in tr_nonbonded, because at the FN the top 16 bits of the Rx data are often zero,
+    except for aaaaaaab and 3c3c3c3c, however these words also are sometimes corrupted, possibly this could be
+    due to a corrupt data path with missing sop? The PPSH seems ok, although the BN do not always all have the
+    same toggle level (which may be ok, because only the toggle edges are used and these are aligned).
+    (ssh lcu-rtc -X "python $UPE/peripherals/util_tr_nonbonded.py --unb 4:7 --fn 0:3 -n 6 -s MESH")
+    I think the BSN offset is the cause, but why does it start about 274363 different than on the other BN?
+    Offset 302114 also occurs and then about the same on two BN. The offset can also occur on three BN on
+    different Uniboards and the offset BSN are still nearly similar. The offset can appear as nof_sop in BSN monitor.
+
+ 1-11-2017
+ # Revert Task_1275 and remove any dependencies on trunk:
+   - temporarily rename trunk into trunky
+   - corrected user_components.ipx to use only code from $RADIOHDL
+   - corrected applications/aartfaac/libraries/rsp_terminal/hdllib.cfg to use $RADIOHDL instead of $SVN/RadioHDL/trunk
+     (minor issue that is already fixed on trunk)
+   generate IP, run_sopc, run_qcomp --> rbf 17746 works on HW (cmd 72 passed)
+   
+ # Retry merge technology/ from HEAD to Task_1275 working copy
+   - svn status -q
+   - svn revert -R .
+   - cd ..
+   - rm -rf Task_1275/
+   - svn up Task_1275
+   - cd Task_1275/
+   - svn merge ^/RadioHDL/trunk/libraries/technology libraries/technology/
+   - svn merge ^/RadioHDL/trunk/applications/aartfaac/libraries/rsp_terminal/hdllib.cfg applications/aartfaac/libraries/rsp_terminal/hdllib.cfg
+   - svn diff applications/aartfaac/libraries/rsp_terminal/hdllib.cfg
+   > cd $RADIOHDL/libraries/technology/ip_stratixiv
+   > ./generate-all-ip.sh
+   > python $RADIOHDL/tools/oneclick/base/modelsim_config.py -t unb1
+   > python $RADIOHDL/tools/oneclick/base/quartus_config.py -t unb1
+   > run_sopc unb1 apertif_unb1_bn_filterbank
+   > run_qcomp unb1 apertif_unb1_bn_filterbank       --seed=1;run_rbf unb1 apertif_unb1_bn_filterbank
+   --> rbf 17747 works on HW (cmd 72 OKE)
+   --> Verify with Arts-0 using dish 7 (FB 17747.rbf, BF 17128.rbf) and Arts-SC1 16748.rbf OKE 
+   - svn commit .
+   
+   common_pkg r16850 | schuur | 2017-02-27 13:26:10 +0100 (Mon, 27 Feb 2017) --> ceil_log2(0) := 0
+
+   
+ 6-11-2017
+ # Merge aduh/, common/ from HEAD to Task_1275 working copy
+   - svn merge ^/RadioHDL/trunk/libraries/base/common libraries/base/common
+   - svn merge ^/RadioHDL/trunk/libraries/io/aduh libraries/io/aduh
+   > python $RADIOHDL/tools/oneclick/base/modelsim_config.py -t unb1
+   > python $RADIOHDL/tools/oneclick/base/quartus_config.py -t unb1
+   > python $RADIOHDL/tools/oneclick/base/modelsim_regression_test_vhdl.py -t unb1  -v 5 -l aduh -r   # OKE
+   --> strangely when trunk is there then bsn source start is sometimes offset for some BN therefore used mv trunk/build trunk/buildy as trial
+   --> rbf 17747_buildy detects pulsar
+   - svn commit .
+   
+ 8-11-2017
+   # Merge base/, io/ from HEAD to Task_1275 working copy, comment wpfb_unit_dev and tb in hdllib.cfg
+   --> rbf 17767
+   > python main.py --app arts_sc1 --tel 7 --pol 0,1 --unb 8:15
+   ! ssh lcu-rt7 -X "python $UPE/peripherals/util_system_info.py --unb 0:7 --fn 0:3 --bn 0:3 -n 2"                     # read system info
+   > ssh lcu-rtc -X "python $UPE/peripherals/util_bsn_monitor.py --unb 0:7 --fn 0:3 -n 1 -r 0"                         # verify FN bsn align
+   ! ssh lcu-rt7 -X "python $UPE/peripherals/util_bsn_source.py --unb 0:7 --bn 0:3 -n 7"                               # read current BSN @ sync, all equal
+   ! ssh lcu-rt7 -X "python $UPE/peripherals/pi_bsn_scheduler.py --unb 0:7 --bn 0:3 -n 0"                              # read current BSN immediate, last - first ~< 300 (1.5 us)
+   ! ssh lcu-rt7 -X "python $UPE/peripherals/util_aduh_quad.py --unb 0:7 --bn 0:3 --sp 0:3 -n 0"                       # verify ADUH lock
+   > ssh lcu-rt7 -X "python $UPE/peripherals/pi_apertif_system.py --unb 0:7 --bn 0:3 --sp 0:3 --cmd 40 -v 5"           # read ADUH mean sum: ~< +-2
+   > ssh lcu-rt7 -X "python $UPE/peripherals/pi_apertif_system.py --unb 0:7 --bn 0:3 --sp 0:3 --cmd 41 -v 5"           # read ADUH power: sum effective WG ampl ~15
+   > ssh lcu-rt7 -X "python $UPE/peripherals/util_aduh_monitor.py --unb 3,7 --bn 2 --sp 0 -n 3 -v 5"                   # read ADUH buffer X,Y pol SP 56
+   > ssh lcu-rt7 -X "python $UPE/peripherals/pi_apertif_system.py --unb 3,7 --bn 2 --sp 0 --cmd 43 -v 5"               # plot ADUH buffer X,Y pol samples for SP 56
+   > ssh lcu-rt7 -X "python $UPE/peripherals/util_ppsh.py --unb 0:7 --bn 0:3 -n 8"                                     # verify PPS stable
+   ! ssh lcu-rt7 -X "python $UPE/peripherals/pi_apertif_system.py --unb 0:7 --bn 0:3 --sp 0:3 --cmd 31 -v 4"           # verify F_sub FIR coefficients
+   ! ssh lcu-rt7 -X "python $UPE/peripherals/pi_apertif_system.py --unb 0:7 --bn 0:3 --cmd 5 -v 4"                     # verify R_sub
+   ! ssh lcu-rt7 -X "python $UPE/peripherals/pi_apertif_system.py --unb 0:7 --fn 0:3 --cmd 53 -v 4 --scheme arts_sc1"  # verify R_beam
+   ! ssh lcu-rt7 -X "python $UPE/peripherals/pi_apertif_system.py --unb 0:7 --bn 0:3 --sp 0:3 --cmd 10 -v 5"           # plot SST
+   > ssh lcu-rt7 -X "python $UPE/peripherals/pi_apertif_system.py --unb 0:3 --bn 0:3 --sp 0:3 --cmd 11 -v 5"           # log SST
+   > ssh lcu-rt7 -X "python $UPE/peripherals/pi_apertif_system.py --unb 0:3 --bn 0:3 --sp 0:3 --cmd 12 --pol 0 --globalsp 0:63 -v 5"    # log SST maximum and effictive WG ampl
+   ! ssh lcu-rt7 -X "python $UPE/peripherals/pi_apertif_system.py --unb 0:3 --bn 0:3 --fn 0:3 --sp 0:3 --pol 0 --globalsp 0:39 --weight 32767,0 --cmd 72 -v 3"  # verify X-pol BST
+   ! ssh lcu-rt7 -X "python $UPE/peripherals/pi_apertif_system.py --unb 4:7 --bn 0:3 --fn 0:3 --sp 0:3 --pol 1 --globalsp 0:39 --weight 32767,0 --cmd 72 -v 3"  # verify Y-pol BST
+   --> all oke
+   --> SC1 Pulsar detected
+
+ 9-11-2017
+   # Merge tools/, boards/, applications/apertif from HEAD to Task_1275 working copy
+   - svn merge ^/RadioHDL/trunk/tools tools
+   - svn merge ^/RadioHDL/trunk/boards boards
+   - svn merge ^/RadioHDL/trunk/applications/apertif applications/apertif
+   - svn revert applications/apertif/designs/apertif_unb1_bn_filterbank/src/vhdl/node_apertif_unb1_bn_filterbank.vhd
+   - temporarily define function func_wpfb_set_nof_block_per_sync() in tb_apertif_unb1_bn_filterbank_stimuli_wg.vhd
+   > python $RADIOHDL/tools/oneclick/base/modelsim_config.py -t unb1
+   > python $RADIOHDL/tools/oneclick/base/quartus_config.py -t unb1
+   > run_sopc unb1 apertif_unb1_bn_filterbank
+   > run_qcomp unb1 apertif_unb1_bn_filterbank       --seed=1;run_rbf unb1 apertif_unb1_bn_filterbank
+   --> rbf 17772
+   > python main.py --app arts_sc1 --tel 7 --pol 0,1 --unb 8:15
+   --> SC1 Pulsar detected
+
+10-11-2017
+   - On HEAD
+   > run_qcomp unb1 apertif_unb1_bn_filterbank       --seed=1;run_rbf unb1 apertif_unb1_bn_filterbank
+   --> rbf 17777
+   > python main.py --app arts_sc1 --tel 7 --pol 0,1 --unb 8:15
+   
+   # On branch merge fft/ from HEAD to Task_1275 working copy
+   > run_qcomp unb1 apertif_unb1_bn_filterbank       --seed=1;run_rbf unb1 apertif_unb1_bn_filterbank
+   --> rbf 17772_fft
+   > python main.py --app arts_sc1 --tel 7 --pol 0,1 --unb 8:15
+   --> SC1 Pulsar detected
+
+13-11-2017
+   - svn merge ^/RadioHDL/trunk/libraries/dsp/filter libraries/dsp/filter/
+   > python $RADIOHDL/tools/oneclick/base/quartus_config.py -t unb1
+   > run_qcomp unb1 apertif_unb1_bn_filterbank       --seed=1;run_rbf unb1 apertif_unb1_bn_filterbank
+   --> rbf 17781
+   > python main.py --app arts_sc1 --tel 7 --pol 0,1 --unb 8:15 --opt noflash
+   --> First time one BN had wrong BSN (delta 233681) therefore restarted main.py an then all BSN were equal
+   --> SC1 Pulsar detected
+
+
+14-11-2017
+   - svn merge ^/RadioHDL/trunk/libraries/dsp/wpfb libraries/dsp/wpfb
+   > run_qcomp unb1 apertif_unb1_bn_filterbank       --seed=1;run_rbf unb1 apertif_unb1_bn_filterbank
+   --> rbf 17782
+   --> First time UNB-4, BN-2: read_current_bsn = 1180213750618702 --> diff 304772
+   --> SC1 Pulsar detected
+
+15-11-2017
+   - svn merge ^/RadioHDL/trunk/applications applications
+   > run_qcomp unb1 apertif_unb1_bn_filterbank       --seed=1;run_rbf unb1 apertif_unb1_bn_filterbank
+   --> rbf 17783
+   >>> pol 0 : 1180266288357487 - 1180266288652369 = -294882
+   >>> pol 1 : 1180266288357405 - 1180266288652388 = -294983
+   285351
+   266642
+   257682
+   Try power cycle dish 7 uniboards, does not help
+   279232
+   275006
+   Try main.py pol 0 # BSN oke
+   Try main.py pol 1 # BSN oke
+   Try main.py pol 0,1 # now BSN oke, so continue
+   --> SC1 Pulsar detected 
+   
+   - rm -rf build/unb1/quartus
+   - use wpbf_unit_dev in node_apertif_unb1_bn_filterbank.bak_17783_dev, but with g_big_endian_wb_in=false
+   > python $RADIOHDL/tools/oneclick/base/quartus_config.py -t unb1
+   > run_sopc unb1 apertif_unb1_bn_filterbank
+   > run_qcomp unb1 apertif_unb1_bn_filterbank       --seed=1;run_rbf unb1 apertif_unb1_bn_filterbank
+   --> rbf 17783_dev
+   > python main.py --app arts_sc1 --tel 7 --pol 0,1 --unb 8:15
+   --> SC1 Pulsar not detected!
+   
+16-11-2017
+   - cp applications/apertif/designs/apertif_unb1_bn_filterbank/src/vhdl/node_apertif_unb1_bn_filterbank.vhd applications/apertif/designs/apertif_unb1_bn_filterbank/src/vhdl/node_apertif_unb1_bn_filterbank.bak_17783_dev
+   > run_qcomp unb1 apertif_unb1_bn_filterbank       --seed=1;run_rbf unb1 apertif_unb1_bn_filterbank
+   -rbf 17783_astrunk
+   --> SC1 Pulsar not detected! (as expected because branch is now same as trunk)
+   
+   - rm -rf build/unb1/quartus
+   - use wpbf_unit_dev with old blockgen and node_apertif_unb1_bn_filterbank.bak_17783_dev (so with g_big_endian_wb_in=false)
+   > python $RADIOHDL/tools/oneclick/base/quartus_config.py -t unb1
+   > run_sopc unb1 apertif_unb1_bn_filterbank
+   > run_qcomp unb1 apertif_unb1_bn_filterbank       --seed=1;run_rbf unb1 apertif_unb1_bn_filterbank
+   --> rbf 17783_blkgen
+   > python main.py --app arts_sc1 --tel 7 --pol 0,1 --unb 8:15
+   --> SC1 Pulsar detected!
+   
+17-11-2017
+   - rm -rf build/unb1/quartus
+   - use wpbf_unit_dev with new blockgen and node_apertif_unb1_bn_filterbank.bak_17783_dev (so with g_big_endian_wb_in=false)
+   > python $RADIOHDL/tools/oneclick/base/quartus_config.py -t unb1
+   > run_sopc unb1 apertif_unb1_bn_filterbank
+   > run_qcomp unb1 apertif_unb1_bn_filterbank       --seed=1;run_rbf unb1 apertif_unb1_bn_filterbank
+   --> rbf 17783_newblkgen
+   > python main.py --app arts_sc1 --tel 7 --pol 0,1 --unb 8:15
+   --> SC1 Pulsar not detected --> so it must be due to the local BSN that is not recognized by SC1 pipeline
+   
+20-11-2017
+   - Created dp_bsn_restore_global.vhd and use it in dp_block_gen_valid_arr
+   - rm -rf build/unb1
+   > python $RADIOHDL/tools/oneclick/base/modelsim_config.py -t unb1
+   > python $RADIOHDL/tools/oneclick/base/quartus_config.py -t unb1
+   > run_sopc unb1 apertif_unb1_bn_filterbank
+   > run_sopc unb1 apertif_unb1_fn_beamformer_trans
+   > tb_apertif_unb1_bn_filterbank_stimuli_wg --> ok
+   > run_qcomp unb1 apertif_unb1_bn_filterbank --seed=1;run_rbf unb1 apertif_unb1_bn_filterbank; run_qcomp unb1 apertif_unb1_fn_beamformer_trans --seed=1;run_rbf unb1 apertif_unb1_fn_beamformer_trans
+   --> fb rbf 17790
+   --> bf rbf 17790
+   --> SC1 Pulsar fb 17790 + bf 17128 --> Pulsar detected!
+   --> SC1 Pulsar fb 17790 + bf 17790 --> ????
diff --git a/applications/apertif/doc/apertif_wsrt_useful_commands_erko.txt b/applications/apertif/doc/apertif_wsrt_useful_commands_erko.txt
index 8314433690..ebde1813be 100755
--- a/applications/apertif/doc/apertif_wsrt_useful_commands_erko.txt
+++ b/applications/apertif/doc/apertif_wsrt_useful_commands_erko.txt
@@ -168,6 +168,29 @@ Flash original latest images (email Boudewijn 6 feb 2017) using the GUI:
 Check that data runs on DW:
 - watch -n 0.01 ifconfig 
 
+# Arts-0
+
+ssh -Y apertif@wop46
+4p3rt1f
+ssh -Y schuur@192.168.6.42
+same pwd
+cd arts_testing
+
+Check the packet rate
+python ../../arts/scripts/packet_rate.py
+. p4p1  bands  0:3
+. p4p2  bands  4:7
+. p3p1  bands  8:11
+. p3p2  bands 12:15
+
+#sudo /usr/sbin/tcpdump -vvxSnelfi p4p2 -c 50 -n dst port 5000 -w dumpfile
+sudo /usr/sbin/tcpdump -vvxSnelfi p3p1 -c 1 -n dst port 4008
+
+#python arts_sc1_pcap.py dumpfile 50 | less
+
+ssh -X apertif@ccu-corr.apertif
+ssh -X arts@ccu-corr.apertif
+
 
 ###############################################################################
 # Trials
@@ -254,6 +277,30 @@ ssh lcu-rtc -X "python $UPE/peripherals/pi_dp_fifo_monitor.py --unb 0:7 --fn 0:3
 ssh lcu-rtc -X "python $UPE/peripherals/util_tr_nonbonded.py --unb 0:7 --fn 0:3 --bn 0:3 -n 7 -s MESH"
 ssh lcu-rtc -X "python $UPE/peripherals/util_tr_nonbonded.py --unb 0:7 --bn 0:3 -n 7 -s BACK"
 
+# BSN count
+ssh lcu-rtc -X "python $UPE/peripherals/util_bsn_source.py --unb 0:7 --bn 0:3 -n 7"   # read current BSN @ sync
+ssh lcu-rtc -X "python $UPE/peripherals/pi_bsn_scheduler.py --unb 0:7 --bn 0:3 -n 0"   # read current BSN immediate
+
+###############################################################################
+# Load application image
+    
+# From dish_commands.sh
+ssh lcu-rtc -X "python $UPE/peripherals/util_ppsh.py --unb 0 --bn 0 -n 4;\
+                python $UPE/peripherals/util_epcs.py --unb 0:7 --fn 0:3 --bn 0:3 -n 8;\
+                sleep 4;\
+                python $UPE/peripherals/util_system_info.py --unb $UNBS --fn 0:3 --bn 0:3 -n 4;\
+                python $UPE/peripherals/util_system_info.py --unb $UNBS --fn 0:3 --bn 0:3 -n 2"
+
+###############################################################################
+# Central status
+
+# Correlator BSN status
+python $UPE/peripherals/util_bsn_monitor.py --unb 0:1 --fn 0:3 --bn 0:3 -n 1 -r 4 -s MESH
+
+python $UPE/peripherals/pi_dp_sync_checker.py --unb 0:1 --fn 0:3 --bn 0:3 --reg nof_early_syncs,nof_late_syncs"
+
+# Arts BSN status
+python $UPE/peripherals/util_bsn_monitor.py --unb 8:15 --fn 0:3 --bn 0:3 -n 1 -r 4 -s MESH
 
 ###############################################################################
 # Read sensors
@@ -431,8 +478,8 @@ ssh lcu-rtc -X "python $UPE/peripherals/pi_apertif_system.py --unb 0:7 --fn 0:3
 ssh lcu-rtc -X "python $UPE/peripherals/pi_apertif_system.py --unb 0:7 --fn 0:3 --cmd 521 -v 4"  # Arts SC4
 
 # Read and verify Rbeam
-ssh lcu-rtc -X "python $UPE/peripherals/pi_apertif_system.py --unb 0:7 --fn 0:3 --cmd 53 -v 4 --scheme Arts_SC1"       # read and verify
-ssh lcu-rtc -X "python $UPE/peripherals/pi_apertif_system.py --unb 0:7 --fn 0:3 --cmd 53 -v 4 --scheme Arts_SC4"       # read and verify
+ssh lcu-rtc -X "python $UPE/peripherals/pi_apertif_system.py --unb 0:7 --fn 0:3 --cmd 53 -v 4 --scheme arts_sc1"       # read and verify
+ssh lcu-rtc -X "python $UPE/peripherals/pi_apertif_system.py --unb 0:7 --fn 0:3 --cmd 53 -v 4 --scheme arts_sc4"       # read and verify
         
 # Write BF weights for single pixel CB
 ssh lcu-rtc -X "python $UPE/peripherals/pi_apertif_system.py --unb 0:7 --fn 0:3 --cmd 620 -v 4"  # SP 56, only CB 0 (Arts SC1)
-- 
GitLab