Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutRoadmapCareersInternshipsFAQContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Course
  • The NanoSoC Tour
  • Reading Path
  • SoC Glossary10
  • SoC Metrics Reference
  • SoC Cheatsheet
  • What SoC Integration Is12
  • Architecture and Budgets21
  • Memory Maps and Address Decode26
  • Interconnect and Bus Fabrics26
    • Topologies and Bridges
    • AXI Integration Details
    • Ordering and Deadlock at the Top
    • QoS and Arbitration
    • NoC Basics
    • Coherent Interconnect View
    • Firewalls and Protection
      • Secure-Access Filters
      • Address-Range Firewalls and Master IDs
      • Failure Modes and Debug
    • Bandwidth and Latency Verification
  • Clock and Reset Architecture24
  • Power Architecture21
  • Interrupts, DMA and Peripherals15
  • Memories, Boot and Security21
  • IP Integration and Handoff21
  • Top-Level Verification and Bring-up21
  • Package, Pads and I/O18
  • Chip Signoff and Tapeout18
  • SoC Interview Prep16
  • Capstone: Integrate NanoSoC14
Loading lesson

←Firewalls and Protection
  1. Topics
  2. SoC Design
  3. Interconnect and Bus Fabrics
  4. Firewalls and Protection
  5. Address-Range Firewalls and Master IDs
On this page

    Part 4 of 14, lesson 22 of 26Part 4 of 14/Interconnect and Bus Fabrics/Lesson 22 of 26All levels

    Address-Range Firewalls and Master IDs

    A complete policy table for every region and master, and a proposed master-ID firewall that NanoSoC does not yet build.

    Why it matters

    A filter that knows secure from non-secure but not DMA from CPU cannot express a policy like the SBR may stream SRAM buffers but must never touch the reset controller, even when both masters are secure. On NanoSoC today that policy is not enforced: with CTRL.NS cleared the SBR is a secure master and can write RSTPWR. Address-range firewalls keyed on master identity would add the who dimension. This lesson writes the whole policy table, compares what the hardware enforces with what a master-ID firewall would add, and labels the second as a proposed extension.

    The core idea

    The policy is one table: each row names a region, the masters admitted, and the response for everyone else. A complete table has a row for every mapped region and every hole, and a cell for every master: the review rule is that no cell is blank. NanoSoC enforces only the secure column of the map through AxPROT[1]. The proposed firewall would add master identity: the identity is the AXI ID with the master-index bit the interconnect adds (see the ID lesson), and it is trustworthy as an identity only because the interconnect adds those bits, not because the master drives them. Every bridge, converter and CDC stage would have to carry it untouched, because a bridge that drops sideband bits silently widens every region to every master.

    Region

    Secure only (built)

    CPU (proposed)

    SBR (proposed)

    BOOTROM

    No

    Read

    Read

    SRAM0

    No

    Read, write

    Read, write

    SRAM1

    Yes

    Read, write

    Read, write

    DMA registers

    No

    Read, write

    Deny

    SBR registers

    No

    Read, write

    Deny

    UART, SPI, GPIO

    No

    Read, write

    Deny

    INTC

    No

    Read, write

    Deny

    RSTPWR

    Yes

    Read, write

    Deny

    Holes H1, H2, H4

    n/a

    DECERR

    DECERR

    Hole H3

    n/a

    SLVERR

    SLVERR

    example.py
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    # NanoSoC teaching values: complete policy tables. BUILT is the AxPROT filter, PROPOSED adds master IDs.
    REGIONS = ["BOOTROM", "SRAM0", "SRAM1", "DMA", "SBR", "UART", "SPI", "GPIO", "INTC", "RSTPWR",
               "H1", "H2", "H3", "H4"]
    MASTERS = ["CPU", "SBR"]
    SECURE_ONLY = {"SRAM1", "RSTPWR"}
    HOLES = {"H1": "DECERR", "H2": "DECERR", "H3": "SLVERR", "H4": "DECERR"}
    
    def built(master, master_ns, region):
        # what NanoSoC enforces today: only the secure column, no master identity
        if region in HOLES:
            return HOLES[region]
        if master_ns and region in SECURE_ONLY:
            return "SLVERR"
        return "allow"
    
    # PROPOSED: a master-ID firewall; every row lists every master, deny is explicit
    PROPOSED = {
        "BOOTROM": {"CPU": True, "SBR": True},
        "SRAM0": {"CPU": True, "SBR": True},
        "SRAM1": {"CPU": True, "SBR": True},
        "DMA": {"CPU": True, "SBR": False},
        "SBR": {"CPU": True, "SBR": False},
        "UART": {"CPU": True, "SBR": False},
        "SPI": {"CPU": True, "SBR": False},
        "GPIO": {"CPU": True, "SBR": False},
        "INTC": {"CPU": True, "SBR": False},
        "RSTPWR": {"CPU": True, "SBR": False},
    }
    
    def proposed(master, master_ns, region):
        if region in HOLES:
            return HOLES[region]
        if not PROPOSED[region][master]:
            return "SLVERR"
        return built(master, master_ns, region)
    
    # completeness: no blank cell, every mapped region has an explicit answer for every master
    for r in REGIONS:
        if r in HOLES:
            continue
        assert r in PROPOSED, "missing policy row: " + r
        assert set(PROPOSED[r]) == set(MASTERS), "blank master cell in row " + r
    # the policy difference: a secure SBR can write RSTPWR today, not with the firewall
    assert built("SBR", False, "RSTPWR") == "allow"
    assert proposed("SBR", False, "RSTPWR") == "SLVERR"
    assert proposed("CPU", False, "UART") == "allow" and built("CPU", True, "UART") == "allow"
    assert proposed("SBR", True, "SRAM1") == "SLVERR" # NS still blocks SRAM1 either way
    assert built("CPU", True, "H3") == "SLVERR" and built("SBR", False, "H4") == "DECERR"
    # a table with a missing row would be caught by the completeness loop
    broken = dict(PROPOSED)
    del broken["UART"]
    assert any(r not in broken for r in REGIONS if r not in HOLES)
    print("PASS: 14-region table complete, a secure SBR reaches RSTPWR today and is fenced by the proposed firewall")

    What the review looks for

    • The policy table lists every region (holes included) against every master, with deny as the explicit default, never a blank cell, and it says which columns are built and which are proposed.

    • Sideband width is checked at every bridge: lint proves no ID or protection bit is truncated in transit.

    • Reserved regions have rows that deny, so growth opens them deliberately instead of discovering them open.

    Verify and debug

    Run security-directed tests that walk the whole table: each admitted pair completes, each denied pair returns SLVERR, from the right responder. Today that means the secure column; with a master-ID firewall it would also walk the master column. Then run sideband connectivity checks that prove the ID and protection bits arriving at each filter equal the bits the master sent; a bridge that drops them passes functional tests and fails only these. Re-run the table whenever a region is added: H3 slots open one row at a time.

    Security attribute dropped in transit: a bridge or converter does not propagate AxPROT or master-ID sideband to the firewall, so a non-secure master reaches a secure peripheral or any master reaches a fenced region. Caught by security-directed tests and sideband connectivity checks; fixed by carrying sidebands end to end with the firewall at the slave.

    If asked to fence a DMA off control registers, answer with the table row first and the mechanism second: SBR not admitted to RSTPWR, enforced by an address-range firewall on master identity, with SLVERR as the response. Then be honest about the chip in front of you: NanoSoC has only the AxPROT filter, so this fence is a proposal, and the sideband warning applies: the fence is only as good as the bits the bridges carry.

    Check yourself The SBR must be fenced off the UART as well as RSTPWR. What changes on NanoSoC today, and in the proposed firewall?

    Today nothing can: the AxPROT filter has no master identity and the UART slot is non-secure. In the proposed firewall it is one table row, plus the directed test that proves the denial and the sideband check that the SBR identity reaches the filter.

    Related topics

    • Secure-Access Filters

    • Next: Failure Modes and Debug

    • Protocol First Principles: Firewalls and Filtering

    Previous

    89 / 289

    Next: Failure Modes and Debug

    Up next

    Up nextFailure Modes and Debug

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error