...
 
Commits (3)
......@@ -173,7 +173,7 @@ def signal_handler(rate, numSyms, signal, frame):
def main():
parser = OptionParser()
parser.add_option("--hub", type="string", dest="hub", help="serial number of the hub device", default="")
parser.add_option("--serials", type="string", dest="serials", help="serial numbers of the devices", default="")
parser.add_option("--serials", type="string", dest="serials", help="serial numbers of the devices", default="RF3E000143,RF3E000160,RF3E000025,RF3E000034")
parser.add_option("--rate", type="float", dest="rate", help="Tx sample rate", default=5e6)
parser.add_option("--freq", type="float", dest="freq", help="Optional Tx freq (Hz)", default=3.6e9)
parser.add_option("--txgain", type="float", dest="txgain", help="Optional Tx gain (dB)", default=30.0)
......
......@@ -684,8 +684,8 @@ def init(hub, bnodes, cnodes, ref_ant, ampl, rate, freq, txgain, rxgain, cp, plo
def main():
parser = OptionParser()
parser.add_option("--args", type="string", dest="args", help="arguments", default="")
parser.add_option("--bnodes", type="string", dest="bnodes", help="file name containing serials on the base station", default="bs_serials.txt")
parser.add_option("--cnodes", type="string", dest="cnodes", help="file name containing serials to be used as clients", default="client_serials.txt")
parser.add_option("--bnodes", type="string", dest="bnodes", help="file name containing serials on the base station", default="../IrisUtils/data_in/bs_serials.txt")
parser.add_option("--cnodes", type="string", dest="cnodes", help="file name containing serials to be used as clients", default="../IrisUtils/data_in/cl_serials.txt")
parser.add_option("--hub", type="string", dest="hub", help="Hub node", default="")
parser.add_option("--ref-ant", type="int", dest="ref_ant", help="Calibration reference antenna", default=0)
parser.add_option("--ampl", type="float", dest="ampl", help="Amplitude coefficient for downCal/upCal", default=0.5)
......
......@@ -5,16 +5,16 @@
NOTE: IRIS BOARDS MUST BE CHAINED FOR THIS SCRIPT TO WORK.
ORDER MATTERS; FIRST NON-REF BOARD (SERIALS) IS THE ONE SENDING THE TRIGGER.
This script is useful watching the recprocity amplitude and phases of
narrow-band (sine) signals between all boards and a reference board .
It programs two Irises in TDD mode with the following framing
schedule.
This script is used for watching the recprocity amplitude and phases of
narrow-band (sine) signals between all boards and a reference board.
The reference board will be the first serial that appears in the bs_serials.txt
file.
It programs two Irises in TDD mode with the a framing schedule.
Example:
python3 NB_CAL_DEMO.py --serials=../IrisUtils/data_in/bs_serials.txt --ref-serial="xxxx"
python3 NB_CAL_DEMO.py --serials=../IrisUtils/data_in/bs_serials.txt
where "xxxx" is the serial number of an Iris node in the base station.
This reference node should not be included in the bs_serials.txt file
---------------------------------------------------------------------
Copyright © 2018-2019. Rice University.
......@@ -240,8 +240,7 @@ def calibrate_array(hub_serial, serials, ref_serial, rate, freq, txgain, rxgain,
def main():
parser = OptionParser()
parser.add_option("--hub-serial", type="string", dest="hub_serial", help="hub serial number of the base station", default="")
parser.add_option("--serials", type="string", dest="serials", help="serial number of all devices", default="bs_serials.txt")
parser.add_option("--ref-serial", type="string", dest="ref_serial", help="reference serial number of the device", default="")
parser.add_option("--serials", type="string", dest="serials", help="serial number of all devices, reference node will be first serial", default="../IrisUtils/data_in/bs_serials.txt")
parser.add_option("--rate", type="float", dest="rate", help="Tx sample rate", default=1e6)
parser.add_option("--txgain", type="float", dest="txgain", help="Optional Tx gain (dB) w/CBRS 3.6GHz [0:105], 2.5GHZ [0:105]", default=30.0)
parser.add_option("--rxgain", type="float", dest="rxgain", help="Optional Rx gain (dB) w/CBRS 3.6GHz [0:105], 2.5GHZ [0:108]", default=30.0)
......@@ -260,10 +259,20 @@ def main():
else:
continue
ref_serial = bserials[0]
if len(bserials) > 1:
bserials = bserials[1::]
else:
print("Need more than one board (in bs_serials.txt) to run calibration")
sys.exit(0)
print("SERIALS (EXCEPT REFERENCE NODE): {}".format(bserials))
print("REFERENCE NODE SERIAL: {}".format(ref_serial))
calibrate_array(
hub_serial=options.hub_serial,
serials=bserials,
ref_serial=options.ref_serial,
ref_serial=ref_serial,
rate=options.rate,
freq=options.freq,
txgain=options.txgain,
......
......@@ -256,7 +256,7 @@ def animate(i, num_samps_rd, rxStream, sdr, sdrTx, ofdm_params, tx_struct, ota,
0, # timeNs (dont care unless using SOAPY_SDR_HAS_TIME)
buff0.size) # numElems - this is the burst size
if agc_en and "CBRS" in infoTx["frontend"]:
if agc_en and "CBRS" in infoRx["frontend"]:
sdr.writeRegister("IRIS30", FPGA_IRIS030_WR_AGC_RESET_FLAG, 1)
sdr.writeRegister("IRIS30", FPGA_IRIS030_WR_AGC_RESET_FLAG, 0)
sdr.writeRegister("IRIS30", FPGA_IRIS030_WR_PKT_DET_NEW_FRAME, 1)
......@@ -277,8 +277,7 @@ def animate(i, num_samps_rd, rxStream, sdr, sdrTx, ofdm_params, tx_struct, ota,
lna1_rd = sdr.getGain(SOAPY_SDR_RX, 0, 'LNA1') # ChanA (0)
lna2_rd = sdr.getGain(SOAPY_SDR_RX, 0, 'LNA2') # ChanA (0)
attn_rd1 = sdr.getGain(SOAPY_SDR_RX, 0, 'ATTN') # ChanA (0)
print("RSSI: {} \t LNA: {} \t TIA: {} \t PGA: {} \t LNA1: {} \t LNA2: {} \t ATTN1: {}".format(rssi_fpga,
lna_rd,
print("LNA: {} \t TIA: {} \t PGA: {} \t LNA1: {} \t LNA2: {} \t ATTN1: {}".format(lna_rd,
tia_rd,
pga_rd,
lna1_rd,
......@@ -288,7 +287,7 @@ def animate(i, num_samps_rd, rxStream, sdr, sdrTx, ofdm_params, tx_struct, ota,
lna_rd = sdr.getGain(SOAPY_SDR_RX, 0, 'LNA') # ChanA (0)
tia_rd = sdr.getGain(SOAPY_SDR_RX, 0, 'TIA') # ChanA (0)
pga_rd = sdr.getGain(SOAPY_SDR_RX, 0, 'PGA') # ChanA (0)
print("RSSI: {} \t LNA: {} \t TIA: {} \t PGA: {}".format(rssi_fpga, lna_rd, tia_rd, pga_rd))
print("LNA: {} \t TIA: {} \t PGA: {}".format(lna_rd, tia_rd, pga_rd))
else:
# Simulation Mode
......@@ -434,13 +433,13 @@ def txrx_app(args, rate, ampl, ant, txgain, rxgain, freq, bbfreq, serialTx, seri
sdrRx = SoapySDR.Device(dict(serial=serialRx))
infoRx = sdrRx.getHardwareInfo()
# AGC - target might need to change for different frequencies (tested with 30 at 3.6GHz)
rssi_target_idx = 30
agc_init(sdrRx, rssi_target_idx, agc_en)
# Reset
sdrRx.writeSetting("RESET_DATA_LOGIC", "")
# AGC - target might need to change for different frequencies (tested with 30 at 3.6GHz)
rssi_target_idx = 25
agc_init(sdrRx, rssi_target_idx, agc_en)
if ant == 'A':
txChannel = [0]
elif ant == 'B':
......@@ -471,8 +470,20 @@ def txrx_app(args, rate, ampl, ant, txgain, rxgain, freq, bbfreq, serialTx, seri
if "CBRS" in infoTx["frontend"]:
# Set gains to high val (initially)
sdr.setGain(SOAPY_SDR_TX, c, txgain) # txgain: at 2.5GHz [16:1:93], at 3.6GHz [15:1:102]
sdr.setGain(SOAPY_SDR_RX, c, rxgain) # rxgain: at 2.5GHz [3:1:105], at 3.6GHz [3:1:102]
#sdr.setGain(SOAPY_SDR_TX, c, txgain) # txgain: at 2.5GHz [16:1:93], at 3.6GHz [15:1:102]
#sdr.setGain(SOAPY_SDR_RX, c, rxgain) # rxgain: at 2.5GHz [3:1:105], at 3.6GHz [3:1:102]
sdr.setGain(SOAPY_SDR_RX, c, 'LNA', 20)
sdr.setGain(SOAPY_SDR_RX, c, 'PGA', 10)
sdr.setGain(SOAPY_SDR_RX, c, 'TIA', 3)
sdr.setGain(SOAPY_SDR_RX, c, 'ATTN', -18)
sdr.setGain(SOAPY_SDR_TX, c, 'PAD', 30)
sdr.setGain(SOAPY_SDR_TX, c, 'IAMP', 0)
sdr.setGain(SOAPY_SDR_TX, c, 'PA1', 17)
sdr.setGain(SOAPY_SDR_TX, c, 'PA2', 14)
sdr.setGain(SOAPY_SDR_TX, c, 'PA3', 31.5)
sdr.setGain(SOAPY_SDR_TX, c, 'ATTN', -6)
else:
# No CBRS board gains, only changing LMS7 gains
sdr.setGain(SOAPY_SDR_TX, c, "PAD", txgain) # [0:1:42]
......@@ -484,8 +495,9 @@ def txrx_app(args, rate, ampl, ant, txgain, rxgain, freq, bbfreq, serialTx, seri
else:
# Simulation Mode
sdrRx = []
infoTx = []
if agc_en and "CBRS" in info["frontend"]:
if agc_en and "CBRS" in infoRx["frontend"]:
sdrRx.writeRegister("IRIS30", FPGA_IRIS030_WR_PKT_DET_ENABLE, 1)
sdrRx.writeRegister("IRIS30", FPGA_IRIS030_WR_AGC_ENABLE_FLAG, 1)
sdrRx.writeRegister("IRIS30", FPGA_IRIS030_WR_PKT_DET_NEW_FRAME, 1)
......@@ -565,7 +577,7 @@ def main():
parser.add_option("--rate", type="float", dest="rate", help="Tx and Rx sample rate", default=5e6)
parser.add_option("--ampl", type="float", dest="ampl", help="Tx digital amplitude scale", default=1)
parser.add_option("--ant", type="string", dest="ant", help="Optional Tx antenna", default="A")
parser.add_option("--txgain", type="float", dest="txgain", help="Tx gain (dB)", default=60.0) # See documentation at top of file for info on gain range
parser.add_option("--txgain", type="float", dest="txgain", help="Tx gain (dB)", default=55.0) # See documentation at top of file for info on gain range
parser.add_option("--rxgain", type="float", dest="rxgain", help="Rx gain (dB)", default=55.0) # See documentation at top of file for info on gain range
parser.add_option("--freq", type="float", dest="freq", help="Tx RF freq (Hz)", default=3.597e9)
parser.add_option("--bbfreq", type="float", dest="bbfreq", help="Lime chip Baseband frequency (Hz)", default=0)
......@@ -575,11 +587,11 @@ def main():
parser.add_option("--nSC", type="int", dest="nSC", help="# of subcarriers. Only supports 64 sc at the moment", default=64)
parser.add_option("--fftOfset", type="int", dest="fftOffset", help="FFT Offset: # of CP samples for FFT", default=6)
parser.add_option("--modOrder", type="int", dest="modOrder", help="Modulation Order 2=BPSK/4=QPSK/16=16QAM/64=64QAM", default=16)
parser.add_option("--serialTx", type="string", dest="serialTx", help="Serial # of TX device", default="")
parser.add_option("--serialRx", type="string", dest="serialRx", help="Serial # of RX device", default="")
parser.add_option("--serialTx", type="string", dest="serialTx", help="Serial # of TX device", default="RF3E000157")
parser.add_option("--serialRx", type="string", dest="serialRx", help="Serial # of RX device", default="RF3E000060")
parser.add_option("--nSampsRead", type="int", dest="nSampsRead", help="# Samples to read", default=FIG_LEN)
parser.add_option("--mode", type="string", dest="mode", help="Simulation vs Over-the-Air (i.e., SIM/OTA)", default="OTA")
parser.add_option("--agc_en", action="store_true", dest="agc_en", help="Flag to enable AGC", default=False) # Only supported if using CBRS board
parser.add_option("--agc_en", action="store_true", dest="agc_en", help="Flag to enable AGC", default=False) # Currently under testing
(options, args) = parser.parse_args()
ofdm_params = [options.nOFDMsym, options.ltsCpLen, options.dataCpLen, options.nSC, options.modOrder, options.fftOffset]
......
......@@ -437,7 +437,7 @@ def main():
parser.add_option("--elevation", type="float", dest="elevation", help="Elevation", default=0.0)
parser.add_option("--freq", type="float", dest="freq", help="Optional Rx freq (Hz)", default=3.6e9)
parser.add_option("--numSamps", type="int", dest="numSamps", help="Num samples to receive", default=16384)
parser.add_option("--serial", type="string", dest="serial", help="Serial number of the device", default="")
parser.add_option("--serial", type="string", dest="serial", help="Serial number of the device", default="RF3E000060")
parser.add_option("--rxMode", type="string", dest="rxMode", help="RX Mode, Options:BASIC/REC/REPLAY", default="BASIC")
parser.add_option("--AGCen", type="int", dest="AGCen", help="Enable AGC Flag. Options:0/1", default=0)
parser.add_option("--wait-trigger", action="store_true", dest="wait_trigger", help="wait for a trigger to start a frame",default=False)
......
......@@ -215,7 +215,7 @@ def main():
parser.add_option("--bbfreq", type="float", dest="bbfreq", help="Lime chip Baseband frequency (Hz)", default=0)
parser.add_option("--waveFreq", type="float", dest="waveFreq", help="Baseband waveform freq (Hz)", default=None)
parser.add_option("--numSamps", type="int", dest="numSamps", help="Num samples to receive", default=1024)
parser.add_option("--serial", type="string", dest="serial", help="serial number of the device", default="")
parser.add_option("--serial", type="string", dest="serial", help="serial number of the device", default="RF3E000157")
parser.add_option("--sigType", type="string", dest="sigType", help="Signal Type: LTE/LTS/STS/SINE", default="SINE")
parser.add_option("--lo-tone", action="store_true", dest="lo_tone", help="generate tone using the LO ", default=False)
(options, args) = parser.parse_args()
......
......@@ -224,8 +224,8 @@ def siso_tdd_burst(serial1, serial2, rate, freq, txgain, rxgain, numSamps, prefi
#########################################
def main():
parser = OptionParser()
parser.add_option("--serial1", type="string", dest="serial1", help="serial number of the device 1", default="")
parser.add_option("--serial2", type="string", dest="serial2", help="serial number of the device 2", default="")
parser.add_option("--serial1", type="string", dest="serial1", help="serial number of the device 1", default="RF3E000143")
parser.add_option("--serial2", type="string", dest="serial2", help="serial number of the device 2", default="RF3E000160")
parser.add_option("--rate", type="float", dest="rate", help="Tx sample rate", default=5e6)
parser.add_option("--txgain", type="float", dest="txgain", help="Tx gain (dB)", default=25.0) # See documentation at top of file for info on gain range
parser.add_option("--rxgain", type="float", dest="rxgain", help="Rx gain (dB)", default=20.0) # See documentation at top of file for info on gain range
......
......@@ -50,7 +50,11 @@
python3 SOUNDER_TXRX.py --bsnode="RF3C000042" --clnode="RF3C000025"
where bsnode corresponds to a base station node and clnode corresponds
to a client node
to a client node.
OUTPUT:
The script will generate binary files that can be analyzed using the
plt_simp.py script in folder PYTHON/IrisUtils/
IMPORTANT NOTE:
The client firmware has different features than the base station node
......@@ -429,7 +433,7 @@ def main():
parser.add_option("--use-trig", action="store_true", dest="use_trig", help="uses chain triggers for synchronization", default=False)
parser.add_option("--wait-trigger", action="store_true", dest="wait_trigger", help="wait for a trigger to start a frame", default=False)
parser.add_option("--tx-power-loop", action="store_true", dest="tx_power_loop", help="loop over a set of tx gains in consecutive frames", default=False)
parser.add_option("--record", action="store_true", dest="record", help="record received pilots and data", default=False)
parser.add_option("--record", action="store_true", dest="record", help="record received pilots and data", default=True)
parser.add_option("--agc-enable", action="store_true", dest="agc_en", help="Enable AGC flag", default=False)
(options, args) = parser.parse_args()
......
RF3C000045
RF3C000025
RF3E000060
RF3E000157