Skip to content

Commit b4cebd8

Browse files
committed
Fix crosspoint wrapper generator
1 parent c759ff0 commit b4cebd8

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

rtl/axis_crosspoint_wrap.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ def generate(ports=4, name=None, output=None):
8585
parameter LAST_ENABLE = 1,
8686
parameter ID_ENABLE = 0,
8787
parameter ID_WIDTH = 8,
88-
parameter DEST_WIDTH = {{cm}},
88+
parameter DEST_ENABLE = 0,
89+
parameter DEST_WIDTH = 8,
8990
parameter USER_ENABLE = 1,
9091
parameter USER_WIDTH = 1
9192
)
@@ -115,8 +116,14 @@ def generate(ports=4, name=None, output=None):
115116
output wire m{{'%02d'%p}}_axis_tlast,
116117
output wire [ID_WIDTH-1:0] m{{'%02d'%p}}_axis_tid,
117118
output wire [DEST_WIDTH-1:0] m{{'%02d'%p}}_axis_tdest,
118-
output wire [USER_WIDTH-1:0] m{{'%02d'%p}}_axis_tuser{% if not loop.last %},{% endif %}
119-
{% endfor -%}
119+
output wire [USER_WIDTH-1:0] m{{'%02d'%p}}_axis_tuser,
120+
{% endfor %}
121+
/*
122+
* Control
123+
*/
124+
{%- for p in range(n) %}
125+
input wire [{{cm-1}}:0] m{{'%02d'%p}}_select{% if not loop.last %},{% endif %}
126+
{%- endfor %}
120127
);
121128
122129
axis_crosspoint #(
@@ -128,6 +135,7 @@ def generate(ports=4, name=None, output=None):
128135
.LAST_ENABLE(LAST_ENABLE),
129136
.ID_ENABLE(ID_ENABLE),
130137
.ID_WIDTH(ID_WIDTH),
138+
.DEST_ENABLE(DEST_ENABLE),
131139
.DEST_WIDTH(DEST_WIDTH),
132140
.USER_ENABLE(USER_ENABLE),
133141
.USER_WIDTH(USER_WIDTH)
@@ -150,7 +158,9 @@ def generate(ports=4, name=None, output=None):
150158
.m_axis_tlast({ {% for p in range(n-1,-1,-1) %}m{{'%02d'%p}}_axis_tlast{% if not loop.last %}, {% endif %}{% endfor %} }),
151159
.m_axis_tid({ {% for p in range(n-1,-1,-1) %}m{{'%02d'%p}}_axis_tid{% if not loop.last %}, {% endif %}{% endfor %} }),
152160
.m_axis_tdest({ {% for p in range(n-1,-1,-1) %}m{{'%02d'%p}}_axis_tdest{% if not loop.last %}, {% endif %}{% endfor %} }),
153-
.m_axis_tuser({ {% for p in range(n-1,-1,-1) %}m{{'%02d'%p}}_axis_tuser{% if not loop.last %}, {% endif %}{% endfor %} })
161+
.m_axis_tuser({ {% for p in range(n-1,-1,-1) %}m{{'%02d'%p}}_axis_tuser{% if not loop.last %}, {% endif %}{% endfor %} }),
162+
// Control
163+
.select({ {% for p in range(n-1,-1,-1) %}m{{'%02d'%p}}_select{% if not loop.last %}, {% endif %}{% endfor %} })
154164
);
155165
156166
endmodule

0 commit comments

Comments
 (0)