From bb00f56727be771cc57f7318a799ef91f42dd9cc Mon Sep 17 00:00:00 2001
From: Daniel van der Schuur <schuur@astron.nl>
Date: Wed, 10 Jun 2015 09:31:45 +0000
Subject: [PATCH] -Removed clutter code.

---
 .../tc_compaan_unb1_dp_offload_bg_lb_dop17.py | 37 ++++++-------------
 1 file changed, 11 insertions(+), 26 deletions(-)

diff --git a/applications/compaan/designs/compaan_unb1_dp_offload/tb/python/tc_compaan_unb1_dp_offload_bg_lb_dop17.py b/applications/compaan/designs/compaan_unb1_dp_offload/tb/python/tc_compaan_unb1_dp_offload_bg_lb_dop17.py
index c72eaa086c..3ca7c13b13 100644
--- a/applications/compaan/designs/compaan_unb1_dp_offload/tb/python/tc_compaan_unb1_dp_offload_bg_lb_dop17.py
+++ b/applications/compaan/designs/compaan_unb1_dp_offload/tb/python/tc_compaan_unb1_dp_offload_bg_lb_dop17.py
@@ -43,41 +43,26 @@ import pi_dp_offload_tx_hdr_dat_unb_dp_offload
 import pi_diag_block_gen
 import pi_eth 
 
-###############################################################################
-# Setup
-###############################################################################
-
-tc = test_case.Testcase('TB - ', '')
-
-c_bg_nof_streams    = 1 
-c_bg_ram_size       = 512 # Only the first 365 words are output
-
-io = node_io.NodeIO(tc.nodeImages, tc.base_ip)
-
-c_eth_dst_mac = 0x2286080000 + tc.unbNrs[0]*0x100
-c_eth_dst_ip  = 0x0A630000   + tc.unbNrs[0]*0x100 
-
+# Instantiate testcase, IO and peripheral classes
+tc            = test_case.Testcase('TB - ', '')
+io            = node_io.NodeIO(tc.nodeImages, tc.base_ip)
 eth           = pi_eth.PiEth(tc, io) 
 dpotx_hdr_dat = pi_dp_offload_tx_hdr_dat_unb_dp_offload.PiDpOffloadTxHdrDatUnbDpOffload(tc, io, nof_inst=1)
-bg            = pi_diag_block_gen.PiDiagBlockGen(tc, io, c_bg_nof_streams, c_bg_ram_size, tc.nodeFn1Nrs )
+bg            = pi_diag_block_gen.PiDiagBlockGen(tc, io, 1, 512, tc.nodeFn1Nrs )
 
-# Enable the UDP port on the 1GbE RX side for stream 0
+# LB: Enable the UDP port on the 1GbE RX side for stream 0.
 eth.write_udp_port_en(0)
 
-# From BG to LB: set dst MAC and IP of node[1] to MAC and IP of node[0] 
+# BG -> LB: set dst MAC and IP of node[1] to MAC and IP of node[0]
+c_eth_dst_mac = 0x2286080000 + tc.unbNrs[0]*0x100
+c_eth_dst_ip  = 0x0A630000   + tc.unbNrs[0]*0x100 
 dpotx_hdr_dat.write(node_nrs=tc.nodeNrs[1], inst_nrs=tc.gpNumbers, registers=[('eth_dst_mac', c_eth_dst_mac + 0)], regmap=dpotx_hdr_dat.regmap)
 dpotx_hdr_dat.write(node_nrs=tc.nodeNrs[1], inst_nrs=tc.gpNumbers, registers=[('ip_dst_ip', c_eth_dst_ip + 0 + 1)], regmap=dpotx_hdr_dat.regmap)
 
-## From LB to DOP17
+# LB ->  DOP17
 dpotx_hdr_dat.write(node_nrs=tc.nodeNrs[0], inst_nrs=tc.gpNumbers, registers=[('eth_dst_mac', 0x0030482D82A1)], regmap=dpotx_hdr_dat.regmap)
 dpotx_hdr_dat.write(node_nrs=tc.nodeNrs[0], inst_nrs=tc.gpNumbers, registers=[('ip_dst_addr', 0x0A6300FE)], regmap=dpotx_hdr_dat.regmap)
 
-# Enable the blockgenerator
-bg.write_enable()   
-    
-###############################################################################
-# end
-###############################################################################
-tc.set_section_id('')
-tc.append_log(0, '>>> Test Case result: %s' % tc.get_result())
+# BG: Enable the blockgenerator
+bg.write_enable()
 
-- 
GitLab