discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] Re: hier_block2 stuff (was: OFDM GRC block attempt)


From: Johnathan Corgan
Subject: [Discuss-gnuradio] Re: hier_block2 stuff (was: OFDM GRC block attempt)
Date: Mon, 17 Sep 2007 13:08:20 -0700
User-agent: Thunderbird 1.5.0.13 (X11/20070824)

Dev Ramudit wrote:

> I'm still not entirely sure what the difference between the hier and
> hier2 versions are? Is there anywhere that discusses this? I've checked
> the wiki and the mailing list with no results.

This will get documented as we release 3.1.

Release 3.1 will have entirely rewritten flow graph construction and
handling code, and will support arbitrarily nested flow graphs. (We're
leaving in the old way of doing things until release 3.2 to give people
time to convert their code.)

Instead of deriving your own flow graph class from gr.flow_graph, you
now derive your own 'top block' class from gr.top_block.

You wire up gr-blocks in the usual way, with self.connect.

Hierarchical blocks can now have arbitrary numbers of input and output
ports.  You derive them from gr.hier_block2 (instead of the old
gr.hier_block), then and in their __init__ function, you tell the parent
class how many ports of each there will be.

Hierarchical blocks can be connected into a flowgraph the same way you'd
connect a gr-block.  Internal to the hierarchical block, you wire the
inputs and outputs to an internally defined flow graph, which can itself
contain hierarchical blocks, etc.

So simple, flat flow graphs work almost identically--substitute
gr.top_block for gr.flow_graph and you're done.

For complex flow graphs, you can now encapsulate a portion of a flow
graph in to a hierarchical block definition, wire the inputs and outputs
to the internal blocks, and use this composite block wherever you'd use
a gr-block.  This kind of nested, hierarchical design allows modularity
and reuse.

As an aside, all the new flow graph code is written in C++.  This allows
compiling pure C++ GNU Radio apps. But it won't be until release 3.2
that the C++ code for the USRP daughterboards, audio handling, build
infrastructure, and C++ only example applications will be completed.

-- 
Johnathan Corgan
Corgan Enterprises LLC
http://corganenterprises.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]