diff --git a/examples/cdc_packet_hw_loopback.grc b/examples/cdc_packet_hw_loopback.grc new file mode 100644 index 0000000000000000000000000000000000000000..4a76a627eb1597cd5c829d93a136ed7912fba994 --- /dev/null +++ b/examples/cdc_packet_hw_loopback.grc @@ -0,0 +1,553 @@ +options: + parameters: + author: '' + catch_exceptions: 'True' + category: '[GRC Hier Blocks]' + cmake_opt: '' + comment: '' + copyright: University of Melbourne + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: qt_gui + hier_block_src_path: '.:' + id: cdc_packet_hw_loopback + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '' + run: 'True' + run_command: '{python} -u {filename}' + run_options: prompt + sizing_mode: fixed + thread_safe_setters: '' + title: CDC Packet HW Loopback + window_size: (1000,1000) + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 8] + rotation: 0 + state: enabled + +blocks: +- name: bps_payload + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 1, 0, 1, 1 + label: Payload Constellation + label0: BPSK + label1: QPSK + label2: 8PSK + label3: 16QAM + label4: '' + labels: '[]' + num_opts: '4' + option0: '1' + option1: '2' + option2: '3' + option3: '4' + option4: '4' + options: '[0, 1, 2]' + orient: Qt.QVBoxLayout + type: int + value: '2' + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 108.0] + rotation: 0 + state: true +- name: rf_freq + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 0, 0, 1, 1 + label: RF Frequency + min_len: '200' + orient: QtCore.Qt.Horizontal + rangeType: float + start: 70e6 + step: 1e3 + stop: 6e9 + value: 920e6 + widget: counter + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [456, 12.0] + rotation: 0 + state: true +- name: rx_gain + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 1, 1, 1, 1 + label: Rx Gain + min_len: '200' + orient: QtCore.Qt.Horizontal + rangeType: float + start: '-10' + step: '1' + stop: '60' + value: '30' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [704, 12.0] + rotation: 0 + state: true +- name: samp_rate + id: variable + parameters: + comment: '' + value: symb_rate * sps + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [360, 12.0] + rotation: 0 + state: enabled +- name: sps + id: variable + parameters: + comment: '' + value: '2' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [288, 12.0] + rotation: 0 + state: enabled +- name: symb_rate + id: variable + parameters: + comment: '' + value: '275000' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [192, 12.0] + rotation: 0 + state: enabled +- name: tx_gain + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 0, 1, 1, 1 + label: Tx Gain + min_len: '200' + orient: QtCore.Qt.Horizontal + rangeType: float + start: '-10' + step: '1' + stop: '50' + value: '20' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [584, 12.0] + rotation: 0 + state: true +- name: bladeRF_sink_0 + id: bladeRF_sink + parameters: + affinity: '' + alias: '' + bias_tee0: 'False' + bias_tee1: 'False' + bw: '0' + comment: '' + dac: '10000' + dc_calibration: LPF_TUNING + device_id: '0' + fpga_image: '' + fpga_reload: 'False' + freq: rf_freq + gain0: tx_gain + gain1: '10' + if_gain0: '0' + if_gain1: '20' + in_clk: ONBOARD + lpf_mode: disabled + maxoutbuf: '0' + metadata: 'True' + minoutbuf: '0' + nchan: '1' + out_clk: 'False' + ref_clk: '0' + sample_rate: samp_rate + sampling: internal + show_pmic: 'False' + smb: '0' + tamer: internal + trigger0: 'False' + trigger1: 'False' + trigger_role0: master + trigger_role1: master + trigger_signal0: J51_1 + trigger_signal1: J51_1 + tsb_tag_name: '"packet_len"' + use_dac: 'False' + verbosity: error + xb200: none + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [608, 244.0] + rotation: 0 + state: enabled +- name: bladeRF_source_0 + id: bladeRF_source + parameters: + affinity: '' + alias: '' + bias_tee0: 'False' + bias_tee1: 'False' + bw: '0' + comment: '' + dac: '10000' + dc_calibration: LPF_TUNING + dc_offset_mode0: '0' + dc_offset_mode1: '0' + device_id: '0' + fpga_image: '' + fpga_reload: 'False' + freq: rf_freq + gain0: rx_gain + gain1: '10' + gain_mode0: 'False' + gain_mode1: 'False' + if_gain0: '0' + if_gain1: '20' + in_clk: ONBOARD + iq_balance_mode0: '0' + iq_balance_mode1: '0' + lpf_mode: disabled + maxoutbuf: '0' + metadata: 'True' + minoutbuf: '0' + nchan: '1' + out_clk: 'False' + ref_clk: '0' + sample_rate: samp_rate + sampling: internal + show_pmic: 'False' + smb: '0' + tamer: internal + trigger0: 'False' + trigger1: 'False' + trigger_role0: master + trigger_role1: master + trigger_signal0: J51_1 + trigger_signal1: J51_1 + use_dac: 'False' + verbosity: error + xb200: none + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [888, 244.0] + rotation: 0 + state: enabled +- name: blocks_message_strobe_0 + id: blocks_message_strobe + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + msg: pmt.intern("TEST") + period: '250' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [784, 164.0] + rotation: 180 + state: true +- name: blocks_random_pdu_0 + id: blocks_random_pdu + parameters: + affinity: '' + alias: '' + comment: '' + length_modulo: '2' + mask: '0xFF' + maxoutbuf: '0' + maxsize: '16' + minoutbuf: '0' + minsize: '16' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [488, 148.0] + rotation: 180 + state: true +- name: epy_block_0 + id: epy_block + parameters: + _source_code: "import numpy as np\nfrom gnuradio import gr\nimport pmt\n\n\nclass\ + \ add_payload_bps(gr.sync_block):\n\n def __init__(self, bps=1):\n \ + \ gr.sync_block.__init__(\n self,\n name='Add Payload\ + \ BPS', # will show up in GRC\n in_sig=None,\n out_sig=None\n\ + \ )\n self.bps = bps\n self.message_port_register_in(pmt.intern('in'))\n\ + \ self.message_port_register_out(pmt.intern('out'))\n self.set_msg_handler(pmt.intern('in'),\ + \ self.msg_handler)\n\n def msg_handler(self, msg):\n info = pmt.make_dict()\n\ + \ info = pmt.dict_add(info, pmt.intern('bps'), pmt.from_long(self.bps))\n\ + \ pdu = pmt.cons(info, pmt.cdr(msg))\n self.message_port_pub(pmt.intern('out'),\ + \ pdu)\n" + affinity: '' + alias: '' + bps: bps_payload + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + states: + _io_cache: ('Add Payload BPS', 'add_payload_bps', [('bps', '1')], [('in', 'message', + 1)], [('out', 'message', 1)], '', ['bps']) + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [280, 172.0] + rotation: 180 + state: true +- name: packet_phy_tx_0 + id: packet_phy_tx + parameters: + affinity: '' + alias: '' + comment: '' + excess_bw: '0.35' + maxoutbuf: '0' + minoutbuf: '0' + sps: sps + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [280, 360.0] + rotation: 0 + state: true +- name: qtgui_time_sink_x_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'False' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'False' + gui_hint: 2, 0, 1, 2 + label1: Signal 1 + label10: Signal 10 + label2: Signal 2 + label3: Signal 3 + label4: Signal 4 + label5: Signal 5 + label6: Signal 6 + label7: Signal 7 + label8: Signal 8 + label9: Signal 9 + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '"Transmit Waveform"' + nconnections: '1' + size: '512' + srate: '1' + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.0' + tr_mode: qtgui.TRIG_MODE_TAG + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '"packet_len"' + type: complex + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [608, 484.0] + rotation: 0 + state: true +- name: qtgui_time_sink_x_0_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'True' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'False' + gui_hint: 3, 0, 1, 2 + label1: Signal 1 + label10: Signal 10 + label2: Signal 2 + label3: Signal 3 + label4: Signal 4 + label5: Signal 5 + label6: Signal 6 + label7: Signal 7 + label8: Signal 8 + label9: Signal 9 + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '"Received Waveform"' + nconnections: '1' + size: '512' + srate: '1' + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.01' + tr_mode: qtgui.TRIG_MODE_NORM + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1120, 316.0] + rotation: 0 + state: enabled + +connections: +- [bladeRF_source_0, '0', qtgui_time_sink_x_0_0, '0'] +- [blocks_message_strobe_0, strobe, blocks_random_pdu_0, generate] +- [blocks_random_pdu_0, pdus, epy_block_0, in] +- [epy_block_0, out, packet_phy_tx_0, phy_sdu] +- [packet_phy_tx_0, '0', bladeRF_sink_0, '0'] +- [packet_phy_tx_0, '0', qtgui_time_sink_x_0, '0'] + +metadata: + file_format: 1 diff --git a/examples/cdc_packet_tx.grc b/examples/cdc_packet_tx.grc new file mode 100644 index 0000000000000000000000000000000000000000..39fac7ff3e7c551a2f0a39f20181d75c577b1e35 --- /dev/null +++ b/examples/cdc_packet_tx.grc @@ -0,0 +1,493 @@ +options: + parameters: + author: '' + catch_exceptions: 'True' + category: '[GRC Hier Blocks]' + cmake_opt: '' + comment: '' + copyright: University of Melbourne + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: qt_gui + hier_block_src_path: '.:' + id: cdc_packet_tx + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '' + run: 'True' + run_command: '{python} -u {filename}' + run_options: prompt + sizing_mode: fixed + thread_safe_setters: '' + title: CDC Packet Tx + window_size: (1000,1000) + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 8] + rotation: 0 + state: enabled + +blocks: +- name: bps_payload + id: variable_qtgui_chooser + parameters: + comment: '' + gui_hint: 2, 0, 1, 1 + label: Payload Constellation + label0: BPSK + label1: QPSK + label2: 8PSK + label3: 16QAM + label4: '' + labels: '[]' + num_opts: '4' + option0: '1' + option1: '2' + option2: '3' + option3: '4' + option4: '4' + options: '[0, 1, 2]' + orient: Qt.QVBoxLayout + type: int + value: '2' + widget: combo_box + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 108.0] + rotation: 0 + state: true +- name: rf_freq + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 0, 0, 1, 1 + label: RF Frequency + min_len: '200' + orient: QtCore.Qt.Horizontal + rangeType: float + start: 70e6 + step: 1e3 + stop: 6e9 + value: 920e6 + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [456, 12.0] + rotation: 0 + state: true +- name: samp_rate + id: variable + parameters: + comment: '' + value: symb_rate * sps + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [352, 12.0] + rotation: 0 + state: enabled +- name: sps + id: variable + parameters: + comment: '' + value: '2' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [280, 12.0] + rotation: 0 + state: enabled +- name: symb_rate + id: variable + parameters: + comment: '' + value: '275000' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [184, 12.0] + rotation: 0 + state: enabled +- name: tx_gain + id: variable_qtgui_range + parameters: + comment: '' + gui_hint: 1, 0, 1, 1 + label: Tx Gain + min_len: '200' + orient: QtCore.Qt.Horizontal + rangeType: float + start: '-10' + step: '1' + stop: '50' + value: '0' + widget: counter_slider + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [584, 12.0] + rotation: 0 + state: true +- name: bladeRF_sink_0 + id: bladeRF_sink + parameters: + affinity: '' + alias: '' + bias_tee0: 'False' + bias_tee1: 'False' + bw: '0' + comment: '' + dac: '10000' + dc_calibration: LPF_TUNING + device_id: '0' + fpga_image: '' + fpga_reload: 'False' + freq: rf_freq + gain0: tx_gain + gain1: '10' + if_gain0: '0' + if_gain1: '20' + in_clk: ONBOARD + lpf_mode: disabled + maxoutbuf: '0' + metadata: 'True' + minoutbuf: '0' + nchan: '1' + out_clk: 'False' + ref_clk: '0' + sample_rate: samp_rate + sampling: internal + show_pmic: 'False' + smb: '0' + tamer: internal + trigger0: 'False' + trigger1: 'False' + trigger_role0: master + trigger_role1: master + trigger_signal0: J51_1 + trigger_signal1: J51_1 + tsb_tag_name: '"packet_len"' + use_dac: 'False' + verbosity: error + xb200: none + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [712, 340.0] + rotation: 0 + state: disabled +- name: blocks_message_strobe_0 + id: blocks_message_strobe + parameters: + affinity: '' + alias: '' + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + msg: pmt.intern("TEST") + period: '250' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [776, 164.0] + rotation: 180 + state: true +- name: blocks_random_pdu_0 + id: blocks_random_pdu + parameters: + affinity: '' + alias: '' + comment: '' + length_modulo: '2' + mask: '0xFF' + maxoutbuf: '0' + maxsize: '16' + minoutbuf: '0' + minsize: '16' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [480, 148.0] + rotation: 180 + state: true +- name: blocks_throttle_0 + id: blocks_throttle + parameters: + affinity: '' + alias: '' + comment: '' + ignoretag: 'True' + maxoutbuf: '0' + minoutbuf: '0' + samples_per_second: samp_rate + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [528, 268.0] + rotation: 0 + state: true +- name: epy_block_0 + id: epy_block + parameters: + _source_code: "import numpy as np\nfrom gnuradio import gr\nimport pmt\n\n\nclass\ + \ add_payload_bps(gr.sync_block):\n\n def __init__(self, bps=1):\n \ + \ gr.sync_block.__init__(\n self,\n name='Add Payload\ + \ BPS', # will show up in GRC\n in_sig=None,\n out_sig=None\n\ + \ )\n self.bps = bps\n self.message_port_register_in(pmt.intern('in'))\n\ + \ self.message_port_register_out(pmt.intern('out'))\n self.set_msg_handler(pmt.intern('in'),\ + \ self.msg_handler)\n\n def msg_handler(self, msg):\n info = pmt.make_dict()\n\ + \ info = pmt.dict_add(info, pmt.intern('bps'), pmt.from_long(self.bps))\n\ + \ pdu = pmt.cons(info, pmt.cdr(msg))\n self.message_port_pub(pmt.intern('out'),\ + \ pdu)\n" + affinity: '' + alias: '' + bps: bps_payload + comment: '' + maxoutbuf: '0' + minoutbuf: '0' + states: + _io_cache: ('Add Payload BPS', 'add_payload_bps', [('bps', '1')], [('in', 'message', + 1)], [('out', 'message', 1)], '', ['bps']) + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [280, 172.0] + rotation: 180 + state: true +- name: packet_phy_tx_0 + id: packet_phy_tx + parameters: + affinity: '' + alias: '' + comment: '' + excess_bw: '0.35' + maxoutbuf: '0' + minoutbuf: '0' + sps: '2' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [280, 272.0] + rotation: 0 + state: true +- name: qtgui_const_sink_x_0 + id: qtgui_const_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'False' + axislabels: 'True' + color1: '"blue"' + color10: '"red"' + color2: '"red"' + color3: '"red"' + color4: '"red"' + color5: '"red"' + color6: '"red"' + color7: '"red"' + color8: '"red"' + color9: '"red"' + comment: '' + grid: 'False' + gui_hint: 3, 0, 1, 1 + label1: '' + label10: '' + label2: '' + label3: '' + label4: '' + label5: '' + label6: '' + label7: '' + label8: '' + label9: '' + legend: 'True' + marker1: '0' + marker10: '0' + marker2: '0' + marker3: '0' + marker4: '0' + marker5: '0' + marker6: '0' + marker7: '0' + marker8: '0' + marker9: '0' + name: '"Transmit Constellation"' + nconnections: '1' + size: '256' + style1: '0' + style10: '0' + style2: '0' + style3: '0' + style4: '0' + style5: '0' + style6: '0' + style7: '0' + style8: '0' + style9: '0' + tr_chan: '0' + tr_level: '0.0' + tr_mode: qtgui.TRIG_MODE_FREE + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '""' + type: complex + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + xmax: '2' + xmin: '-2' + ymax: '2' + ymin: '-2' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [240, 356.0] + rotation: 180 + state: enabled +- name: qtgui_time_sink_x_0 + id: qtgui_time_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'False' + axislabels: 'True' + color1: blue + color10: dark blue + color2: red + color3: green + color4: black + color5: cyan + color6: magenta + color7: yellow + color8: dark red + color9: dark green + comment: '' + ctrlpanel: 'False' + entags: 'True' + grid: 'False' + gui_hint: 4, 0, 1, 1 + label1: Signal 1 + label10: Signal 10 + label2: Signal 2 + label3: Signal 3 + label4: Signal 4 + label5: Signal 5 + label6: Signal 6 + label7: Signal 7 + label8: Signal 8 + label9: Signal 9 + legend: 'True' + marker1: '-1' + marker10: '-1' + marker2: '-1' + marker3: '-1' + marker4: '-1' + marker5: '-1' + marker6: '-1' + marker7: '-1' + marker8: '-1' + marker9: '-1' + name: '"Transmit Waveform"' + nconnections: '1' + size: '512' + srate: '1' + stemplot: 'False' + style1: '1' + style10: '1' + style2: '1' + style3: '1' + style4: '1' + style5: '1' + style6: '1' + style7: '1' + style8: '1' + style9: '1' + tr_chan: '0' + tr_delay: '0' + tr_level: '0.0' + tr_mode: qtgui.TRIG_MODE_TAG + tr_slope: qtgui.TRIG_SLOPE_POS + tr_tag: '"packet_len"' + type: complex + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + ylabel: Amplitude + ymax: '1' + ymin: '-1' + yunit: '""' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [712, 244.0] + rotation: 0 + state: true + +connections: +- [blocks_message_strobe_0, strobe, blocks_random_pdu_0, generate] +- [blocks_random_pdu_0, pdus, epy_block_0, in] +- [blocks_throttle_0, '0', qtgui_time_sink_x_0, '0'] +- [epy_block_0, out, packet_phy_tx_0, phy_sdu] +- [packet_phy_tx_0, '0', bladeRF_sink_0, '0'] +- [packet_phy_tx_0, '0', blocks_throttle_0, '0'] +- [packet_phy_tx_0, '1', qtgui_const_sink_x_0, '0'] + +metadata: + file_format: 1 diff --git a/examples/packet_phy_tx.grc b/examples/packet_phy_tx.grc new file mode 100644 index 0000000000000000000000000000000000000000..204c1dfceb6f1e008faa8a5ff01599961e6ce30e --- /dev/null +++ b/examples/packet_phy_tx.grc @@ -0,0 +1,456 @@ +options: + parameters: + author: '' + catch_exceptions: 'True' + category: '[elen90089]' + cmake_opt: '' + comment: '' + copyright: University of Melbourne + description: '' + gen_cmake: 'On' + gen_linking: dynamic + generate_options: hb + hier_block_src_path: '.:' + id: packet_phy_tx + max_nouts: '0' + output_language: python + placement: (0,0) + qt_qss_theme: '' + realtime_scheduling: '' + run: 'True' + run_command: '{python} -u {filename}' + run_options: prompt + sizing_mode: fixed + thread_safe_setters: '' + title: CDC Packet PHY TX + window_size: (1000,1000) + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [8, 11] + rotation: 0 + state: enabled + +blocks: +- name: filt_delay + id: variable + parameters: + comment: '' + value: int(1+(taps_per_filt-1)//2) + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [472, 548.0] + rotation: 0 + state: enabled +- name: hdr_encoder + id: variable_dummy_encoder_def + parameters: + comment: '' + dim1: '1' + dim2: '1' + framebits: '1500' + ndim: '0' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [704, 12.0] + rotation: 0 + state: enabled +- name: hdr_encoder + id: variable_repetition_encoder_def + parameters: + comment: '' + dim1: '1' + dim2: '1' + framebits: '2048' + ndim: '0' + rep: '3' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [888, 12.0] + rotation: 0 + state: disabled +- name: header_format_cdc_0 + id: header_format_cdc + parameters: + access_code: digital.packet_utils.default_access_code + alias: '' + bps: '1' + comment: '' + threshold: '3' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [392, 268.0] + rotation: 0 + state: true +- name: nfilts + id: variable + parameters: + comment: '' + value: '32' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [400, 548.0] + rotation: 0 + state: enabled +- name: rrc_taps + id: variable_rrc_filter_taps + parameters: + alpha: excess_bw + comment: '' + gain: nfilts/2 + ntaps: 5*sps*nfilts + samp_rate: nfilts + sym_rate: '1.0' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [560, 548.0] + rotation: 0 + state: enabled +- name: taps_per_filt + id: variable + parameters: + comment: '' + value: len(rrc_taps)/nfilts + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [456, 612.0] + rotation: 0 + state: enabled +- name: blocks_tagged_stream_multiply_length_0 + id: blocks_tagged_stream_multiply_length + parameters: + affinity: '' + alias: '' + c: sps + comment: '' + lengthtagname: packet_len + maxoutbuf: '0' + minoutbuf: '0' + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [816, 448.0] + rotation: 0 + state: enabled +- name: digital_burst_shaper_xx_0 + id: digital_burst_shaper_xx + parameters: + affinity: '' + alias: '' + comment: Create transmission burst + insert_phasing: 'True' + length_tag_name: packet_len + maxoutbuf: '0' + minoutbuf: '0' + post_padding: filt_delay + pre_padding: '0' + type: complex + window: firdes.window(window.WIN_HANN, 20, 0) + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [232, 428.0] + rotation: 0 + state: enabled +- name: digital_crc32_async_bb_1 + id: digital_crc32_async_bb + parameters: + affinity: '' + alias: '' + check: 'False' + comment: "Calculate and append 32-bit\ncyclic redundancy check \nto end of payload" + maxoutbuf: '0' + minoutbuf: '0' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [184, 188.0] + rotation: 0 + state: enabled +- name: digital_protocol_formatter_async_0 + id: digital_protocol_formatter_async + parameters: + affinity: '' + alias: '' + comment: Generate cdc header + format: header_format_cdc_0 + maxoutbuf: '0' + minoutbuf: '0' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [392, 176.0] + rotation: 0 + state: enabled +- name: elen90089_symbol_mapper_c_0 + id: elen90089_symbol_mapper_c + parameters: + affinity: '' + alias: '' + comment: '' + constel_header: CONSTEL_BPSK + maxoutbuf: '0' + minoutbuf: '0' + tsb_tag_key: packet_len + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [984, 176.0] + rotation: 0 + state: true +- name: excess_bw + id: parameter + parameters: + alias: '' + comment: '' + hide: none + label: Excess BW + short_id: '' + type: eng_float + value: '0.35' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [336, 12.0] + rotation: 0 + state: enabled +- name: fec_async_encoder_0_0 + id: fec_async_encoder + parameters: + affinity: '' + alias: '' + comment: 'Header forward error correction code. + + ''Dummy'' encoder (does nothing) + + ''Repetition'' repeats each header bit 3 times.' + encoder: hdr_encoder + maxoutbuf: '0' + minoutbuf: '0' + mtu: '1500' + packed: 'True' + rev_pack: 'False' + rev_unpack: 'False' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [712, 164.0] + rotation: 0 + state: enabled +- name: pad_sink_0 + id: pad_sink + parameters: + affinity: '' + alias: '' + comment: '' + label: iq + num_streams: '1' + optional: 'False' + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1112, 460.0] + rotation: 0 + state: enabled +- name: pad_sink_1 + id: pad_sink + parameters: + affinity: '' + alias: '' + comment: '' + label: postcrc + num_streams: '1' + optional: 'True' + type: message + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [392, 124.0] + rotation: 0 + state: disabled +- name: pad_sink_1_0 + id: pad_sink + parameters: + affinity: '' + alias: '' + comment: '' + label: header + num_streams: '1' + optional: 'True' + type: message + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [712, 116.0] + rotation: 0 + state: disabled +- name: pad_sink_2 + id: pad_sink + parameters: + affinity: '' + alias: '' + comment: '' + label: symbols + num_streams: '1' + optional: 'True' + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1240, 236.0] + rotation: 0 + state: enabled +- name: pad_sink_3 + id: pad_sink + parameters: + affinity: '' + alias: '' + comment: '' + label: burst + num_streams: '1' + optional: 'True' + type: complex + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [488, 388.0] + rotation: 0 + state: disabled +- name: pad_source_0 + id: pad_source + parameters: + affinity: '' + alias: '' + comment: '' + label: phy_sdu + maxoutbuf: '0' + minoutbuf: '0' + num_streams: '1' + optional: 'False' + type: message + vlen: '1' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [24, 188.0] + rotation: 0 + state: enabled +- name: pfb_arb_resampler_xxx_0_0 + id: pfb_arb_resampler_xxx + parameters: + affinity: '' + alias: '' + atten: '100' + comment: Root raised cosine pulse shaping filter + maxoutbuf: '0' + minoutbuf: '0' + nfilts: nfilts + rrate: sps + samp_delay: filt_delay + taps: rrc_taps + type: ccf + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [488, 436.0] + rotation: 0 + state: enabled +- name: sps + id: parameter + parameters: + alias: '' + comment: '' + hide: none + label: Samps per symb + short_id: '' + type: intx + value: '2' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [192, 12.0] + rotation: 0 + state: enabled +- name: virtual_sink_0 + id: virtual_sink + parameters: + alias: '' + comment: '' + stream_id: symbols + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1216, 188.0] + rotation: 0 + state: true +- name: virtual_source_0 + id: virtual_source + parameters: + alias: '' + comment: '' + stream_id: symbols + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [24, 460.0] + rotation: 0 + state: true + +connections: +- [blocks_tagged_stream_multiply_length_0, '0', pad_sink_0, '0'] +- [digital_burst_shaper_xx_0, '0', pad_sink_3, '0'] +- [digital_burst_shaper_xx_0, '0', pfb_arb_resampler_xxx_0_0, '0'] +- [digital_crc32_async_bb_1, out, digital_protocol_formatter_async_0, in] +- [digital_crc32_async_bb_1, out, pad_sink_1, in] +- [digital_protocol_formatter_async_0, header, fec_async_encoder_0_0, in] +- [digital_protocol_formatter_async_0, header, pad_sink_1_0, in] +- [digital_protocol_formatter_async_0, payload, elen90089_symbol_mapper_c_0, pld] +- [elen90089_symbol_mapper_c_0, '0', pad_sink_2, '0'] +- [elen90089_symbol_mapper_c_0, '0', virtual_sink_0, '0'] +- [fec_async_encoder_0_0, out, elen90089_symbol_mapper_c_0, hdr] +- [pad_source_0, out, digital_crc32_async_bb_1, in] +- [pfb_arb_resampler_xxx_0_0, '0', blocks_tagged_stream_multiply_length_0, '0'] +- [virtual_source_0, '0', digital_burst_shaper_xx_0, '0'] + +metadata: + file_format: 1 diff --git a/lib/symbol_mapper_c_impl.cc b/lib/symbol_mapper_c_impl.cc index 2a562cd4f0db489bfc517814bfd8803215d133d2..7a8956b2ba408b47088fd962a380e96e5e4aba64 100644 --- a/lib/symbol_mapper_c_impl.cc +++ b/lib/symbol_mapper_c_impl.cc @@ -179,14 +179,14 @@ int symbol_mapper_c_impl::work(int noutput_items, // add start of burst and end of burst tags int offset = nitems_written(0); - add_item_tag(0, offset, - pmt::mp("tx_sob"), - pmt::PMT_T, - alias_pmt()); - add_item_tag(0, offset + nout - 1, - pmt::mp("tx_eob"), - pmt::PMT_T, - alias_pmt()); + //add_item_tag(0, offset, + // pmt::mp("tx_sob"), + // pmt::PMT_T, + // alias_pmt()); + //add_item_tag(0, offset + nout - 1, + // pmt::mp("tx_eob"), + // pmt::PMT_T, + // alias_pmt()); // convert header metadata to stream tags pmt::pmt_t items(pmt::dict_items(d_metadata));