Skip to content

Commit

Permalink
Multistream register frontend: Fix compilation
Browse files Browse the repository at this point in the history
Co-authored-by: Georg Rutishauser <[email protected]>
  • Loading branch information
micprog and da-gazzi committed Aug 6, 2024
1 parent 67c206e commit b68a4f7
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/frontend/reg/tpl/idma_reg.sv.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ module idma_${identifier} #(
// register signals
reg_rsp_t [NumRegs-1:0] dma_ctrl_rsp;

always_comb begin
stream_idx_o = '0;
for (int r = 0; r < NumRegs; r++) begin
for (int c = 0; c < NumStreams; c++) begin
if (dma_reg2hw[r].next_id[c].re) begin
stream_idx_o = c;
end
end
end
end

// generate the registers
for (genvar i = 0; i < NumRegs; i++) begin : gen_core_regs

Expand Down Expand Up @@ -87,12 +98,8 @@ module idma_${identifier} #(
logic read_happens;
always_comb begin : proc_launch
read_happens = 1'b0;
stream_idx_o = '0;
for (int c = 0; c < NumStreams; c++) begin
read_happens |= dma_reg2hw[i].next_id[c].re;
if (dma_reg2hw[i].next_id[c].re) begin
stream_idx_o = c;
end
end
arb_valid[i] = read_happens;
end
Expand All @@ -114,8 +121,8 @@ module idma_${identifier} #(
% endif

// Protocols
arb_dma_req[i]${sep}src_protocol = idma_pkg::protocol_e'(dma_reg2hw[i].conf.src_protocol);
arb_dma_req[i]${sep}dst_protocol = idma_pkg::protocol_e'(dma_reg2hw[i].conf.dst_protocol);
arb_dma_req[i]${sep}opt.src_protocol = idma_pkg::protocol_e'(dma_reg2hw[i].conf.src_protocol);
arb_dma_req[i]${sep}opt.dst_protocol = idma_pkg::protocol_e'(dma_reg2hw[i].conf.dst_protocol);

// Current backend only supports incremental burst
arb_dma_req[i]${sep}opt.src.burst = axi_pkg::BURST_INCR;
Expand Down

0 comments on commit b68a4f7

Please sign in to comment.