Skip to content

Commit f74d3da

Browse files
trondeaujmcorgan
authored andcommitted
gruel: moved gruel into subdirs of gnuradio-runtime.
PMTs are handled slightly different and are installed into their own module and include dir.
1 parent eea0e41 commit f74d3da

File tree

305 files changed

+2144
-1982
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

305 files changed

+2144
-1982
lines changed

CMakeLists.txt

+1-4
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,8 @@ install(
256256
########################################################################
257257
# The following dependency libraries are needed by all gr modules:
258258
########################################################################
259-
list(APPEND GR_TEST_TARGET_DEPS volk gruel gnuradio-runtime)
259+
list(APPEND GR_TEST_TARGET_DEPS volk gnuradio-runtime)
260260
list(APPEND GR_TEST_PYTHON_DIRS
261-
${CMAKE_SOURCE_DIR}/gruel/src/python
262-
${CMAKE_BINARY_DIR}/gruel/src/swig
263261
${CMAKE_BINARY_DIR}/gnuradio-runtime/python
264262
${CMAKE_SOURCE_DIR}/gnuradio-runtime/python
265263
${CMAKE_BINARY_DIR}/gnuradio-runtime/swig
@@ -275,7 +273,6 @@ list(APPEND GR_TEST_PYTHON_DIRS
275273
# Add subdirectories (in order of deps)
276274
########################################################################
277275
add_subdirectory(docs)
278-
add_subdirectory(gruel)
279276
add_subdirectory(gnuradio-runtime)
280277
add_subdirectory(gr-blocks)
281278
add_subdirectory(grc)

docs/doxygen/Doxyfile.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,7 @@ SEARCH_INCLUDES = YES
12541254
# contain include files that are not input files but should be processed by
12551255
# the preprocessor.
12561256

1257-
INCLUDE_PATH = @abs_top_builddir@/gruel/src/lib/pmt/
1257+
INCLUDE_PATH = @abs_top_builddir@/gnuradio-runtime/lib/pmt/
12581258

12591259
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
12601260
# patterns (like *.h and *.hpp) to filter out the header-files in the

docs/doxygen/other/metadata.dox

+1-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ into the metadata to keep track of later. The date in this case is
309309
encoded as a vector of uint16 with [day, month, year].
310310

311311
\code
312-
from gruel import pmt
312+
import pmt
313313
from gnuradio import blocks
314314

315315
key = pmt.intern("date")

docs/doxygen/other/pmt.dox

+2-2
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ reference to the old dictionary. This just keeps our number of
173173
variables small.
174174

175175
\code
176-
from gruel import pmt
176+
import pmt
177177

178178
key0 = pmt.intern("int")
179179
val0 = pmt.from_long(123)
@@ -303,7 +303,7 @@ ready to be written to a file and then deserialize it back to its
303303
original PMT.
304304

305305
\code
306-
from gruel import pmt
306+
import pmt
307307

308308
key0 = pmt.intern("int")
309309
val0 = pmt.from_long(123)

docs/doxygen/other/thread_affinity.dox

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ In the thread-per-block scheduler, you can set the block's core
66
affinity. Each block can be pinned to a group cores or be set back
77
to use the standard kernel scheduler.
88

9-
The implementation is done by adding new functions to the GRUEL
10-
library:
9+
The implementation is done by adding new functions to the threading
10+
section of the gnuradio-runtime library:
1111

1212
\code
1313
gr_thread_t get_current_thread_id();
@@ -21,7 +21,7 @@ library:
2121

2222
The ability to set a thread's affinity to a core or groups of cores is
2323
not implemented in the Boost thread library, and so we have made our
24-
own portability library. In particular, the gruel::gr_thread_t type is
24+
own portability library. In particular, the gr::thread::gr_thread_t type is
2525
defined as the thread type for the given system. The other functions
2626
are designed to be portable as well by calling the specific
2727
implementation for the thread affinity for a particular platform.
@@ -43,7 +43,7 @@ Each block has two new data members:
4343

4444
- threaded: a boolean value that is true if the block is attached to a
4545
thread.
46-
- thread: a gruel::gr_thread_t handle to the block's thread.
46+
- thread: a gr::thread::gr_thread_t handle to the block's thread.
4747

4848
A block can set and unset it's affinity at any time using the
4949
following member functions:

gnuradio-runtime/CMakeLists.txt

-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/ConfigChecks.cmake)
3434
include(GrComponent)
3535
GR_REGISTER_COMPONENT("gnuradio-runtime" ENABLE_GNURADIO_RUNTIME
3636
Boost_FOUND
37-
ENABLE_GRUEL
3837
ENABLE_VOLK
3938
PYTHONINTERP_FOUND
4039
)
@@ -78,7 +77,6 @@ GR_REGISTER_COMPONENT("gr-ctrlport" ENABLE_GR_CTRLPORT
7877
SWIG_FOUND
7978
SWIG_VERSION_CHECK
8079
ICE_FOUND
81-
ENABLE_GRUEL
8280
ENABLE_GNURADIO_RUNTIME
8381
)
8482

gnuradio-runtime/apps/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
########################################################################
2323
include_directories(
2424
${GNURADIO_RUNTIME_INCLUDE_DIRS}
25-
${GRUEL_INCLUDE_DIRS}
2625
${Boost_INCLUDE_DIRS}
2726
)
2827

gnuradio-runtime/include/CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
# the Free Software Foundation, Inc., 51 Franklin Street,
1818
# Boston, MA 02110-1301, USA.
1919

20+
add_subdirectory(messages)
21+
add_subdirectory(pmt)
22+
add_subdirectory(thread)
23+
2024
########################################################################
2125
# Install header files
2226
########################################################################
@@ -87,6 +91,10 @@ install(FILES
8791
rpcserver_ice.h
8892
rpcserver_selector.h
8993
runtime_block_gateway.h
94+
attributes.h
95+
high_res_timer.h
96+
realtime.h
97+
sys_pri.h
9098
DESTINATION ${GR_INCLUDE_DIR}/gnuradio
9199
COMPONENT "runtime_devel"
92100
)

gruel/src/include/gruel/attributes.h gnuradio-runtime/include/attributes.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
* Boston, MA 02110-1301, USA.
2020
*/
2121

22-
#ifndef INCLUDED_GRUEL_ATTRIBUTES_H
23-
#define INCLUDED_GRUEL_ATTRIBUTES_H
22+
#ifndef INCLUDED_GNURADIO_ATTRIBUTES_H
23+
#define INCLUDED_GNURADIO_ATTRIBUTES_H
2424

2525
////////////////////////////////////////////////////////////////////////
2626
// Cross-platform attribute macros
@@ -71,4 +71,4 @@
7171
# pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
7272
#endif
7373

74-
#endif /* INCLUDED_GRUEL_ATTRIBUTES_H */
74+
#endif /* INCLUDED_GNURADIO_ATTRIBUTES_H */

gnuradio-runtime/include/gr_basic_block.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include <deque>
3434
#include <map>
3535
#include <gr_io_signature.h>
36-
#include <gruel/thread.h>
36+
#include <thread/thread.h>
3737
#include <boost/foreach.hpp>
3838
#include <boost/thread/condition_variable.hpp>
3939
#include <iostream>
@@ -68,7 +68,7 @@ class GR_RUNTIME_API gr_basic_block : public gr_msg_accepter, public boost::enab
6868
typedef std::map<pmt::pmt_t, msg_queue_t, pmt::comperator>::iterator msg_queue_map_itr;
6969
std::map<pmt::pmt_t, boost::shared_ptr<boost::condition_variable>, pmt::comperator> msg_queue_ready;
7070

71-
gruel::mutex mutex; //< protects all vars
71+
gr::thread::mutex mutex; //< protects all vars
7272

7373
protected:
7474
friend class gr_flowgraph;

gnuradio-runtime/include/gr_block.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -668,9 +668,9 @@ class GR_RUNTIME_API gr_block : public gr_basic_block {
668668
/*! Used by block's setters and work functions to make
669669
* setting/resetting of parameters thread-safe.
670670
*
671-
* Used by calling gruel::scoped_lock l(d_setlock);
671+
* Used by calling gr::thread::scoped_lock l(d_setlock);
672672
*/
673-
gruel::mutex d_setlock;
673+
gr::thread::mutex d_setlock;
674674

675675
/*! Used by blocks to access the logger system.
676676
*/

gnuradio-runtime/include/gr_block_detail.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include <gr_runtime_types.h>
2828
#include <gr_tpb_detail.h>
2929
#include <gr_tags.h>
30-
#include <gruel/high_res_timer.h>
30+
#include <high_res_timer.h>
3131
#include <stdexcept>
3232

3333
/*!
@@ -169,7 +169,7 @@ class GR_RUNTIME_API gr_block_detail {
169169
void unset_processor_affinity();
170170

171171
bool threaded; // set if thread is currently running.
172-
gruel::gr_thread_t thread; // portable thread handle
172+
gr::thread::gr_thread_t thread; // portable thread handle
173173

174174
void start_perf_counters();
175175
void stop_perf_counters(int noutput_items, int nproduced);
@@ -225,7 +225,7 @@ class GR_RUNTIME_API gr_block_detail {
225225
std::vector<float> d_ins_output_buffers_full;
226226
std::vector<float> d_avg_output_buffers_full;
227227
std::vector<float> d_var_output_buffers_full;
228-
gruel::high_res_timer_type d_start_of_work, d_end_of_work;
228+
gr::high_res_timer_type d_start_of_work, d_end_of_work;
229229
float d_ins_work_time;
230230
float d_avg_work_time;
231231
float d_var_work_time;

gnuradio-runtime/include/gr_buffer.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <gr_runtime_api.h>
2727
#include <gr_runtime_types.h>
2828
#include <boost/weak_ptr.hpp>
29-
#include <gruel/thread.h>
29+
#include <thread/thread.h>
3030
#include <gr_tags.h>
3131
#include <deque>
3232

@@ -89,7 +89,7 @@ class GR_RUNTIME_API gr_buffer {
8989
size_t nreaders() const { return d_readers.size(); }
9090
gr_buffer_reader* reader(size_t index) { return d_readers[index]; }
9191

92-
gruel::mutex *mutex() { return &d_mutex; }
92+
gr::thread::mutex *mutex() { return &d_mutex; }
9393

9494
uint64_t nitems_written() { return d_abs_write_offset; }
9595

@@ -142,7 +142,7 @@ class GR_RUNTIME_API gr_buffer {
142142
// The mutex protects d_write_index, d_abs_write_offset, d_done, d_item_tags
143143
// and the d_read_index's and d_abs_read_offset's in the buffer readers.
144144
//
145-
gruel::mutex d_mutex;
145+
gr::thread::mutex d_mutex;
146146
unsigned int d_write_index; // in items [0,d_bufsize)
147147
uint64_t d_abs_write_offset; // num items written since the start
148148
bool d_done;
@@ -254,7 +254,7 @@ class GR_RUNTIME_API gr_buffer_reader {
254254
void set_done (bool done) { d_buffer->set_done (done); }
255255
bool done () const { return d_buffer->done (); }
256256

257-
gruel::mutex *mutex() { return d_buffer->mutex(); }
257+
gr::thread::mutex *mutex() { return d_buffer->mutex(); }
258258

259259

260260
uint64_t nitems_read() { return d_abs_read_offset; }

gnuradio-runtime/include/gr_feval.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#include <gr_runtime_api.h>
2626
#include <gr_complex.h>
27-
#include <gruel/pmt.h>
27+
#include <pmt/pmt.h>
2828

2929
/*!
3030
* \brief base class for evaluating a function: double -> double

gnuradio-runtime/include/gr_msg_accepter.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
#define INCLUDED_GR_MSG_ACCEPTER_H
2424

2525
#include <gr_runtime_api.h>
26-
#include <gruel/msg_accepter.h>
27-
#include <gruel/pmt.h>
26+
#include <messages/msg_accepter.h>
27+
#include <pmt/pmt.h>
2828

2929
/*!
3030
* \brief Accepts messages and inserts them into a message queue, then notifies
3131
* subclass gr_basic_block there is a message pending.
3232
*/
33-
class GR_RUNTIME_API gr_msg_accepter : public gruel::msg_accepter
33+
class GR_RUNTIME_API gr_msg_accepter : public gr::messages::msg_accepter
3434
{
3535
public:
3636
gr_msg_accepter();

gnuradio-runtime/include/gr_msg_queue.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#include <gr_runtime_api.h>
2626
#include <gr_msg_handler.h>
27-
#include <gruel/thread.h>
27+
#include <thread/thread.h>
2828

2929
class gr_msg_queue;
3030
typedef boost::shared_ptr<gr_msg_queue> gr_msg_queue_sptr;
@@ -37,9 +37,9 @@ GR_RUNTIME_API gr_msg_queue_sptr gr_make_msg_queue(unsigned int limit=0);
3737
*/
3838
class GR_RUNTIME_API gr_msg_queue : public gr_msg_handler {
3939

40-
gruel::mutex d_mutex;
41-
gruel::condition_variable d_not_empty;
42-
gruel::condition_variable d_not_full;
40+
gr::thread::mutex d_mutex;
41+
gr::thread::condition_variable d_not_empty;
42+
gr::thread::condition_variable d_not_full;
4343
gr_message_sptr d_head;
4444
gr_message_sptr d_tail;
4545
unsigned int d_count; // # of messages in queue.

gnuradio-runtime/include/gr_prefs.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <gr_runtime_api.h>
2727
#include <string>
2828
#include <map>
29-
#include <gruel/thread.h>
29+
#include <thread/thread.h>
3030

3131
typedef std::map< std::string, std::map<std::string, std::string> > gr_config_map_t;
3232
typedef std::map< std::string, std::map<std::string, std::string> >::iterator gr_config_map_itr;
@@ -135,7 +135,7 @@ class GR_RUNTIME_API gr_prefs
135135
virtual char * option_to_env(std::string section, std::string option);
136136

137137
private:
138-
gruel::mutex d_mutex;
138+
gr::thread::mutex d_mutex;
139139
gr_config_map_t d_config_map;
140140
};
141141

gnuradio-runtime/include/gr_py_feval.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <gruel/pmt.h>
1+
#include <pmt/pmt.h>
22

33
class gr_py_feval_dd : public gr_feval_dd
44
{

gnuradio-runtime/include/gr_realtime.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
#define INCLUDED_GR_REALTIME_H
2525

2626
#include <gr_runtime_api.h>
27-
#include <gruel/realtime.h>
27+
#include <realtime.h>
2828

29-
typedef gruel::rt_status_t gr_rt_status_t;
29+
typedef gr::rt_status_t gr_rt_status_t;
3030

3131
/*!
3232
* \brief If possible, enable high-priority "real time" scheduling.

gnuradio-runtime/include/gr_runtime_api.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#ifndef INCLUDED_GR_RUNTIME_API_H
2323
#define INCLUDED_GR_RUNTIME_API_H
2424

25-
#include <gruel/attributes.h>
25+
#include <attributes.h>
2626

2727
#ifdef gnuradio_core_EXPORTS
2828
# define GR_RUNTIME_API __GR_ATTR_EXPORT

gnuradio-runtime/include/gr_tags.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#define INCLUDED_GR_TAGS_H
2424

2525
#include <gr_runtime_api.h>
26-
#include <gruel/pmt.h>
26+
#include <pmt/pmt.h>
2727

2828
struct GR_RUNTIME_API gr_tag_t{
2929

gnuradio-runtime/include/gr_tpb_detail.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
#define INCLUDED_GR_TPB_DETAIL_H
2323

2424
#include <gr_runtime_api.h>
25-
#include <gruel/thread.h>
25+
#include <thread/thread.h>
2626
#include <deque>
27-
#include <gruel/pmt.h>
27+
#include <pmt/pmt.h>
2828

2929
class gr_block_detail;
3030

@@ -33,11 +33,11 @@ class gr_block_detail;
3333
*/
3434
struct GR_RUNTIME_API gr_tpb_detail {
3535

36-
gruel::mutex mutex; //< protects all vars
36+
gr::thread::mutex mutex; //< protects all vars
3737
bool input_changed;
38-
gruel::condition_variable input_cond;
38+
gr::thread::condition_variable input_cond;
3939
bool output_changed;
40-
gruel::condition_variable output_cond;
40+
gr::thread::condition_variable output_cond;
4141

4242
public:
4343
gr_tpb_detail()
@@ -61,7 +61,7 @@ struct GR_RUNTIME_API gr_tpb_detail {
6161
//! Called by us
6262
void clear_changed()
6363
{
64-
gruel::scoped_lock guard(mutex);
64+
gr::thread::scoped_lock guard(mutex);
6565
input_changed = false;
6666
output_changed = false;
6767
}
@@ -71,15 +71,15 @@ struct GR_RUNTIME_API gr_tpb_detail {
7171
//! Used by notify_downstream
7272
void set_input_changed()
7373
{
74-
gruel::scoped_lock guard(mutex);
74+
gr::thread::scoped_lock guard(mutex);
7575
input_changed = true;
7676
input_cond.notify_one();
7777
}
7878

7979
//! Used by notify_upstream
8080
void set_output_changed()
8181
{
82-
gruel::scoped_lock guard(mutex);
82+
gr::thread::scoped_lock guard(mutex);
8383
output_changed = true;
8484
output_cond.notify_one();
8585
}

0 commit comments

Comments
 (0)