From b4cebd83949e8ae68f7684d6065acbb8826cef9c Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Wed, 24 Jul 2019 13:44:43 -0700 Subject: [PATCH] Fix crosspoint wrapper generator --- rtl/axis_crosspoint_wrap.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/rtl/axis_crosspoint_wrap.py b/rtl/axis_crosspoint_wrap.py index 7f2dcba99..11e9e84e0 100755 --- a/rtl/axis_crosspoint_wrap.py +++ b/rtl/axis_crosspoint_wrap.py @@ -85,7 +85,8 @@ module {{name}} # parameter LAST_ENABLE = 1, parameter ID_ENABLE = 0, parameter ID_WIDTH = 8, - parameter DEST_WIDTH = {{cm}}, + parameter DEST_ENABLE = 0, + parameter DEST_WIDTH = 8, parameter USER_ENABLE = 1, parameter USER_WIDTH = 1 ) @@ -115,8 +116,14 @@ module {{name}} # output wire m{{'%02d'%p}}_axis_tlast, output wire [ID_WIDTH-1:0] m{{'%02d'%p}}_axis_tid, output wire [DEST_WIDTH-1:0] m{{'%02d'%p}}_axis_tdest, - output wire [USER_WIDTH-1:0] m{{'%02d'%p}}_axis_tuser{% if not loop.last %},{% endif %} -{% endfor -%} + output wire [USER_WIDTH-1:0] m{{'%02d'%p}}_axis_tuser, +{% endfor %} + /* + * Control + */ +{%- for p in range(n) %} + input wire [{{cm-1}}:0] m{{'%02d'%p}}_select{% if not loop.last %},{% endif %} +{%- endfor %} ); axis_crosspoint #( @@ -128,6 +135,7 @@ axis_crosspoint #( .LAST_ENABLE(LAST_ENABLE), .ID_ENABLE(ID_ENABLE), .ID_WIDTH(ID_WIDTH), + .DEST_ENABLE(DEST_ENABLE), .DEST_WIDTH(DEST_WIDTH), .USER_ENABLE(USER_ENABLE), .USER_WIDTH(USER_WIDTH) @@ -150,7 +158,9 @@ axis_crosspoint_inst ( .m_axis_tlast({ {% for p in range(n-1,-1,-1) %}m{{'%02d'%p}}_axis_tlast{% if not loop.last %}, {% endif %}{% endfor %} }), .m_axis_tid({ {% for p in range(n-1,-1,-1) %}m{{'%02d'%p}}_axis_tid{% if not loop.last %}, {% endif %}{% endfor %} }), .m_axis_tdest({ {% for p in range(n-1,-1,-1) %}m{{'%02d'%p}}_axis_tdest{% if not loop.last %}, {% endif %}{% endfor %} }), - .m_axis_tuser({ {% for p in range(n-1,-1,-1) %}m{{'%02d'%p}}_axis_tuser{% if not loop.last %}, {% endif %}{% endfor %} }) + .m_axis_tuser({ {% for p in range(n-1,-1,-1) %}m{{'%02d'%p}}_axis_tuser{% if not loop.last %}, {% endif %}{% endfor %} }), + // Control + .select({ {% for p in range(n-1,-1,-1) %}m{{'%02d'%p}}_select{% if not loop.last %}, {% endif %}{% endfor %} }) ); endmodule