Dear Philipp Niedermayer,

I had reverted to using gr-ettus with gr3.8 (which works with UHD 4.6 after a 
couple of tweaks) and then porting the created blocks to gr3.10 but thanks to 
your valuable insights I should be able to make them directly now. Thank you 
for your help!


Best regards,

Lu'ay

________________________________
From: Philipp Niedermayer <p.niederma...@gsi.de>
Sent: Friday, June 7, 2024 2:11:01 PM
To: Raouak, Lu'ay
Cc: usrp-users@lists.ettus.com
Subject: Re: [USRP-users] Building OOT RFNoC modules for GNURadio 3.10


Dear Luay Raouak,


greetings to DLR! I faced the same issue a while ago and since the Ettus guys 
said that an equivalent for rfnoc modtool will not be realized in the short 
term I invested a lot of time and helped myself by porting the Gain Block 
example/tutorial manually to 3.10.


I now have an OOT module with multiple RFNoC blocks for GR 3.10 and collected 
some useful "Developer hints" in it's README (how to create a module, add a new 
block, implement UHD bindings, implement GR bindings).

Or you could simply look at how I made the "gain block" and related bindings in 
this OOT and copy/adopt it to your needs.

It's available here: 
https://git.gsi.de/p.niedermayer/exciter/-/tree/main/rfnoc-beam_exciter

I have an X310, GR3.10 on Ubuntu 20 or 22 and UHD 4.4 (but I guess 4.6 should 
also work).


Generally, I found that using "uhd.rfnoc_block_generic" in combination with 
properties makes things a lot easier regarding bindings, since it means you 
need much less code and no custom Python bindings.


In 
my_rfnoc_gain.block.yml<https://git.gsi.de/p.niedermayer/exciter/-/blob/cf444ed055274ec826bc0956eed0b94debbab912/rfnoc-beam_exciter/grc/beam_exciter_rfnoc_gain.block.yml>:

templates:
  imports: |-
    from gnuradio import uhd
  make: |-
    uhd.rfnoc_block_generic(
        self.rfnoc_graph,
        uhd.device_addr(""),
        "Gain",
        -1, # device_select
        -1, # instance_index
    )
    self.${id}.set_property('gain', ${constant})
  callbacks:
    - set_property('gain', ${constant})



And in 
gain_block_control.cpp<https://git.gsi.de/p.niedermayer/exciter/-/blob/cf444ed055274ec826bc0956eed0b94debbab912/rfnoc-beam_exciter/lib/gain_block_control.cpp>


property_t<int> _prop_gain = property_t<int>(PROP_GAIN, DEFAULT_GAIN, 
{res_source_info::USER});

void _register_props(){
        register_property(&_prop_gain);
        add_property_resolver({&_prop_gain}, {&_prop_gain}, [this]() {
                this->set_gain_value(this->_prop_gain.get());
        });
}

RFNOC_BLOCK_CONSTRUCTOR(gain_block_control) {
        _register_props();
}

void set_gain_value(const int gain){
        // The gain block from the tutorial only supports integer gain values
        regs().poke32(REG_GAIN, (uint32_t) gain);
}
int get_gain_value(){
        return regs().peek32(REG_GAIN);
}





Regards
Philipp

--
Philipp Niedermayer
p.niederma...@gsi.de<mailto:p.niederma...@gsi.de>

GSI Helmholtzzentrum für Schwerionenforschung GmbH, Planckstraße 1, 64291 
Darmstadt, Germany, www.gsi.de<http://www.gsi.de>
Commercial Register / Handelsregister: Amtsgericht Darmstadt, HRB 1528
Managing Directors / Geschäftsführung: Professor Dr. Paolo Giubellino, Jörg 
Blaurock
Chairman of the GSI Supervisory Board / Vorsitzender des GSI-Aufsichtsrats: 
Ministerialdirigent Dr. Volkmar Dietz





Am 24.05.2024 um 11:31 schrieb luay.raouak--- via USRP-users:

Hello fellow usrp users,


I would like to build custom RFNoC blocks for use with gnuradio 3.10 but I have 
not found any documentation on how to do it for this version. I know that for 
gnuradio 3.8 and lower gr-ettus was utilized to create the grc bindings 
necessary thanks to the RFNoC modtool but with the latter deprecated for 
gnuradio 3.9+ I find myself in a dead end. Has anyone managed to find a way to 
circumvent this issue? Any help would be very much appreciated.


Setup:

Platform: Ubuntu 20.04
Hardware: USRP X310
UHD version: 4.6
GNURadio version: 3.10



Best regards,



_______________________________________________
USRP-users mailing list -- 
usrp-users@lists.ettus.com<mailto:usrp-users@lists.ettus.com>
To unsubscribe send an email to 
usrp-users-le...@lists.ettus.com<mailto:usrp-users-le...@lists.ettus.com>

_______________________________________________
USRP-users mailing list -- usrp-users@lists.ettus.com
To unsubscribe send an email to usrp-users-le...@lists.ettus.com

Reply via email to