[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r7778 - in gnuradio/branches/features/inband-usb/usrp:
From: |
gnychis |
Subject: |
[Commit-gnuradio] r7778 - in gnuradio/branches/features/inband-usb/usrp: fpga/rbf fpga/rbf/rev2 fpga/rbf/rev4 host/apps-inband host/lib/inband |
Date: |
Fri, 22 Feb 2008 13:26:22 -0700 (MST) |
Author: gnychis
Date: 2008-02-22 13:26:21 -0700 (Fri, 22 Feb 2008)
New Revision: 7778
Added:
gnuradio/branches/features/inband-usb/usrp/fpga/rbf/rev2/inband_1rxhb_1tx.rbf
gnuradio/branches/features/inband-usb/usrp/fpga/rbf/rev2/inband_2rxhb_2tx.rbf
gnuradio/branches/features/inband-usb/usrp/fpga/rbf/rev4/inband_1rxhb_1tx.rbf
gnuradio/branches/features/inband-usb/usrp/fpga/rbf/rev4/inband_2rxhb_2tx.rbf
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_2rx.cc
Removed:
gnuradio/branches/features/inband-usb/usrp/fpga/rbf/rev2/std_inband.rbf
gnuradio/branches/features/inband-usb/usrp/fpga/rbf/rev4/std_inband.rbf
Modified:
gnuradio/branches/features/inband-usb/usrp/fpga/rbf/Makefile.am
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/Makefile.am
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/gmac.cc
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_2tx.cc
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_overrun.cc
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_registers.cc
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_rx.cc
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_timestamps.cc
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_tx.cc
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_underrun.cc
gnuradio/branches/features/inband-usb/usrp/host/lib/inband/usrp_rx.cc
gnuradio/branches/features/inband-usb/usrp/host/lib/inband/usrp_rx.h
gnuradio/branches/features/inband-usb/usrp/host/lib/inband/usrp_server.cc
gnuradio/branches/features/inband-usb/usrp/host/lib/inband/usrp_server.mbh
gnuradio/branches/features/inband-usb/usrp/host/lib/inband/usrp_usb_interface.cc
Log:
Merging -r7682:7777 from developers/gnychis/inband
Includes host changes to support dual RX channels
Modified: gnuradio/branches/features/inband-usb/usrp/fpga/rbf/Makefile.am
===================================================================
--- gnuradio/branches/features/inband-usb/usrp/fpga/rbf/Makefile.am
2008-02-22 20:18:19 UTC (rev 7777)
+++ gnuradio/branches/features/inband-usb/usrp/fpga/rbf/Makefile.am
2008-02-22 20:26:21 UTC (rev 7778)
@@ -27,9 +27,11 @@
rev2/std_2rxhb_2tx.rbf \
rev2/std_4rx_0tx.rbf \
rev2/std_inband.rbf \
+ rev2/std_inband_dual.rbf \
rev4/std_2rxhb_2tx.rbf \
rev4/std_4rx_0tx.rbf \
rev4/std_inband.rbf \
+ rev4/std_inband_dual.rbf \
rev2/multi_2rxhb_2tx.rbf \
rev4/multi_2rxhb_2tx.rbf
Copied:
gnuradio/branches/features/inband-usb/usrp/fpga/rbf/rev2/inband_1rxhb_1tx.rbf
(from rev 7777,
gnuradio/branches/developers/gnychis/inband/usrp/fpga/rbf/rev2/inband_1rxhb_1tx.rbf)
===================================================================
(Binary files differ)
Copied:
gnuradio/branches/features/inband-usb/usrp/fpga/rbf/rev2/inband_2rxhb_2tx.rbf
(from rev 7777,
gnuradio/branches/developers/gnychis/inband/usrp/fpga/rbf/rev2/inband_2rxhb_2tx.rbf)
===================================================================
(Binary files differ)
Deleted: gnuradio/branches/features/inband-usb/usrp/fpga/rbf/rev2/std_inband.rbf
Copied:
gnuradio/branches/features/inband-usb/usrp/fpga/rbf/rev4/inband_1rxhb_1tx.rbf
(from rev 7777,
gnuradio/branches/developers/gnychis/inband/usrp/fpga/rbf/rev4/inband_1rxhb_1tx.rbf)
===================================================================
(Binary files differ)
Copied:
gnuradio/branches/features/inband-usb/usrp/fpga/rbf/rev4/inband_2rxhb_2tx.rbf
(from rev 7777,
gnuradio/branches/developers/gnychis/inband/usrp/fpga/rbf/rev4/inband_2rxhb_2tx.rbf)
===================================================================
(Binary files differ)
Deleted: gnuradio/branches/features/inband-usb/usrp/fpga/rbf/rev4/std_inband.rbf
Property changes on: gnuradio/branches/features/inband-usb/usrp/host/apps-inband
___________________________________________________________________
Name: svn:ignore
- Makefile
Makefile.in
.la
.lo
.deps
.libs
*.la
*.lo
*.dat
.*.swp
usrper
usrper2
test_input
test_fusb
test_usrp
test_usrp0
test_usrp_standard_rx
test_usrp_standard_tx
test_usrp_standard_2tx
test_usrp_inband_timestamps
test_usrp_inband_registers
test_usrp_inband_rx
test_usrp_inband_tx
test_usrp_basic_rx
check_order_quickly
usrp_cal_dc_offset
test_usrp_inband_cs
read_packets
test_usrp_inband_ping
test_usrp_inband_underrun
test_usrp_inband_overrun
gmac_mbh.cc
test_gmac_tx
+ Makefile
Makefile.in
.la
.lo
.deps
.libs
*.la
*.lo
*.dat
.*.swp
usrper
usrper2
test_input
test_fusb
test_usrp
test_usrp0
test_usrp_standard_rx
test_usrp_standard_tx
test_usrp_standard_2tx
test_usrp_inband_timestamps
test_usrp_inband_registers
test_usrp_inband_rx
test_usrp_inband_2rx
test_usrp_inband_tx
test_usrp_inband_2tx
test_usrp_basic_rx
check_order_quickly
usrp_cal_dc_offset
test_usrp_inband_cs
read_packets
test_usrp_inband_ping
test_usrp_inband_underrun
test_usrp_inband_overrun
gmac_mbh.cc
test_gmac_tx
Modified:
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/Makefile.am
===================================================================
--- gnuradio/branches/features/inband-usb/usrp/host/apps-inband/Makefile.am
2008-02-22 20:18:19 UTC (rev 7777)
+++ gnuradio/branches/features/inband-usb/usrp/host/apps-inband/Makefile.am
2008-02-22 20:26:21 UTC (rev 7778)
@@ -32,6 +32,7 @@
test_usrp_inband_ping \
test_usrp_inband_registers \
test_usrp_inband_rx \
+ test_usrp_inband_2rx \
test_usrp_inband_tx \
test_usrp_inband_2tx \
test_usrp_inband_timestamps \
@@ -84,6 +85,9 @@
test_usrp_inband_rx_SOURCES = test_usrp_inband_rx.cc ui_sincos.c
test_usrp_inband_rx_LDADD = $(USRP_LA) $(USRP_INBAND_LA)
+test_usrp_inband_2rx_SOURCES = test_usrp_inband_2rx.cc ui_sincos.c
+test_usrp_inband_2rx_LDADD = $(USRP_LA) $(USRP_INBAND_LA)
+
test_gmac_tx_SOURCES = test_gmac_tx.cc gmac.cc gmac_mbh.cc ui_sincos.c
test_gmac_tx_LDADD = $(USRP_LA) $(USRP_INBAND_LA)
Modified: gnuradio/branches/features/inband-usb/usrp/host/apps-inband/gmac.cc
===================================================================
--- gnuradio/branches/features/inband-usb/usrp/host/apps-inband/gmac.cc
2008-02-22 20:18:19 UTC (rev 7777)
+++ gnuradio/branches/features/inband-usb/usrp/host/apps-inband/gmac.cc
2008-02-22 20:26:21 UTC (rev 7778)
@@ -359,7 +359,7 @@
// Specify the RBF to use
pmt_dict_set(usrp_dict,
pmt_intern("rbf"),
- pmt_intern("std_inband.rbf"));
+ pmt_intern("inband_1rxhb_1tx.rbf"));
pmt_dict_set(usrp_dict,
pmt_intern("interp-tx"),
Copied:
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_2rx.cc
(from rev 7777,
gnuradio/branches/developers/gnychis/inband/usrp/host/apps-inband/test_usrp_inband_2rx.cc)
===================================================================
---
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_2rx.cc
(rev 0)
+++
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_2rx.cc
2008-02-22 20:26:21 UTC (rev 7778)
@@ -0,0 +1,371 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio 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, or (at your option)
+ * any later version.
+ *
+ * GNU Radio 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, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <mb_mblock.h>
+#include <mb_runtime.h>
+#include <mb_runtime_nop.h> // QA only
+#include <mb_protocol_class.h>
+#include <mb_exception.h>
+#include <mb_msg_queue.h>
+#include <mb_message.h>
+#include <mb_mblock_impl.h>
+#include <mb_msg_accepter.h>
+#include <mb_class_registry.h>
+#include <pmt.h>
+#include <stdio.h>
+#include <string.h>
+#include <iostream>
+#include <fstream>
+
+// Include the symbols needed for communication with USRP server
+#include <symbols_usrp_server_cs.h>
+#include <symbols_usrp_channel.h>
+#include <symbols_usrp_low_level_cs.h>
+#include <symbols_usrp_rx.h>
+
+static bool verbose = true;
+
+class test_usrp_rx : public mb_mblock
+{
+ mb_port_sptr d_rx;
+ mb_port_sptr d_cs;
+ pmt_t d_rx_chan0, d_rx_chan1;
+
+ enum state_t {
+ INIT,
+ OPENING_USRP,
+ ALLOCATING_CHANNEL,
+ RECEIVING,
+ CLOSING_CHANNEL,
+ CLOSING_USRP,
+ };
+
+ state_t d_state;
+
+ std::ofstream d_ofile;
+
+ long d_samples_recvd;
+ long d_samples_to_recv;
+
+ public:
+ test_usrp_rx(mb_runtime *runtime, const std::string &instance_name, pmt_t
user_arg);
+ ~test_usrp_rx();
+ void initial_transition();
+ void handle_message(mb_message_sptr msg);
+
+ protected:
+ void open_usrp();
+ void close_usrp();
+ void allocate_channel();
+ void send_packets();
+ void enter_receiving();
+ void build_and_send_next_frame();
+ void handle_response_recv_raw_samples(pmt_t invocation_handle);
+ void enter_closing_channel();
+};
+
+test_usrp_rx::test_usrp_rx(mb_runtime *runtime, const std::string
&instance_name, pmt_t user_arg)
+ : mb_mblock(runtime, instance_name, user_arg),
+ d_rx_chan0(PMT_NIL), d_rx_chan1(PMT_NIL),
+ d_samples_recvd(0),
+ d_samples_to_recv(20e6)
+{
+ d_rx = define_port("rx0", "usrp-rx", false, mb_port::INTERNAL);
+ d_cs = define_port("cs", "usrp-server-cs", false, mb_port::INTERNAL);
+
+ // Pass a dictionary to usrp_server which specifies which interface to use,
the stub or USRP
+ pmt_t usrp_dict = pmt_make_dict();
+
+ // To test the application without a USRP
+ bool fake_usrp_p = false;
+ if(fake_usrp_p) {
+ pmt_dict_set(usrp_dict,
+ pmt_intern("fake-usrp"),
+ PMT_T);
+ }
+
+ // Specify the RBF to use
+ pmt_dict_set(usrp_dict,
+ pmt_intern("rbf"),
+ pmt_intern("inband_2rxhb_2tx.rbf"));
+
+ pmt_dict_set(usrp_dict,
+ pmt_intern("decim-rx"),
+ pmt_from_long(64));
+
+ define_component("server", "usrp_server", usrp_dict);
+
+ connect("self", "rx0", "server", "rx0");
+ connect("self", "cs", "server", "cs");
+
+}
+
+test_usrp_rx::~test_usrp_rx()
+{
+}
+
+void
+test_usrp_rx::initial_transition()
+{
+ open_usrp();
+}
+
+void
+test_usrp_rx::handle_message(mb_message_sptr msg)
+{
+ pmt_t event = msg->signal();
+ pmt_t data = msg->data();
+
+ pmt_t handle = PMT_F;
+ pmt_t status = PMT_F;
+ std::string error_msg;
+
+ switch(d_state){
+
+ //----------------------------- OPENING_USRP ----------------------------//
+ // We only expect a response from opening the USRP which should be
succesful
+ // or failed.
+ case OPENING_USRP:
+ if (pmt_eq(event, s_response_open)){
+ status = pmt_nth(1, data);
+ if (pmt_eq(status, PMT_T)){
+ allocate_channel();
+ return;
+ }
+ else {
+ error_msg = "failed to open usrp:";
+ goto bail;
+ }
+ }
+ goto unhandled;
+
+ //----------------------- ALLOCATING CHANNELS --------------------//
+ // Allocate an RX channel to perform the overrun test.
+ case ALLOCATING_CHANNEL:
+ if (pmt_eq(event, s_response_allocate_channel)){
+ status = pmt_nth(1, data);
+ if(pmt_eqv(d_rx_chan0, PMT_NIL))
+ d_rx_chan0 = pmt_nth(2, data);
+ else
+ d_rx_chan1 = pmt_nth(2, data);
+
+ if (pmt_eq(status, PMT_T) && !pmt_eqv(d_rx_chan1, PMT_NIL)){
+ enter_receiving();
+ return;
+ }
+ else if(pmt_eq(status, PMT_F)){
+ error_msg = "failed to allocate channel:";
+ goto bail;
+ }
+ return;
+ }
+ goto unhandled;
+
+ //--------------------------- RECEIVING ------------------------------//
+ // In the receiving state, we receive samples until the specified amount
+ // while counting the number of overruns.
+ case RECEIVING:
+ if (pmt_eq(event, s_response_recv_raw_samples)){
+ status = pmt_nth(1, data);
+
+ if (pmt_eq(status, PMT_T)){
+ handle_response_recv_raw_samples(data);
+ return;
+ }
+ else {
+ error_msg = "bad response-xmit-raw-frame:";
+ goto bail;
+ }
+ }
+ goto unhandled;
+
+ //------------------------- CLOSING CHANNEL ----------------------------//
+ // Check deallocation response for the RX channel
+ case CLOSING_CHANNEL:
+ if (pmt_eq(event, s_response_deallocate_channel)){
+ status = pmt_nth(1, data);
+
+ if (pmt_eq(status, PMT_T)){
+ close_usrp();
+ return;
+ }
+ else {
+ error_msg = "failed to deallocate channel:";
+ goto bail;
+ }
+ }
+
+ // Alternately, we ignore all response recv samples while waiting for the
+ // channel to actually close
+ if (pmt_eq(event, s_response_recv_raw_samples))
+ return;
+
+ goto unhandled;
+
+ //--------------------------- CLOSING USRP ------------------------------//
+ // Once we have received a successful USRP close response, we shutdown all
+ // mblocks and exit.
+ case CLOSING_USRP:
+ if (pmt_eq(event, s_response_close)){
+ status = pmt_nth(1, data);
+
+ if (pmt_eq(status, PMT_T)){
+ fflush(stdout);
+ shutdown_all(PMT_T);
+ return;
+ }
+ else {
+ error_msg = "failed to close USRP:";
+ goto bail;
+ }
+ }
+ goto unhandled;
+
+ default:
+ goto unhandled;
+ }
+ return;
+
+ // An error occured, print it, and shutdown all m-blocks
+ bail:
+ std::cerr << error_msg << data
+ << "status = " << status << std::endl;
+ shutdown_all(PMT_F);
+ return;
+
+ // Received an unhandled message for a specific state
+ unhandled:
+ if(verbose && !pmt_eq(event, pmt_intern("%shutdown")))
+ std::cout << "test_usrp_inband_tx: unhandled msg: " << msg
+ << "in state "<< d_state << std::endl;
+}
+
+
+void
+test_usrp_rx::open_usrp()
+{
+ pmt_t which_usrp = pmt_from_long(0);
+
+ d_cs->send(s_cmd_open, pmt_list2(PMT_NIL, which_usrp));
+ d_state = OPENING_USRP;
+
+ if(verbose)
+ std::cout << "[TEST_USRP_INBAND_RX] Opening the USRP\n";
+}
+
+void
+test_usrp_rx::close_usrp()
+{
+
+ d_cs->send(s_cmd_close, pmt_list1(PMT_NIL));
+ d_state = CLOSING_USRP;
+
+ if(verbose)
+ std::cout << "[TEST_USRP_INBAND_RX] Closing the USRP\n";
+}
+
+void
+test_usrp_rx::allocate_channel()
+{
+ long capacity = (long) 16e6;
+ d_rx->send(s_cmd_allocate_channel, pmt_list2(PMT_T,
pmt_from_long(capacity)));
+ d_rx->send(s_cmd_allocate_channel, pmt_list2(PMT_T,
pmt_from_long(capacity)));
+ d_state = ALLOCATING_CHANNEL;
+
+ if(verbose)
+ std::cout << "[TEST_USRP_INBAND_RX] Requesting RX channel allocation\n";
+}
+
+void
+test_usrp_rx::enter_receiving()
+{
+ d_state = RECEIVING;
+
+ d_rx->send(s_cmd_start_recv_raw_samples,
+ pmt_list2(PMT_F,
+ d_rx_chan0));
+
+ d_rx->send(s_cmd_start_recv_raw_samples,
+ pmt_list2(PMT_F,
+ d_rx_chan1));
+
+ if(verbose)
+ std::cout << "[TEST_USRP_INBAND_RX] Receiving...\n";
+}
+
+void
+test_usrp_rx::handle_response_recv_raw_samples(pmt_t data)
+{
+ pmt_t invocation_handle = pmt_nth(0, data);
+ pmt_t status = pmt_nth(1, data);
+ pmt_t v_samples = pmt_nth(2, data);
+ pmt_t timestamp = pmt_nth(3, data);
+ pmt_t channel = pmt_nth(4, data);
+ pmt_t properties = pmt_nth(5, data);
+
+ d_samples_recvd += pmt_length(v_samples) / 4;
+
+ // Check for overrun
+ if(!pmt_is_dict(properties)) {
+ std::cout << "[TEST_USRP_INBAND_RX] Recv samples dictionary is improper\n";
+ return;
+ }
+
+ // Check if the number samples we have received meets the test
+ if(d_samples_recvd >= d_samples_to_recv) {
+ d_rx->send(s_cmd_stop_recv_raw_samples, pmt_list2(PMT_NIL, d_rx_chan0));
+ d_rx->send(s_cmd_stop_recv_raw_samples, pmt_list2(PMT_NIL, d_rx_chan1));
+ enter_closing_channel();
+ return;
+ }
+
+}
+
+void
+test_usrp_rx::enter_closing_channel()
+{
+ d_state = CLOSING_CHANNEL;
+
+ d_rx->send(s_cmd_deallocate_channel, pmt_list2(PMT_NIL, d_rx_chan0));
+ d_rx->send(s_cmd_deallocate_channel, pmt_list2(PMT_NIL, d_rx_chan1));
+
+ if(verbose)
+ std::cout << "[TEST_USRP_INBAND_RX] Deallocating RX channel\n";
+}
+
+REGISTER_MBLOCK_CLASS(test_usrp_rx);
+
+
+// ----------------------------------------------------------------
+
+int
+main (int argc, char **argv)
+{
+ mb_runtime_sptr rt = mb_make_runtime();
+ pmt_t result = PMT_NIL;
+
+ rt->run("top", "test_usrp_rx", PMT_F, &result);
+
+}
Modified:
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_2tx.cc
===================================================================
---
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_2tx.cc
2008-02-22 20:18:19 UTC (rev 7777)
+++
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_2tx.cc
2008-02-22 20:26:21 UTC (rev 7778)
@@ -120,7 +120,7 @@
// Specify the RBF to use
pmt_dict_set(usrp_dict,
pmt_intern("rbf"),
- pmt_intern("std_inband.rbf"));
+ pmt_intern("inband_2rxhb_2tx.rbf"));
// Set TX and RX interpolations
pmt_dict_set(usrp_dict,
Modified:
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_overrun.cc
===================================================================
---
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_overrun.cc
2008-02-22 20:18:19 UTC (rev 7777)
+++
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_overrun.cc
2008-02-22 20:26:21 UTC (rev 7778)
@@ -104,7 +104,7 @@
// Specify the RBF to use
pmt_dict_set(usrp_dict,
pmt_intern("rbf"),
- pmt_intern("std_inband.rbf"));
+ pmt_intern("inband_1rxhb_1tx.rbf"));
pmt_dict_set(usrp_dict,
pmt_intern("decim-rx"),
@@ -308,7 +308,8 @@
pmt_t status = pmt_nth(1, data);
pmt_t v_samples = pmt_nth(2, data);
pmt_t timestamp = pmt_nth(3, data);
- pmt_t properties = pmt_nth(4, data);
+ pmt_t channel = pmt_nth(4, data);
+ pmt_t properties = pmt_nth(5, data);
d_samples_recvd += pmt_length(v_samples) / 4;
Modified:
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_registers.cc
===================================================================
---
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_registers.cc
2008-02-22 20:18:19 UTC (rev 7777)
+++
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_registers.cc
2008-02-22 20:26:21 UTC (rev 7778)
@@ -119,7 +119,7 @@
// Specify the RBF to use
pmt_dict_set(usrp_dict,
pmt_intern("rbf"),
- pmt_intern("std_inband.rbf"));
+ pmt_intern("inband_1rxhb_1tx.rbf"));
// Set TX and RX interpolations
pmt_dict_set(usrp_dict,
Modified:
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_rx.cc
===================================================================
---
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_rx.cc
2008-02-22 20:18:19 UTC (rev 7777)
+++
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_rx.cc
2008-02-22 20:26:21 UTC (rev 7778)
@@ -108,7 +108,7 @@
// Specify the RBF to use
pmt_dict_set(usrp_dict,
pmt_intern("rbf"),
- pmt_intern("std_inband.rbf"));
+ pmt_intern("inband_1rxhb_1tx.rbf"));
pmt_dict_set(usrp_dict,
pmt_intern("decim-rx"),
@@ -312,7 +312,8 @@
pmt_t status = pmt_nth(1, data);
pmt_t v_samples = pmt_nth(2, data);
pmt_t timestamp = pmt_nth(3, data);
- pmt_t properties = pmt_nth(4, data);
+ pmt_t channel = pmt_nth(4, data);
+ pmt_t properties = pmt_nth(5, data);
d_samples_recvd += pmt_length(v_samples) / 4;
Modified:
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_timestamps.cc
===================================================================
---
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_timestamps.cc
2008-02-22 20:18:19 UTC (rev 7777)
+++
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_timestamps.cc
2008-02-22 20:26:21 UTC (rev 7778)
@@ -149,7 +149,7 @@
// Specify the RBF to use
pmt_dict_set(usrp_dict,
pmt_intern("rbf"),
- pmt_intern("std_inband.rbf"));
+ pmt_intern("inband_1rxhb_1tx.rbf"));
define_component("server", "usrp_server", usrp_dict);
Modified:
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_tx.cc
===================================================================
---
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_tx.cc
2008-02-22 20:18:19 UTC (rev 7777)
+++
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_tx.cc
2008-02-22 20:26:21 UTC (rev 7778)
@@ -119,7 +119,7 @@
// Specify the RBF to use
pmt_dict_set(usrp_dict,
pmt_intern("rbf"),
- pmt_intern("std_inband.rbf"));
+ pmt_intern("inband_1rxhb_1tx.rbf"));
// Set TX and RX interpolations
pmt_dict_set(usrp_dict,
Modified:
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_underrun.cc
===================================================================
---
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_underrun.cc
2008-02-22 20:18:19 UTC (rev 7777)
+++
gnuradio/branches/features/inband-usb/usrp/host/apps-inband/test_usrp_inband_underrun.cc
2008-02-22 20:26:21 UTC (rev 7778)
@@ -145,7 +145,7 @@
// Specify the RBF to use
pmt_dict_set(usrp_dict,
pmt_intern("rbf"),
- pmt_intern("std_inband.rbf"));
+ pmt_intern("inband_1rxhb_1tx.rbf"));
// Set TX and RX interpolations
pmt_dict_set(usrp_dict,
Modified: gnuradio/branches/features/inband-usb/usrp/host/lib/inband/usrp_rx.cc
===================================================================
--- gnuradio/branches/features/inband-usb/usrp/host/lib/inband/usrp_rx.cc
2008-02-22 20:18:19 UTC (rev 7777)
+++ gnuradio/branches/features/inband-usb/usrp/host/lib/inband/usrp_rx.cc
2008-02-22 20:26:21 UTC (rev 7778)
@@ -44,13 +44,14 @@
usrp_rx::usrp_rx(mb_runtime *rt, const std::string &instance_name, pmt_t
user_arg)
: mb_mblock(rt, instance_name, user_arg),
- d_disk_write(false),
- d_disk_write_pkt(true) // if true, writes full packet, else just the
payload
+ d_disk_write(true),
+ d_disk_write_pkt(false) // if true, writes full packet, else just the
payload
{
d_cs = define_port("cs", "usrp-rx-cs", true, mb_port::EXTERNAL);
if(d_disk_write) {
- d_ofile.open("rx_data.dat",std::ios::binary|std::ios::out);
+ d_ofile0.open("rx_data_chan0.dat",std::ios::binary|std::ios::out);
+ d_ofile1.open("rx_data_chan1.dat",std::ios::binary|std::ios::out);
d_cs_ofile.open("rx_cs.dat",std::ios::binary|std::ios::out);
}
@@ -61,7 +62,8 @@
usrp_rx::~usrp_rx()
{
if(d_disk_write) {
- d_ofile.close();
+ d_ofile0.close();
+ d_ofile1.close();
d_cs_ofile.close();
}
}
@@ -151,14 +153,22 @@
if(pkt->chan() == CONTROL_CHAN)
d_cs_ofile.write((const char *)pkt, transport_pkt::max_pkt_size());
else {
- if(d_disk_write_pkt)
- d_ofile.write((const char *)pkt, transport_pkt::max_pkt_size());
- else
- d_ofile.write((const char *)pkt->payload(),
transport_pkt::max_payload());
+ if(d_disk_write_pkt) {
+ if(pkt->chan() == 0)
+ d_ofile0.write((const char *)pkt, transport_pkt::max_pkt_size());
+ else if(pkt->chan() == 1)
+ d_ofile1.write((const char *)pkt, transport_pkt::max_pkt_size());
+ } else {
+ if(pkt->chan() == 0)
+ d_ofile0.write((const char *)pkt->payload(),
transport_pkt::max_payload());
+ else if(pkt->chan() == 1)
+ d_ofile1.write((const char *)pkt->payload(),
transport_pkt::max_payload());
+ }
}
d_cs_ofile.flush();
- d_ofile.flush();
+ d_ofile0.flush();
+ d_ofile1.flush();
}
}
Modified: gnuradio/branches/features/inband-usb/usrp/host/lib/inband/usrp_rx.h
===================================================================
--- gnuradio/branches/features/inband-usb/usrp/host/lib/inband/usrp_rx.h
2008-02-22 20:18:19 UTC (rev 7777)
+++ gnuradio/branches/features/inband-usb/usrp/host/lib/inband/usrp_rx.h
2008-02-22 20:26:21 UTC (rev 7778)
@@ -38,7 +38,8 @@
bool d_disk_write;
bool d_disk_write_pkt;
- std::ofstream d_ofile;
+ std::ofstream d_ofile0;
+ std::ofstream d_ofile1;
std::ofstream d_cs_ofile;
public:
Modified:
gnuradio/branches/features/inband-usb/usrp/host/lib/inband/usrp_server.cc
===================================================================
--- gnuradio/branches/features/inband-usb/usrp/host/lib/inband/usrp_server.cc
2008-02-22 20:18:19 UTC (rev 7777)
+++ gnuradio/branches/features/inband-usb/usrp/host/lib/inband/usrp_server.cc
2008-02-22 20:26:21 UTC (rev 7778)
@@ -1293,10 +1293,11 @@
PMT_T);
d_rx[port]->send(s_response_recv_raw_samples,
- pmt_list5(invocation_handle,
+ pmt_list6(invocation_handle,
status,
v_samples,
pmt_from_long(pkt->timestamp()),
+ pmt_from_long(channel),
properties));
return;
}
Modified:
gnuradio/branches/features/inband-usb/usrp/host/lib/inband/usrp_server.mbh
===================================================================
--- gnuradio/branches/features/inband-usb/usrp/host/lib/inband/usrp_server.mbh
2008-02-22 20:18:19 UTC (rev 7777)
+++ gnuradio/branches/features/inband-usb/usrp/host/lib/inband/usrp_server.mbh
2008-02-22 20:26:21 UTC (rev 7778)
@@ -202,7 +202,7 @@
(:incoming
- (response-recv-raw-samples invocation-handle status samples timestamp
properties)
+ (response-recv-raw-samples invocation-handle status samples timestamp
channel properties)
;; samples is a uniform numeric vector. The contents of the sample
;; vector is treated as opaque and is passed from the FPGA
Modified:
gnuradio/branches/features/inband-usb/usrp/host/lib/inband/usrp_usb_interface.cc
===================================================================
---
gnuradio/branches/features/inband-usb/usrp/host/lib/inband/usrp_usb_interface.cc
2008-02-22 20:18:19 UTC (rev 7777)
+++
gnuradio/branches/features/inband-usb/usrp/host/lib/inband/usrp_usb_interface.cc
2008-02-22 20:26:21 UTC (rev 7778)
@@ -342,13 +342,23 @@
return;
}
- if(!d_urx->set_rx_freq (0, -d_rf_freq)) {
+ if(!d_urx->set_rx_freq (0, -d_rf_freq) || !d_urx->set_rx_freq(1,
-d_rf_freq)) {
if (verbose)
std::cout << "[usrp_server] Failed to set center frequency on RX\n";
reply_data = pmt_list2(invocation_handle, PMT_F);
d_cs->send(s_response_usrp_open, reply_data);
return;
}
+
+ // Two channels ... this really needs to end up being set correctly by
+ // querying for what dboards are connected
+ if(!d_urx->set_mux(0x32103210)) {
+ if (verbose)
+ std::cout << "[USRP_USB_INTERFACE] Failed to set RX mux\n";
+ reply_data = pmt_list2(invocation_handle, PMT_F);
+ d_cs->send(s_response_usrp_open, reply_data);
+ return;
+ }
if (verbose)
std::cout << "[USRP_USB_INTERFACE] Setup RX channel\n";
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r7778 - in gnuradio/branches/features/inband-usb/usrp: fpga/rbf fpga/rbf/rev2 fpga/rbf/rev4 host/apps-inband host/lib/inband,
gnychis <=