Skip to content

Commit

Permalink
Support multiple protocols with reg frontend
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Benz <[email protected]>
  • Loading branch information
micprog and thommythomaso committed Aug 6, 2024
1 parent a6b190c commit 67c206e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/frontend/reg/tpl/idma_reg.hjson.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ ${params}
name: "enable_nd",
desc: "ND-extension enabled"
}
{ bits: "${src_prot_range}",
name: "src_protocol",
desc: "Selection of the source protocol"
}
{ bits: "${dst_prot_range}",
name: "dst_protocol",
desc: "Selection of the destination protocol"
}
]
},
{ multireg:
Expand Down
4 changes: 4 additions & 0 deletions src/frontend/reg/tpl/idma_reg.sv.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ module idma_${identifier} #(
arb_dma_req[i]${sep}dst_addr = {dma_reg2hw[i].dst_addr_high.q, dma_reg2hw[i].dst_addr_low.q};
% 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);

// Current backend only supports incremental burst
arb_dma_req[i]${sep}opt.src.burst = axi_pkg::BURST_INCR;
arb_dma_req[i]${sep}opt.dst.burst = axi_pkg::BURST_INCR;
Expand Down
5 changes: 4 additions & 1 deletion util/mario/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import math
from mako.template import Template

NUM_PROT_BITS = 3 - 1

def render_register(content: dict):
"""Render a register"""
Expand Down Expand Up @@ -129,7 +130,9 @@ def render_reg_hjson(fe_ids: dict, tpl_file: str) -> str:
'identifier': fe_id,
'params': params,
'registers': regs,
'dim_range': f'{10+num_dim_bits}:10'
'dim_range': f'{10+num_dim_bits}:10',
'src_prot_range': f'{10+num_dim_bits+NUM_PROT_BITS}:{10+num_dim_bits}',
'dst_prot_range': f'{10+num_dim_bits+2*NUM_PROT_BITS}:{10+num_dim_bits+NUM_PROT_BITS}'
}

# render
Expand Down

0 comments on commit 67c206e

Please sign in to comment.