diff --git a/applications/compaan/designs/compaan_unb1_dp_offload/tb/python/tc_compaan_unb1_dp_offload_bg_lb_jop63.py b/applications/compaan/designs/compaan_unb1_dp_offload/tb/python/tc_compaan_unb1_dp_offload_bg_lb_jop63.py new file mode 100644 index 0000000000000000000000000000000000000000..a17a6d094aca2b2b5301e7ac04ad0212b64758b9 --- /dev/null +++ b/applications/compaan/designs/compaan_unb1_dp_offload/tb/python/tc_compaan_unb1_dp_offload_bg_lb_jop63.py @@ -0,0 +1,75 @@ +#! /usr/bin/env python +############################################################################### +# +# Copyright (dC) 2015 +# 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/>. +# +############################################################################### + +# Purpose: +# . Stream BG data from FN1 to FN0, forward this data from FN0 to dop17 +# Description: +# . BG outputs blocks of 365 32b words = 1460 bytes; +# . BG uses inter-block gap size of 9*365 words to limit BG output rate to +# 1/10th of max +# . BG theoretical max output rate is 200MHz*32b = 6.4Gbps +# . The above translates to an ethernet data rate of about (6.4Gbps/10) 640Mbps +# (excluding packet overhead). +# Usage: +# . Load the following images on the following nodes: +# . FN0 - compaan_unb1_dp_offload_lb +# . FN1 - compaan_unb1_dp_offload_bg +# . python tc_compaan_unb1_dp_offload_bg_lb.py --unb # --fn 0,1 +# . Use tcpdump to view the received packets. + +from common import * +import test_case +import node_io +import pi_dp_offload_tx_hdr_dat_unb_dp_offload +import pi_diag_block_gen +import pi_eth + +# 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, 1, 512, tc.nodeFn1Nrs ) + +# LB: Enable the UDP port on the 1GbE RX side for stream 0. +eth.write_udp_port_en(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 +c_mac_jop63 = 0x001B217176B9 +c_ip_jop63 = 0x0A6300FE + +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) + +# 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) + +## From Compaan to JOP63 +dpotx_hdr_dat.write(node_nrs=tc.nodeNrs[0], inst_nrs=tc.gpNumbers, registers=[('eth_dst_mac', c_mac_jop63)], regmap=dpotx_hdr_dat.regmap) +dpotx_hdr_dat.write(node_nrs=tc.nodeNrs[0], inst_nrs=tc.gpNumbers, registers=[('ip_dst_addr', c_ip_jop63)], regmap=dpotx_hdr_dat.regmap) + +# BG: Enable the blockgenerator +#bg.write_enable() +#bg.write_disable()