From 31f4613c8a749a7ed417f868aa5557757f8c0dd8 Mon Sep 17 00:00:00 2001
From: Erik Kooistra <kooistra@astron.nl>
Date: Tue, 28 Nov 2017 14:56:25 +0000
Subject: [PATCH] Remove description of TAsk_1275 branch efforts, because it
 finished. Add how to do rebuild from SVN.

---
 .../apertif_fpga_firmware_overview_erko.txt   | 298 +-----------------
 1 file changed, 10 insertions(+), 288 deletions(-)

diff --git a/applications/apertif/doc/apertif_fpga_firmware_overview_erko.txt b/applications/apertif/doc/apertif_fpga_firmware_overview_erko.txt
index 840ae69ae8..3651240154 100755
--- a/applications/apertif/doc/apertif_fpga_firmware_overview_erko.txt
+++ b/applications/apertif/doc/apertif_fpga_firmware_overview_erko.txt
@@ -76,295 +76,17 @@ $RADIOHDL/applications/apertif/designs/
  python ~/svnroot/UniBoard_FP7/RadioHDL/trunk/tools/oneclick/base/quartus_config.py -t unb1
  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;  run_qcomp unb1 apertif_unb1_correlator_full --seed=1;run_rbf unb1 apertif_unb1_correlator_full
 
- ls
- ll
 
+7) Summary for clean build from SVN
 
-7) SVN branching
-
- mkdir branches
- svn add branches/
- commit -m "Start branching." branches/
- svn info .
- # The ^ is the root of the repository in SVN
- svn ls ^/RadioHDL
-
- # Define simple editor for SVN commit message editing
- export SVN_EDITOR=vim
- echo $SVN_EDITOR
-
- # Create branch from revison 16579 of the trunk and call it Task_<Redmine issue number>
- # Start the commit message with Task #<Redmine issue number>: to provide link for Redmine.
- # Optinal use r<SVN revision number> in the commit message
-
- svn cp ^/RadioHDL/trunk@16579 ^/RadioHDL/branches/Task_1275
- cd branches
- svn up Task_1275
- 
- rbf:17728 resynthesis of Hajee image 16579 on Task_1275 branch works OK.
- 
- cd ~/svnroot/UniBoard_FP7/RadioHDL/branches/Task_1275
- diff -r  . ../../trunk_hajee       # shows diff inside files
- diff -rq . ../../trunk_hajee       # quiet, shows only diff files names
- 
- cntr-alt-F1
- killall -9 gvimdiff
- cntr-alt-F7
- 
- cd ../branches/Task_1275/
- svn log -v -r 16588:HEAD ^/RadioHDL/trunk | more
- svn merge -c 16592 ^/RadioHDL/trunk     # merge changes
- svn merge -r 16596:16658 ^/RadioHDL/trunk     # merge a range of revisions
- svn diff --diff-cmd diff   # toont Merged /RadioHDL/trunk:r16580-16592
- 
-8) To do:
- - ppsh.vhd decrease c_pipeline_output : NATURAL := 100;
- 
-9) Task_1275
-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
-           > svn merge ^/RadioHDL/trunk/libraries/technology
-           > cd base
-           > svn merge ^/RadioHDL/trunk/libraries/base
-           > 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
- 
- 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 --cmd 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 --> Pulsar detected!
-   Conclusion: #1275 is now fixed
-   
+ # Optionally recreate the IP
+ > cd $RADIOHDL/libraries/technology/ip_stratixiv
+ > ./generate-all-ip.sh
    
-#1350 BSN start bug
-- sometimes BSN start not the same on all BN, one or a few BN then have an offset BN
-- for FB 17352 it occurs about once per 500 BN, for FB 17783 it occurs about once per 10 BN, so it is FPGA
-  syhthesis dependend
-- ssh lcu-rtc -X "python $UPE/peripherals/util_ppsh.py --unb 0:7 --bn 0:3 -n 8" PPS stable is ok for all BN,
-  so it does not seem to be an PPS input capture issue
-- ssh lcu-rtc -X "python $UPE/peripherals/pi_bsn_scheduler.py --unb 0:7 --bn 0:3 --cmd 0" shows the offset.
-  The offset can be e.g. (note 800000 = 1.024 s)
-    285351
-    266642
-    257682
-    279232
-    275006
-    300636
-- the offset is nearly the same for all BN, even if they are on different subracks, so there is some central
-  relation, because how could all those offst BN have (nearly) the same offset
-- power cycle dish uniboards, does not help
-- ssh lcu-rtc -X "python $UPE/peripherals/util_bsn_source.py --unb 0:7 --bn 0:3 -n 7" reads current BSN @ sync
-  and these are all equal.
-- ssh lcu-rtc -X "python $UPE/peripherals/util_bsn_source.py --unb 0:7 --bn 0:3 -n 2"       stop BSN source
-  ssh lcu-rtc -X "python $UPE/peripherals/util_bsn_source.py --unb 0:7 --bn 0:3 -n 11 -r 0" init BSN
-  ssh lcu-rtc -X "python $UPE/peripherals/util_bsn_source.py --unb 0:7 --bn 0:3 -n 4"       restart BSN source on PPS also
-  keeps on failing to restart all BN at PPS with same BSN
-- is the bsn_init value written correctly? this cannot be readback.
-- check synthesis report on 'latch', 'sensitivity'
+ # Optionally recreate the build directory and a rbf
+ > rm -rf build/unb1/quartus
+ > 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
 
-ssh lcu-rtc -X "python $UPE/peripherals/util_ppsh.py --unb 0 --bn 0 -n 4 -v 0;\
-                python $UPE/peripherals/pi_bsn_scheduler.py --unb 0 --bn 0 --cmd 0;\
-                python $UPE/peripherals/util_ppsh.py --unb 0 --bn 0 -n 4 -v 0;\
-                python $UPE/peripherals/pi_bsn_scheduler.py --unb 0 --bn 0 --cmd 0"
-- 
GitLab