diff options
Diffstat (limited to 'host/utils/rfnoc/templates/modules')
12 files changed, 0 insertions, 371 deletions
diff --git a/host/utils/rfnoc/templates/modules/CMakeLists.txt b/host/utils/rfnoc/templates/modules/CMakeLists.txt deleted file mode 100644 index ee69b63b5..000000000 --- a/host/utils/rfnoc/templates/modules/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -# -# Copyright 2017 Ettus Research, National Instruments Company -# -# SPDX-License-Identifier: GPL-3.0-or-later -# - -######################################################################## -# This file included, use CMake directory variables -######################################################################## -set(RFNOC_PKG_FILES ${RFNOC_PKG_FILES}) -set(RFNOC_PKG_TOP_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/chdr_xb_sep_transport.v.mako - ${CMAKE_CURRENT_SOURCE_DIR}/connect_io_ports.v.mako - ${CMAKE_CURRENT_SOURCE_DIR}/ctrl_crossbar.v.mako - ${CMAKE_CURRENT_SOURCE_DIR}/device_io_ports.v.mako - ${CMAKE_CURRENT_SOURCE_DIR}/device_transport.v.mako - ${CMAKE_CURRENT_SOURCE_DIR}/drive_unused_ports.v.mako - ${CMAKE_CURRENT_SOURCE_DIR}/rfnoc_block.v.mako - ${CMAKE_CURRENT_SOURCE_DIR}/sep_xb_wires.v.mako - ${CMAKE_CURRENT_SOURCE_DIR}/static_router.v.mako - ${CMAKE_CURRENT_SOURCE_DIR}/stream_endpoints.v.mako -) -list(APPEND RFNOC_PKG_FILES ${RFNOC_PKG_TOP_FILES}) -set(RFNOC_PKG_FILES ${RFNOC_PKG_FILES} PARENT_SCOPE) diff --git a/host/utils/rfnoc/templates/modules/chdr_xb_sep_transport.v.mako b/host/utils/rfnoc/templates/modules/chdr_xb_sep_transport.v.mako deleted file mode 100644 index 0862a1ac1..000000000 --- a/host/utils/rfnoc/templates/modules/chdr_xb_sep_transport.v.mako +++ /dev/null @@ -1,23 +0,0 @@ -<%page args="seps, transports"/>\ -\ -<% - import re - sep2xb = "" - xb2sep = "" - for sep in reversed(list(seps.keys())): - sep2xb += "%s_to_xb_wire, " % sep - xb2sep += "xb_to_%s_wire, " % sep - for transport in reversed(transports): - sep2xb += "s_%s_wire, " % transport["name"] - xb2sep += "m_%s_wire, " % transport["name"] - sep2xb = sep2xb[:-2] - xb2sep = xb2sep[:-2] -%>\ - .s_axis_tdata ({${re.sub("wire", "tdata", sep2xb)}}), - .s_axis_tlast ({${re.sub("wire", "tlast", sep2xb)}}), - .s_axis_tvalid ({${re.sub("wire", "tvalid", sep2xb)}}), - .s_axis_tready ({${re.sub("wire", "tready", sep2xb)}}), - .m_axis_tdata ({${re.sub("wire", "tdata", xb2sep)}}), - .m_axis_tlast ({${re.sub("wire", "tlast", xb2sep)}}), - .m_axis_tvalid ({${re.sub("wire", "tvalid", xb2sep)}}), - .m_axis_tready ({${re.sub("wire", "tready", xb2sep)}}), diff --git a/host/utils/rfnoc/templates/modules/connect_clk_domains.v.mako b/host/utils/rfnoc/templates/modules/connect_clk_domains.v.mako deleted file mode 100644 index df055645c..000000000 --- a/host/utils/rfnoc/templates/modules/connect_clk_domains.v.mako +++ /dev/null @@ -1,12 +0,0 @@ -<%page args="connections, clocks"/>\ -\ -%for connection in connections: -<% - src_name = connection["srcblk"] # Should always be "_device_" - src = clocks[(src_name, connection["srcport"])] - dst_name = connection["dstblk"] - dst = clocks[(dst_name, connection["dstport"])] -%>\ - assign ${dst_name}_${dst["name"]}_clk = ${src["name"]}_clk; -%endfor - diff --git a/host/utils/rfnoc/templates/modules/connect_io_ports.v.mako b/host/utils/rfnoc/templates/modules/connect_io_ports.v.mako deleted file mode 100644 index c37697d88..000000000 --- a/host/utils/rfnoc/templates/modules/connect_io_ports.v.mako +++ /dev/null @@ -1,20 +0,0 @@ -<%page args="connections, io_ports, names"/>\ -\ -%for connection in connections: -<% - src_name = connection["srcblk"] - src = io_ports[(src_name, connection["srcport"], names[0])] - dst_name = connection["dstblk"] - dst = io_ports[(dst_name, connection["dstport"], names[1])] -%>\ - %for src_wire, dst_wire in zip(src["wires"], dst["wires"]): -<% - swire = src_wire["name"] if src_name == "_device_" else "%s_%s" % (src_name, src_wire["name"]) - dwire = dst_wire["name"] if dst_name == "_device_" else "%s_%s" % (dst_name, dst_wire["name"]) - if src_wire["direction"] == "output": - swire, dwire = dwire, swire -%>\ - assign ${dwire} = ${swire}; - %endfor - -%endfor diff --git a/host/utils/rfnoc/templates/modules/ctrl_crossbar.v.mako b/host/utils/rfnoc/templates/modules/ctrl_crossbar.v.mako deleted file mode 100644 index 5872e270e..000000000 --- a/host/utils/rfnoc/templates/modules/ctrl_crossbar.v.mako +++ /dev/null @@ -1,39 +0,0 @@ -<%page args="seps, blocks"/>\ -\ -<% - import re - axisstr = "" - for block in reversed(list(blocks.keys())): - axisstr += "{0}_%s_ctrl_{1}, " % block - for sep in reversed(list(seps.keys())): - axisstr += "{0}_%s_ctrl_{1}, " % sep - axisstr += "{0}_core_ctrl_{1}" -%>\ -%for block in blocks: - wire [31:0] m_${block}_ctrl_tdata , s_${block}_ctrl_tdata ; - wire m_${block}_ctrl_tlast , s_${block}_ctrl_tlast ; - wire m_${block}_ctrl_tvalid, s_${block}_ctrl_tvalid; - wire m_${block}_ctrl_tready, s_${block}_ctrl_tready; -%endfor - - axis_ctrl_crossbar_nxn #( - .WIDTH (32), - .NPORTS (${len(seps) + len(blocks) + 1}), - .TOPOLOGY ("TORUS"), - .INGRESS_BUFF_SIZE(5), - .ROUTER_BUFF_SIZE (5), - .ROUTING_ALLOC ("WORMHOLE"), - .SWITCH_ALLOC ("PRIO") - ) ctrl_xb_i ( - .clk (rfnoc_ctrl_clk), - .reset (rfnoc_ctrl_rst), - .s_axis_tdata ({${axisstr.format("m", "tdata ")}}), - .s_axis_tvalid ({${axisstr.format("m", "tvalid")}}), - .s_axis_tlast ({${axisstr.format("m", "tlast ")}}), - .s_axis_tready ({${axisstr.format("m", "tready")}}), - .m_axis_tdata ({${axisstr.format("s", "tdata ")}}), - .m_axis_tvalid ({${axisstr.format("s", "tvalid")}}), - .m_axis_tlast ({${axisstr.format("s", "tlast ")}}), - .m_axis_tready ({${axisstr.format("s", "tready")}}), - .deadlock_detected() - ); diff --git a/host/utils/rfnoc/templates/modules/device_io_ports.v.mako b/host/utils/rfnoc/templates/modules/device_io_ports.v.mako deleted file mode 100644 index abfb86c98..000000000 --- a/host/utils/rfnoc/templates/modules/device_io_ports.v.mako +++ /dev/null @@ -1,9 +0,0 @@ -<%page args="io_ports"/>\ -<%import six%>\ -//// IO ports ////////////////////////////////// -%for name, io_port in six.iteritems(io_ports): -// ${name} - %for wire in io_port["wires"]: - ${wire["direction"]} wire [${"%3d" % wire["width"]}-1:0] ${wire["name"]}, - %endfor -%endfor diff --git a/host/utils/rfnoc/templates/modules/device_transport.v.mako b/host/utils/rfnoc/templates/modules/device_transport.v.mako deleted file mode 100644 index 3d752ce13..000000000 --- a/host/utils/rfnoc/templates/modules/device_transport.v.mako +++ /dev/null @@ -1,13 +0,0 @@ -<%page args="transports"/>\ -\ -%for i, transport in enumerate(transports): - // Transport ${i} (${transport["name"]} ${transport["type"]}) - input wire [${transport["width"]}-1:0] s_${transport["name"]}_tdata, - input wire s_${transport["name"]}_tlast, - input wire s_${transport["name"]}_tvalid, - output wire s_${transport["name"]}_tready, - output wire [${transport["width"]}-1:0] m_${transport["name"]}_tdata, - output wire m_${transport["name"]}_tlast, - output wire m_${transport["name"]}_tvalid, - input wire m_${transport["name"]}_tready${"," if i < len(transports) - 1 else ""} -%endfor diff --git a/host/utils/rfnoc/templates/modules/drive_unused_ports.v.mako b/host/utils/rfnoc/templates/modules/drive_unused_ports.v.mako deleted file mode 100644 index dfa1e7eb6..000000000 --- a/host/utils/rfnoc/templates/modules/drive_unused_ports.v.mako +++ /dev/null @@ -1,21 +0,0 @@ -<%page args="connections, block_ports"/>\ -<% - sources = [] - destinations = [] - for connection in connections: - sources.append((connection["srcblk"], connection["srcport"])) - destinations.append((connection["dstblk"], connection["dstport"])) -%>\ -%for (block_name, port_name, direction) in block_ports: - %if direction == "input": - %if not (block_name, port_name) in destinations: - assign s_${block_name}_${port_name}_tdata = {CHDR_W{1'b0}}; - assign s_${block_name}_${port_name}_tlast = 1'b0; - assign s_${block_name}_${port_name}_tvalid = 1'b0; - %endif - %elif direction == "output": - %if not (block_name, port_name) in sources: - assign m_${block_name}_${port_name}_tready = 1'b1; - %endif - %endif -%endfor diff --git a/host/utils/rfnoc/templates/modules/rfnoc_block.v.mako b/host/utils/rfnoc/templates/modules/rfnoc_block.v.mako deleted file mode 100644 index ee4a811a8..000000000 --- a/host/utils/rfnoc/templates/modules/rfnoc_block.v.mako +++ /dev/null @@ -1,91 +0,0 @@ -<%page args="block_id, block_number, block_name, block, block_params, block_ports"/>\ -\ -<% - import re - import six - - # Create two strings, one for the input and one for the output, that each - # contains all the signal names to be connected to the input or output - # AXIS-CHDR ports of this block. - axis_inputs = "" - axis_outputs = "" - for port_desc in block_ports: - if port_desc[0] == block_name: - port_name = port_desc[1] - if port_desc[2] == "input": - axis_inputs = "{0}_%s_%s_{1}, " % (block_name, port_name) + axis_inputs - elif port_desc[2] == "output": - axis_outputs = "{0}_%s_%s_{1}, " % (block_name, port_name) + axis_outputs - axis_inputs = axis_inputs[:-2] - axis_outputs = axis_outputs[:-2] -%>\ - - // ---------------------------------------------------- - // ${block_name} - // ---------------------------------------------------- -%for clock in block.clocks: - %if not clock["name"] in ["rfnoc_chdr", "rfnoc_ctrl"]: - wire ${block_name}_${clock["name"]}_clk; - %endif -%endfor - wire [CHDR_W-1:0] ${axis_inputs.format("s", "tdata ")}; - wire ${axis_inputs.format("s", "tlast ")}; - wire ${axis_inputs.format("s", "tvalid")}; - wire ${axis_inputs.format("s", "tready")}; - wire [CHDR_W-1:0] ${axis_outputs.format("m", "tdata ")}; - wire ${axis_outputs.format("m", "tlast ")}; - wire ${axis_outputs.format("m", "tvalid")}; - wire ${axis_outputs.format("m", "tready")}; - -%if hasattr(block, "io_ports"): - %for name, io_port in six.iteritems(block.io_ports): - // ${name} - %for wire in io_port["wires"]: - wire [${"%3d" % wire["width"]}-1:0] ${block_name}_${wire["name"]}; - %endfor - %endfor -%endif - - rfnoc_block_${block.module_name} #( - .THIS_PORTID(${block_id}), - .CHDR_W(CHDR_W), -%for name, value in six.iteritems(block_params): - .${name}(${value}), -%endfor - .MTU(MTU) - ) b_${block_name}_${block_number} ( - .rfnoc_chdr_clk (rfnoc_chdr_clk), - .rfnoc_ctrl_clk (rfnoc_ctrl_clk), -%for clock in block.clocks: - %if not clock["name"] in ["rfnoc_chdr", "rfnoc_ctrl"]: - .${clock["name"]}_clk(${block_name}_${clock["name"]}_clk), - %endif -%endfor - .rfnoc_core_config (rfnoc_core_config[512*${block_number + 1}-1:512*${block_number}]), - .rfnoc_core_status (rfnoc_core_status[512*${block_number + 1}-1:512*${block_number}]), - -%if hasattr(block, "io_ports"): - %for name, io_port in six.iteritems(block.io_ports): - %for wire in io_port["wires"]: - .${wire["name"]}(${block_name}_${wire["name"]}), - %endfor - %endfor -%endif - - .s_rfnoc_chdr_tdata ({${axis_inputs.format("s", "tdata ")}}), - .s_rfnoc_chdr_tlast ({${axis_inputs.format("s", "tlast ")}}), - .s_rfnoc_chdr_tvalid({${axis_inputs.format("s", "tvalid")}}), - .s_rfnoc_chdr_tready({${axis_inputs.format("s", "tready")}}), - .m_rfnoc_chdr_tdata ({${axis_outputs.format("m", "tdata ")}}), - .m_rfnoc_chdr_tlast ({${axis_outputs.format("m", "tlast ")}}), - .m_rfnoc_chdr_tvalid({${axis_outputs.format("m", "tvalid")}}), - .m_rfnoc_chdr_tready({${axis_outputs.format("m", "tready")}}), - .s_rfnoc_ctrl_tdata (s_${block_name}_ctrl_tdata ), - .s_rfnoc_ctrl_tlast (s_${block_name}_ctrl_tlast ), - .s_rfnoc_ctrl_tvalid(s_${block_name}_ctrl_tvalid), - .s_rfnoc_ctrl_tready(s_${block_name}_ctrl_tready), - .m_rfnoc_ctrl_tdata (m_${block_name}_ctrl_tdata ), - .m_rfnoc_ctrl_tlast (m_${block_name}_ctrl_tlast ), - .m_rfnoc_ctrl_tvalid(m_${block_name}_ctrl_tvalid), - .m_rfnoc_ctrl_tready(m_${block_name}_ctrl_tready) - ); diff --git a/host/utils/rfnoc/templates/modules/sep_xb_wires.v.mako b/host/utils/rfnoc/templates/modules/sep_xb_wires.v.mako deleted file mode 100644 index 4aa7d56bb..000000000 --- a/host/utils/rfnoc/templates/modules/sep_xb_wires.v.mako +++ /dev/null @@ -1,12 +0,0 @@ -<%page args="seps"/>\ -\ -%for sep in seps: - wire [CHDR_W-1:0] xb_to_${sep}_tdata ; - wire xb_to_${sep}_tlast ; - wire xb_to_${sep}_tvalid; - wire xb_to_${sep}_tready; - wire [CHDR_W-1:0] ${sep}_to_xb_tdata ; - wire ${sep}_to_xb_tlast ; - wire ${sep}_to_xb_tvalid; - wire ${sep}_to_xb_tready; -%endfor diff --git a/host/utils/rfnoc/templates/modules/static_router.v.mako b/host/utils/rfnoc/templates/modules/static_router.v.mako deleted file mode 100644 index 3649c278b..000000000 --- a/host/utils/rfnoc/templates/modules/static_router.v.mako +++ /dev/null @@ -1,15 +0,0 @@ -<%page args="connections"/>\ -\ -%for connection in connections: -<% - srcblk = connection["srcblk"] - dstblk = connection["dstblk"] - srcport = "in" if connection["srcport"] == None else connection["srcport"] - dstport = "out" if connection["dstport"] == None else connection["dstport"] -%>\ - assign s_${dstblk}_${dstport}_tdata = m_${srcblk}_${srcport}_tdata ; - assign s_${dstblk}_${dstport}_tlast = m_${srcblk}_${srcport}_tlast ; - assign s_${dstblk}_${dstport}_tvalid = m_${srcblk}_${srcport}_tvalid; - assign m_${srcblk}_${srcport}_tready = s_${dstblk}_${dstport}_tready; - -%endfor
\ No newline at end of file diff --git a/host/utils/rfnoc/templates/modules/stream_endpoints.v.mako b/host/utils/rfnoc/templates/modules/stream_endpoints.v.mako deleted file mode 100644 index f8ecccb77..000000000 --- a/host/utils/rfnoc/templates/modules/stream_endpoints.v.mako +++ /dev/null @@ -1,92 +0,0 @@ -<%page args="seps"/>\ -<% - import math - import re - import six - - axis_inputs = {} - axis_outputs = {} - for i, sep in enumerate(seps): - inputs = "" - outputs = "" - for data_i in range(0,seps[sep]["num_data_i"]): - inputs = "s_{0}_in%d_{1}, " % (data_i) + inputs - axis_inputs[sep] = inputs[:-2] - for data_o in range(0,seps[sep]["num_data_o"]): - outputs = "m_{0}_out%d_{1}, " % (data_o) + outputs - axis_outputs[sep] = outputs[:-2] -%>\ -\ -%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) -else: - buff_size = 5 -%>\ - 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")}; - wire ${axis_outputs[sep].format(sep,"tready")}; - wire [CHDR_W-1:0] ${axis_inputs[sep].format(sep,"tdata")}; - wire ${axis_inputs[sep].format(sep,"tlast")}; - wire ${axis_inputs[sep].format(sep,"tvalid")}; - wire ${axis_inputs[sep].format(sep,"tready")}; - wire [31:0] m_${sep}_ctrl_tdata , s_${sep}_ctrl_tdata ; - wire m_${sep}_ctrl_tlast , s_${sep}_ctrl_tlast ; - wire m_${sep}_ctrl_tvalid, s_${sep}_ctrl_tvalid; - wire m_${sep}_ctrl_tready, s_${sep}_ctrl_tready; - - chdr_stream_endpoint #( - .PROTOVER (PROTOVER), - .CHDR_W (CHDR_W), - .AXIS_CTRL_EN (${int(seps[sep]["ctrl"])}), - .AXIS_DATA_EN (${int(seps[sep]["data"])}), - .NUM_DATA_I (${int(seps[sep]["num_data_i"])}), - .NUM_DATA_O (${int(seps[sep]["num_data_o"])}), - .INST_NUM (${i}), - .CTRL_XBAR_PORT (${i+1}), - .INGRESS_BUFF_SIZE (${buff_size}), - .MTU (MTU), - .REPORT_STRM_ERRS (1) - ) ${sep}_i ( - .rfnoc_chdr_clk (rfnoc_chdr_clk ), - .rfnoc_chdr_rst (rfnoc_chdr_rst ), - .rfnoc_ctrl_clk (rfnoc_ctrl_clk ), - .rfnoc_ctrl_rst (rfnoc_ctrl_rst ), - .device_id (device_id ), - .s_axis_chdr_tdata (xb_to_${sep}_tdata ), - .s_axis_chdr_tlast (xb_to_${sep}_tlast ), - .s_axis_chdr_tvalid (xb_to_${sep}_tvalid ), - .s_axis_chdr_tready (xb_to_${sep}_tready ), - .m_axis_chdr_tdata (${sep}_to_xb_tdata ), - .m_axis_chdr_tlast (${sep}_to_xb_tlast ), - .m_axis_chdr_tvalid (${sep}_to_xb_tvalid ), - .m_axis_chdr_tready (${sep}_to_xb_tready ), - .s_axis_data_tdata ({${axis_inputs[sep].format(sep,"tdata")}}), - .s_axis_data_tlast ({${axis_inputs[sep].format(sep,"tlast")}}), - .s_axis_data_tvalid ({${axis_inputs[sep].format(sep,"tvalid")}}), - .s_axis_data_tready ({${axis_inputs[sep].format(sep,"tready")}}), - .m_axis_data_tdata ({${axis_outputs[sep].format(sep,"tdata")}}), - .m_axis_data_tlast ({${axis_outputs[sep].format(sep,"tlast")}}), - .m_axis_data_tvalid ({${axis_outputs[sep].format(sep,"tvalid")}}), - .m_axis_data_tready ({${axis_outputs[sep].format(sep,"tready")}}), - .s_axis_ctrl_tdata (s_${sep}_ctrl_tdata ), - .s_axis_ctrl_tlast (s_${sep}_ctrl_tlast ), - .s_axis_ctrl_tvalid (s_${sep}_ctrl_tvalid), - .s_axis_ctrl_tready (s_${sep}_ctrl_tready), - .m_axis_ctrl_tdata (m_${sep}_ctrl_tdata ), - .m_axis_ctrl_tlast (m_${sep}_ctrl_tlast ), - .m_axis_ctrl_tvalid (m_${sep}_ctrl_tvalid), - .m_axis_ctrl_tready (m_${sep}_ctrl_tready), - .strm_seq_err_stb ( ), - .strm_data_err_stb ( ), - .strm_route_err_stb ( ), - .signal_data_err (1'b0 ) - ); - -%endfor |