Skip to content

Commit 8d9016d

Browse files
committed
Adapted osd_event_packetization for module specific TYPE_SUB
1 parent 27a590e commit 8d9016d

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

blocks/eventpacket/common/osd_event_packetization.sv

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ module osd_event_packetization #(
5555
input [15:0] dest,
5656
// Generate an overflow packet
5757
input overflow,
58-
58+
59+
// Module specific sub-type (TYPE_SUB)
60+
input [2:0] mod_type_sub,
61+
5962
// a new event is available
6063
input event_available,
6164
// the packet has been sent
@@ -105,8 +108,9 @@ module osd_event_packetization #(
105108
assign data_req_idx = word_cnt;
106109
assign data_req_valid = (state == PAYLOAD || state == OVERFLOW);
107110

108-
localparam TYPE_SUB_LAST = 4'h0;
109-
localparam TYPE_SUB_CONTINUE = 4'h1;
111+
localparam TYPE_SUB_LAST = 1'b0;
112+
localparam TYPE_SUB_CONTINUE = 1'b1;
113+
110114
localparam TYPE_SUB_OVERFLOW = 4'h5;
111115

112116
always_ff @(posedge clk) begin
@@ -157,15 +161,23 @@ module osd_event_packetization #(
157161
debug_out.data[15:14] = 2'b10; // TYPE == EVENT
158162

159163
// TYPE_SUB
160-
if (overflow) begin
164+
debug_out.data[13:11] = mod_type_sub[2:0];
165+
166+
if (pkg_cnt == num_pkgs - 1) begin
167+
debug_out.data[10] = TYPE_SUB_LAST;
168+
end else begin
169+
debug_out.data[10] = TYPE_SUB_CONTINUE;
170+
end
171+
172+
/*if (overflow) begin
161173
debug_out.data[13:10] = TYPE_SUB_OVERFLOW;
162174
end else begin
163175
if (pkg_cnt == num_pkgs - 1) begin
164176
debug_out.data[13:10] = TYPE_SUB_LAST;
165177
end else begin
166178
debug_out.data[13:10] = TYPE_SUB_CONTINUE;
167179
end
168-
end
180+
end*/
169181

170182
debug_out.data[9:0] = 10'h0; // reserved
171183
debug_out.valid = 1;

blocks/eventpacket/common/osd_event_packetization_fixedwidth.sv

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ module osd_event_packetization_fixedwidth #(
5656
input [15:0] dest,
5757
// Generate an overflow packet
5858
input overflow,
59+
60+
// Module specific sub-type (TYPE_SUB)
61+
input [2:0] mod_type_sub,
5962

6063
// a new event is available
6164
input event_available,
@@ -100,6 +103,7 @@ module osd_event_packetization_fixedwidth #(
100103
.id(id),
101104
.dest(dest),
102105
.overflow(overflow),
106+
.mod_type_sub(mod_type_sub),
103107
.event_available(event_available),
104108
.event_consumed(event_consumed),
105109

blocks/eventpacket/test/test_osd_event_packetization_fixedwidth.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def test_fixedwidth(dut):
5757
data_int = int.from_bytes(data_bytes, byteorder='little', signed=False)
5858
dut.data.value = BinaryValue(data_int)
5959

60+
dut.mod_type_sub <= 0
6061
dut.overflow <= 0
6162
dut.event_available <= 1
6263

0 commit comments

Comments
 (0)