Skip to content

Commit

Permalink
WIP Update python script to allow more register. Additionally align t…
Browse files Browse the repository at this point in the history
…he iDMA conf and the sMMU conf register to 64 Bit.
  • Loading branch information
Raphael Roth committed Dec 2, 2024
1 parent 837754d commit 07ad957
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
21 changes: 16 additions & 5 deletions src/frontend/reg/tpl/idma_reg.hjson.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ ${params}
}
]
},
{ name: "dummy_register",
desc: "Dummy Register to prevent that the core overwrites the smmu config register while writing the dma conf register!",
{ name: "dummy_register_1",
desc: "Dummy Register to align for 64 bit! TODO: Update Driver to avoid writing 64 Bit!",
swaccess: "rw",
hwaccess: "hro",
fields: [
{ bits: "0",
name: "dummy",
desc: "dummy flag"
{ bits: "31:0",
name: "dummy_bits_1",
desc: "Dummy Bits"
}
]
},
Expand All @@ -89,6 +89,17 @@ ${params}
}
]
},
{ name: "dummy_register_2",
desc: "Dummy Register to align for 64 bit! TODO: Update Driver to avoid writing 64 Bit!",
swaccess: "rw",
hwaccess: "hro",
fields: [
{ bits: "31:0",
name: "dummy_bits_2",
desc: "Dummy Bits"
}
]
},
{ name: "smmu_root_pt_h",
desc: "High Word of the root of the page table",
swaccess: "rw",
Expand Down
3 changes: 0 additions & 3 deletions src/frontend/reg/tpl/idma_reg.sv.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ module idma_${identifier} #(
logic [NumRegs-1:0] arb_valid;
logic [NumRegs-1:0] arb_ready;

logic dummy;

// register signals
reg_rsp_t [NumRegs-1:0] dma_ctrl_rsp;

Expand Down Expand Up @@ -141,7 +139,6 @@ module idma_${identifier} #(
smmu_f_user = dma_reg2hw[i].smmu.f_user.q;
smmu_f_update_tlb = dma_reg2hw[i].smmu.f_update_tlb.q;
smmu_pt_root_adr = {dma_reg2hw[i].smmu_root_pt_h.q , dma_reg2hw[i].smmu_root_pt_l.q};
dummy = dma_reg2hw[i].dummy_register.dummy.q;

% if num_dim != 1:
// ND connections
Expand Down
4 changes: 2 additions & 2 deletions util/mario/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def render_reg_hjson(fe_ids: dict, tpl_file: str) -> str:
# higher register depends on the bit-width: 32-bit-case just add alignment marks
if fe_ids[fe_id][0] == '32':
for i in range(0, 3 * int(fe_ids[fe_id][1])):
align_regs.append(f' {{ skipto: "{hex(8*i + 0xD0)}" }},\n')
align_regs.append(f' {{ skipto: "{hex(8*i + 0xE0)}" }},\n')

# assemble regs
regs = low_regs + align_regs
Expand Down Expand Up @@ -107,7 +107,7 @@ def render_reg_hjson(fe_ids: dict, tpl_file: str) -> str:
regs[1::2] = high_regs

# render
regs = ' { skipto: "0xD0" },\n' + ''.join(regs)[:-2]
regs = ' { skipto: "0xE0" },\n' + ''.join(regs)[:-2]

# unsupported bit width
else:
Expand Down

0 comments on commit 07ad957

Please sign in to comment.