aboutsummaryrefslogtreecommitdiffstats
path: root/host/utils/rfnoc/templates/modules/drive_unused_ports.v.mako
diff options
context:
space:
mode:
Diffstat (limited to 'host/utils/rfnoc/templates/modules/drive_unused_ports.v.mako')
-rw-r--r--host/utils/rfnoc/templates/modules/drive_unused_ports.v.mako38
1 files changed, 11 insertions, 27 deletions
diff --git a/host/utils/rfnoc/templates/modules/drive_unused_ports.v.mako b/host/utils/rfnoc/templates/modules/drive_unused_ports.v.mako
index e6df532f0..dfa1e7eb6 100644
--- a/host/utils/rfnoc/templates/modules/drive_unused_ports.v.mako
+++ b/host/utils/rfnoc/templates/modules/drive_unused_ports.v.mako
@@ -1,5 +1,4 @@
-<%page args="connections, blocks, block_descs, seps"/>\
-\
+<%page args="connections, block_ports"/>\
<%
sources = []
destinations = []
@@ -7,31 +6,16 @@
sources.append((connection["srcblk"], connection["srcport"]))
destinations.append((connection["dstblk"], connection["dstport"]))
%>\
-%for sep in seps:
- %for input in range(seps[sep]["num_data_i"]):
- %if not (sep, "in%d" % (input)) in destinations:
- assign s_${sep}_in${input}_tdata = 'h0;
- assign s_${sep}_in${input}_tlast = 1'b0;
- assign s_${sep}_in${input}_tvalid = 1'b0;
+%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
- %endfor
- %for output in range(seps[sep]["num_data_o"]):
- %if not (sep, "out%d" % (output)) in sources:
- assign m_${sep}_out${output}_tready = 1'b1;
+ %elif direction == "output":
+ %if not (block_name, port_name) in sources:
+ assign m_${block_name}_${port_name}_tready = 1'b1;
%endif
- %endfor
-%endfor
-%for block in blocks:
- %for input in block_descs[blocks[block]["block_desc"]].data["inputs"]:
- %if not (block, input) in destinations:
- assign s_${block}_${input}_tdata = ${block_descs[blocks[block]["block_desc"]].chdr_width}'h0;
- assign s_${block}_${input}_tlast = 1'b0;
- assign s_${block}_${input}_tvalid = 1'b0;
- %endif
- %endfor
- %for output in block_descs[blocks[block]["block_desc"]].data["outputs"]:
- %if not (block, output) in sources:
- assign m_${block}_${output}_tready = 1'b1;
- %endif
- %endfor
+ %endif
%endfor