Error response for unmapped address or forbidden read/write access (#168)
* feat: add ability to enable error output on the cpuif, when decoding errors occur (generate_cpuif_err in API). * fix: move signal to new place (after automatic vers) * feat: add info about new api (generate_cpuif_err) * fix: repair readback with latency * Adding generate_cpuif_err argument to peakrdl-regblock to generate cpuif error response, when the address is decoded incorrectly * add sw rd or/and wr attribure error response related and add error respone for external mem * add sw rd or/and wr error response test * add sw rd or/and wr error response for external register test and fix generation of rtl logic for external register * add sw rd or/and wr error response for external mem test * add sw rd or/and wr error response for apb3 imterfaces driver * add error response test for APB4, AXI4Lite and Avalon interfaces * rename --generate_cpuif_err to --generate-cpuif-err * style: minor typo fixes and test clean-up * refactor: move expected error check inside write/read functions * feat: add error response check to OBI testbench interface * feat: split generate-cpuif-err option into err-if-bad-addr and err-if-bad-rw options * feat: add err_if_bad_addr/rw to cfg_schema * feat: extend cpuif_err_rsp test to cover all combinations of bad_addr/bad_rw * style: lint fixes * fix: removed redundant if node.external condition to help coverage * Fix dangling hwif_in signals in testcase --------- Co-authored-by: Denis Trifonov <d.trifonov@yadro.com> Co-authored-by: Dominik Tanous <tanous@kandou.com> Co-authored-by: Sebastien Baillou <baillou@kandou.com> Co-authored-by: Alex Mykyta <amykyta3@users.noreply.github.com>
This commit is contained in:
@@ -22,6 +22,8 @@ class Exporter(ExporterSubcommandPlugin):
|
||||
cfg_schema = {
|
||||
"cpuifs": {"*": schema.PythonObjectImport()},
|
||||
"default_reset": schema.Choice(["rst", "rst_n", "arst", "arst_n"]),
|
||||
"err_if_bad_addr": schema.Boolean(),
|
||||
"err_if_bad_rw": schema.Boolean(),
|
||||
}
|
||||
|
||||
@functools.lru_cache()
|
||||
@@ -141,6 +143,20 @@ class Exporter(ExporterSubcommandPlugin):
|
||||
is active-high and synchronous [rst]"""
|
||||
)
|
||||
|
||||
arg_group.add_argument(
|
||||
"--err-if-bad-addr",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="Generate CPUIF error response, when the address is decoded incorrectly"
|
||||
)
|
||||
|
||||
arg_group.add_argument(
|
||||
"--err-if-bad-rw",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="""Generate CPUIF error response, when an illegal access is
|
||||
performed to a read-only or write-only register"""
|
||||
)
|
||||
|
||||
def do_export(self, top_node: 'AddrmapNode', options: 'argparse.Namespace') -> None:
|
||||
cpuifs = self.get_cpuifs()
|
||||
@@ -203,5 +219,7 @@ class Exporter(ExporterSubcommandPlugin):
|
||||
generate_hwif_report=options.hwif_report,
|
||||
address_width=options.addr_width,
|
||||
default_reset_activelow=default_reset_activelow,
|
||||
err_if_bad_addr=options.err_if_bad_addr or self.cfg['err_if_bad_addr'],
|
||||
err_if_bad_rw=options.err_if_bad_rw or self.cfg['err_if_bad_rw'],
|
||||
default_reset_async=default_reset_async,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user