usrp-users@lists.ettus.com

Discussion and technical support related to USRP, UHD, RFNoC

View all threads

Building OOT RFNoC modules for GNURadio 3.10

LR
luay.raouak@dlr.de
Fri, May 24, 2024 9:31 AM

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,

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,
PN
Philipp Niedermayer
Fri, Jun 7, 2024 12:11 PM

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();
}

voidset_gain_value(constintgain){
//The gain block fromthe tutorial only supports integer gain values
regs().poke32(REG_GAIN, (uint32_t)gain);
}
intget_gain_value(){
returnregs().peek32(REG_GAIN);
}

Regards
Philipp

--
Philipp Niedermayer
p.niedermayer@gsi.de

GSI Helmholtzzentrum für Schwerionenforschung GmbH, Planckstraße 1,
64291 Darmstadt, Germany, 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
To unsubscribe send an email tousrp-users-leave@lists.ettus.com

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(); } voidset_gain_value(constintgain){ //The gain block fromthe tutorial only supports integer gain values regs().poke32(REG_GAIN, (uint32_t)gain); } intget_gain_value(){ returnregs().peek32(REG_GAIN); } Regards Philipp -- Philipp Niedermayer p.niedermayer@gsi.de GSI Helmholtzzentrum für Schwerionenforschung GmbH, Planckstraße 1, 64291 Darmstadt, Germany, 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 > To unsubscribe send an email tousrp-users-leave@lists.ettus.com
LR
luay.raouak@dlr.de
Mon, Jun 10, 2024 7:57 AM

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.niedermayer@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.ymlhttps://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.cpphttps://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.niedermayer@gsi.demailto:p.niedermayer@gsi.de

GSI Helmholtzzentrum für Schwerionenforschung GmbH, Planckstraße 1, 64291 Darmstadt, Germany, www.gsi.dehttp://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.commailto:usrp-users@lists.ettus.com
To unsubscribe send an email to usrp-users-leave@lists.ettus.commailto:usrp-users-leave@lists.ettus.com

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.niedermayer@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.niedermayer@gsi.de<mailto:p.niedermayer@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-leave@lists.ettus.com<mailto:usrp-users-leave@lists.ettus.com>
P
perper@o2.pl
Thu, Jun 13, 2024 3:42 PM

Hello Philipp,

Many thanks for creating an example how to make a grc for gain RFNoC block from the rfnoc-example.

It works and it saved me some time.

Maybe this can be distributed somewhere (with gr-uhd?) or at least shown on some wiki, so it could make life easier for more people in the absence of up-to-date gr-ettus (question to UHD/gr-uhd maintainers)?

Best Regards,
Piotr Krysik

Hello Philipp, Many thanks for creating an example how to make a grc for gain RFNoC block from the rfnoc-example. It works and it saved me some time. Maybe this can be distributed somewhere (with gr-uhd?) or at least shown on some wiki, so it could make life easier for more people in the absence of up-to-date gr-ettus (question to UHD/gr-uhd maintainers)? Best Regards,\ Piotr Krysik