Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GRC C++ generation #36

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions apps/dvbs2-rx
Original file line number Diff line number Diff line change
Expand Up @@ -852,10 +852,18 @@ class DVBS2RxTopBlock(gr.top_block, Qt.QWidget):
sink_block : The block consuming the MPEG TS output stream.

"""
translated_params = dvbs2rx.params.translate('DVB-S2', self.frame_size,
self.code_rate,
self.constellation)
standard, frame_size, code_rate, constellation = translated_params
translated_params = dvbs2rx.dvb_params(
'DVB-S2',
self.frame_size,
self.code_rate,
self.constellation,
self.rolloff,
self.pilots
)
standard = translated_params.standard
frame_size = translated_params.framesize
code_rate = translated_params.rate
constellation = translated_params.constellation

# Upper layer (FEC + BB Processing)
ldpc_decoder = dvbs2rx.ldpc_decoder_bb(
Expand Down
20 changes: 14 additions & 6 deletions apps/dvbs2-tx
Original file line number Diff line number Diff line change
Expand Up @@ -617,12 +617,20 @@ class dvbs2_tx(gr.top_block, Qt.QWidget):

"""

translated_params = dvbs2rx.params.translate('DVB-S2', self.frame_size,
self.code_rate,
self.constellation,
self.rolloff, self.pilots)
(standard, frame_size, code_rate, constellation, rolloff,
pilots) = translated_params
translated_params = dvbs2rx.dvb_params(
'DVB-S2',
self.frame_size,
self.code_rate,
self.constellation,
self.rolloff,
self.pilots
)
standard = translated_params.standard
frame_size = translated_params.framesize
code_rate = translated_params.rate
constellation = translated_params.constellation
rolloff = translated_params.rolloff
pilots = translated_params.pilots

bbheader = dtv.dvb_bbheader_bb(standard, frame_size, code_rate,
rolloff, dtv.INPUTMODE_NORMAL,
Expand Down
39 changes: 29 additions & 10 deletions examples/dvbs2_fec_ber.grc
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,25 @@ blocks:
coordinate: [712, 4.0]
rotation: 0
state: true
- name: params
id: dvbs2rx_dvb_params
parameters:
alias: ''
code_rate: code_rate
comment: ''
constellation: constellation
frame_size: frame_size
pilots: 'True'
rolloff: '0.2'
standard: DVB-S2
vl_snr: 'False'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [824, 4.0]
rotation: 0
state: true
- name: analog_fastnoise_source_x_0
id: analog_fastnoise_source_x
parameters:
Expand Down Expand Up @@ -364,12 +383,12 @@ blocks:
alias: ''
comment: ''
debug_level: '0'
framesize: frame_size
framesize: params.framesize
maxoutbuf: '0'
minoutbuf: '0'
outputmode: OM_MESSAGE
rate: code_rate
standard: DVB-S2
rate: params.rate
standard: params.standard
states:
bus_sink: false
bus_source: false
Expand All @@ -383,16 +402,16 @@ blocks:
affinity: ''
alias: ''
comment: ''
constellation: constellation
constellation: params.constellation
debug_level: '0'
framesize: frame_size
framesize: params.framesize
infomode: INFO_OFF
max_trials: '25'
maxoutbuf: '0'
minoutbuf: '0'
outputmode: OM_MESSAGE
rate: code_rate
standard: DVB-S2
rate: params.rate
standard: params.standard
states:
bus_sink: false
bus_source: false
Expand All @@ -406,11 +425,11 @@ blocks:
affinity: ''
alias: ''
comment: ''
constellation: constellation
framesize: frame_size
constellation: params.constellation
framesize: params.framesize
maxoutbuf: '0'
minoutbuf: '0'
rate: code_rate
rate: params.rate
states:
bus_sink: false
bus_source: false
Expand Down
51 changes: 35 additions & 16 deletions examples/dvbs2rx_rx_hier.grc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,25 @@ blocks:
coordinate: [192, 292.0]
rotation: 0
state: true
- name: params
id: dvbs2rx_dvb_params
parameters:
alias: ''
code_rate: code_rate
comment: ''
constellation: constellation
frame_size: frame_size
pilots: 'True'
rolloff: rolloff
standard: DVB-S2
vl_snr: 'False'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [832, 4.0]
rotation: 0
state: true
- name: samp_rate
id: variable
parameters:
Expand Down Expand Up @@ -164,11 +183,11 @@ blocks:
alias: ''
comment: ''
debug_level: debug
framesize: frame_size
framesize: params.framesize
maxoutbuf: '0'
minoutbuf: '0'
rate: code_rate
standard: DVB-S2
rate: params.rate
standard: params.standard
states:
bus_sink: false
bus_source: false
Expand All @@ -182,11 +201,11 @@ blocks:
affinity: ''
alias: ''
comment: ''
framesize: frame_size
framesize: params.framesize
maxoutbuf: '0'
minoutbuf: '0'
rate: code_rate
standard: DVB-S2
rate: params.rate
standard: params.standard
states:
bus_sink: false
bus_source: false
Expand All @@ -201,12 +220,12 @@ blocks:
alias: ''
comment: ''
debug_level: debug
framesize: frame_size
framesize: params.framesize
maxoutbuf: '0'
minoutbuf: '0'
outputmode: OM_MESSAGE
rate: code_rate
standard: DVB-S2
rate: params.rate
standard: params.standard
states:
bus_sink: false
bus_source: false
Expand All @@ -220,16 +239,16 @@ blocks:
affinity: ''
alias: ''
comment: ''
constellation: constellation
constellation: params.constellation
debug_level: debug
framesize: frame_size
framesize: params.framesize
infomode: INFO_OFF
max_trials: '25'
maxoutbuf: '0'
minoutbuf: '0'
outputmode: OM_MESSAGE
rate: code_rate
standard: DVB-S2
rate: params.rate
standard: params.standard
states:
bus_sink: false
bus_source: false
Expand Down Expand Up @@ -305,11 +324,11 @@ blocks:
affinity: ''
alias: ''
comment: ''
constellation: constellation
framesize: frame_size
constellation: params.constellation
framesize: params.framesize
maxoutbuf: '0'
minoutbuf: '0'
rate: code_rate
rate: params.rate
states:
bus_sink: false
bus_source: false
Expand Down
1 change: 1 addition & 0 deletions grc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#

install(FILES
dvbs2rx_dvb_params.block.yml
dvbs2rx_bbdeheader_bb.block.yml
dvbs2rx_bbdescrambler_bb.block.yml
dvbs2rx_bch_decoder_bb.block.yml
Expand Down
40 changes: 19 additions & 21 deletions grc/dvbs2rx_bbdeheader_bb.block.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,39 @@
# auto-generated by grc.converter

id: dvbs2rx_bbdeheader_bb
label: BBdeheader
category: '[Core]/Digital Television/DVB'
category: "[Core]/Digital Television/DVB"
flags: [python, cpp]

parameters:
- id: standard
- id: standard
label: Standard
dtype: string
- id: framesize
dtype: raw
- id: framesize
label: FECFRAME size
dtype: string
- id: rate
dtype: raw
- id: rate
label: Code rate
dtype: string
- id: debug_level
dtype: raw
- id: debug_level
label: Debug Level
dtype: int
default: 0

inputs:
- domain: stream
- domain: stream
dtype: byte

outputs:
- domain: stream
- domain: stream
dtype: byte

templates:
imports: from gnuradio import dvbs2rx
make: |-
dvbs2rx.bbdeheader_bb(
*dvbs2rx.params.translate(${standard},
${framesize},
${rate}
),
${debug_level}
)
imports: from gnuradio import dvbs2rx
make: dvbs2rx.bbdeheader_bb(${standard}, ${framesize}, ${rate}, ${debug_level})

cpp_templates:
includes: ["#include <gnuradio/dvbs2rx/bbdeheader_bb.h>"]
declarations: "dvbs2rx::bbdeheader_bb::sptr ${id};"
make: this->${id} = dvbs2rx::bbdeheader_bb::make(${standard}, ${framesize}, ${rate}, ${debug_level});
link: ["gnuradio::gnuradio-dvbs2rx"]

file_format: 1
37 changes: 18 additions & 19 deletions grc/dvbs2rx_bbdescrambler_bb.block.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
# auto-generated by grc.converter

id: dvbs2rx_bbdescrambler_bb
label: BBdescrambler
category: '[Core]/Digital Television/DVB'
category: "[Core]/Digital Television/DVB"
flags: [python, cpp]

parameters:
- id: standard
- id: standard
label: Standard
dtype: string
- id: framesize
dtype: raw
- id: framesize
label: FECFRAME size
dtype: string
- id: rate
dtype: raw
- id: rate
label: Code rate
dtype: string
dtype: raw

inputs:
- domain: stream
- domain: stream
dtype: byte

outputs:
- domain: stream
- domain: stream
dtype: byte

templates:
imports: from gnuradio import dvbs2rx
make: |-
dvbs2rx.bbdescrambler_bb(
*dvbs2rx.params.translate(${standard},
${framesize},
${rate}
)
)
imports: from gnuradio import dvbs2rx
make: dvbs2rx.bbdescrambler_bb(${standard}, ${framesize}, ${rate})

cpp_templates:
includes: ["#include <gnuradio/dvbs2rx/bbdescrambler_bb.h>"]
declarations: "dvbs2rx::bbdescrambler_bb::sptr ${id};"
make: this->${id} = dvbs2rx::bbdescrambler_bb::make(${standard}, ${framesize}, ${rate});
link: ["gnuradio::gnuradio-dvbs2rx"]

file_format: 1
Loading
Loading