diff options
Diffstat (limited to 'host/python')
-rwxr-xr-x | host/python/uhd/imgbuilder/image_builder.py | 13 | ||||
-rw-r--r-- | host/python/uhd/imgbuilder/templates/modules/stream_endpoints.v.mako | 26 | ||||
-rw-r--r-- | host/python/uhd/imgbuilder/templates/rfnoc_image_core.v.mako | 20 | ||||
-rw-r--r-- | host/python/uhd/usrp/cal/libtypes.py | 2 | ||||
-rw-r--r-- | host/python/uhd/utils/mpmtools.py | 12 |
5 files changed, 43 insertions, 30 deletions
diff --git a/host/python/uhd/imgbuilder/image_builder.py b/host/python/uhd/imgbuilder/image_builder.py index 626d1bbf7..9ce57d0e0 100755 --- a/host/python/uhd/imgbuilder/image_builder.py +++ b/host/python/uhd/imgbuilder/image_builder.py @@ -42,6 +42,8 @@ DEVICE_DIR_MAP = { 'n300': 'n3xx', 'n310': 'n3xx', 'n320': 'n3xx', + 'x400': 'x400', + 'x410': 'x400', } # Picks the default make target per device @@ -522,8 +524,13 @@ def convert_to_image_config(grc, grc_config_path): result["stream_endpoints"] = {} for sep in seps.values(): result["stream_endpoints"][sep["name"]] = {"ctrl": bool(sep["parameters"]["ctrl"]), - "data": bool(sep["parameters"]["data"]), - "buff_size": int(sep["parameters"]["buff_size"])} + "data": bool(sep["parameters"]["data"])} + if "buff_size" in sep["parameters"]: + result["stream_endpoints"][sep["name"]]["buff_size"] = \ + int(sep["parameters"]["buff_size"]) + if "buff_size_bytes" in sep["parameters"]: + result["stream_endpoints"][sep["name"]]["buff_size_bytes"] = \ + int(sep["parameters"]["buff_size_bytes"]) result["noc_blocks"] = {} for block in blocks.values(): @@ -875,7 +882,7 @@ def build_image(config, fpga_path, config_path, device, **args): requested. :param config: A dictionary containing the image configuration options. - This must obey the rfnoc_imagebuilder_args schema. + This must obey the rfnoc_image_builder_args schema. :param fpga_path: A path that holds the FPGA IP sources. :param device: The device to build for. :param **args: Additional options including diff --git a/host/python/uhd/imgbuilder/templates/modules/stream_endpoints.v.mako b/host/python/uhd/imgbuilder/templates/modules/stream_endpoints.v.mako index b8c18fba9..50fa09373 100644 --- a/host/python/uhd/imgbuilder/templates/modules/stream_endpoints.v.mako +++ b/host/python/uhd/imgbuilder/templates/modules/stream_endpoints.v.mako @@ -18,15 +18,25 @@ \ %for i, sep in enumerate(seps): <% -# If buff_size == 0, then we assume that we will never transmit through this SEP -buff_size = seps[sep]["buff_size"] -if buff_size > 0: - buff_size = int(math.ceil(math.log(buff_size, 2))) - # FIXME MTU assumed to be 10 here -- forcing to at least accommodate 2 pkts - buff_size = max(buff_size, 10+1) +# The schema allows buff_size_bytes or buff_size, but not both. +if "buff_size_bytes" in seps[sep]: + # Use buffer size in bytes + buff_size = "(" + str(seps[sep]["buff_size_bytes"]) + ")/(CHDR_W/8)" +elif "buff_size" in seps[sep]: + # Use buffer size in CHDR words + buff_size = str(seps[sep]["buff_size"]) else: - buff_size = 5 + # Min SRL-based FIFO size + buff_size = str("32") %>\ + // If requested buffer size is 0, use the minimum SRL-based FIFO size. + // Otherwise, make sure it's at least two MTU-sized packets. + localparam REQ_BUFF_SIZE_${sep.upper()} = ${buff_size}; + localparam INGRESS_BUFF_SIZE_${sep.upper()} = + REQ_BUFF_SIZE_${sep.upper()} == 0 ? 5 : + REQ_BUFF_SIZE_${sep.upper()} < 2*(2**MTU) ? MTU+1 : + $clog2(REQ_BUFF_SIZE_${sep.upper()}); + wire [CHDR_W-1:0] ${axis_outputs[sep].format(sep,"tdata")}; wire ${axis_outputs[sep].format(sep,"tlast")}; wire ${axis_outputs[sep].format(sep,"tvalid")}; @@ -49,7 +59,7 @@ else: .NUM_DATA_O (${int(seps[sep]["num_data_o"])}), .INST_NUM (${i}), .CTRL_XBAR_PORT (${i+1}), - .INGRESS_BUFF_SIZE (${buff_size}), + .INGRESS_BUFF_SIZE (INGRESS_BUFF_SIZE_${sep.upper()}), .MTU (MTU), .REPORT_STRM_ERRS (1) ) ${sep}_i ( diff --git a/host/python/uhd/imgbuilder/templates/rfnoc_image_core.v.mako b/host/python/uhd/imgbuilder/templates/rfnoc_image_core.v.mako index a5a019e16..b27e21fc4 100644 --- a/host/python/uhd/imgbuilder/templates/rfnoc_image_core.v.mako +++ b/host/python/uhd/imgbuilder/templates/rfnoc_image_core.v.mako @@ -26,19 +26,12 @@ `default_nettype none -<% - if hasattr(config, 'image_core_name'): - image_core_name = config.image_core_name - else: - image_core_name = config.device.type -%>\ -`include "${image_core_name}_rfnoc_image_core.vh" - module rfnoc_image_core #( - parameter CHDR_W = `CHDR_WIDTH, - parameter MTU = 10, - parameter [15:0] PROTOVER = {8'd1, 8'd0} + parameter CHDR_W = ${config.chdr_width}, + parameter MTU = 10, + parameter [15:0] PROTOVER = {8'd1, 8'd0}, + parameter RADIO_NIPC = 1 ) ( // Clocks input wire chdr_aclk, @@ -59,11 +52,6 @@ module rfnoc_image_core #( wire rfnoc_chdr_clk, rfnoc_chdr_rst; wire rfnoc_ctrl_clk, rfnoc_ctrl_rst; - // Check that CHDR_W parameter matches value used by RFNoC Image Builder - if (CHDR_W != `CHDR_WIDTH) begin - ERROR_CHDR_W_values_do_not_match(); - end - //--------------------------------------------------------------------------- // CHDR Crossbar diff --git a/host/python/uhd/usrp/cal/libtypes.py b/host/python/uhd/usrp/cal/libtypes.py index 1eb9ff360..448feec88 100644 --- a/host/python/uhd/usrp/cal/libtypes.py +++ b/host/python/uhd/usrp/cal/libtypes.py @@ -18,5 +18,7 @@ database = lib.cal.database Source = lib.cal.source IQCal = lib.cal.iq_cal PwrCal = lib.cal.pwr_cal +ZbxTxDsaCal = lib.cal.zbx_tx_dsa_cal +ZbxRxDsaCal = lib.cal.zbx_rx_dsa_cal InterpMode = lib.cal.interp_mode # pylint: enable=invalid-name diff --git a/host/python/uhd/utils/mpmtools.py b/host/python/uhd/utils/mpmtools.py index 90dd63be0..f03da82bb 100644 --- a/host/python/uhd/utils/mpmtools.py +++ b/host/python/uhd/utils/mpmtools.py @@ -16,7 +16,7 @@ from mprpc.exceptions import RPCError MPM_RPC_PORT = 49601 -def _claim_loop(host, port, cmd_q, token_q): +def _claim_loop(client, cmd_q, token_q): """ Process that runs a claim loop. @@ -39,7 +39,6 @@ def _claim_loop(host, port, cmd_q, token_q): signal.signal(signal.SIGTERM, _sig_term_handler) - client = RPCClient(host, port, pack_params={'use_bin_type': True}) try: while not exit_loop: try: @@ -84,10 +83,11 @@ class MPMClaimer: self.token = None self._cmd_q = multiprocessing.Queue() self._token_q = multiprocessing.Queue() + client = RPCClient(host, port, pack_params={'use_bin_type': True}) self._claim_loop = multiprocessing.Process( target=_claim_loop, name="Claimer Loop", - args=(host, port, self._cmd_q, self._token_q) + args=(client, self._cmd_q, self._token_q) ) self._claim_loop.daemon = True self._claim_loop.start() @@ -181,6 +181,12 @@ class MPMClient: """ self._claimer.unclaim() + def exit(self): + """ + Use claimer (instead of RPC method) to unclaim MPM device and exit claim loop + """ + self._claimer.exit() + def _add_command(self, command, docs, requires_token): """ Add a command to the current session |