When Two Addresses Refer to the Same Resource

A memory map can expose one resource through more than one address. Such aliases differ from two independent storage locations.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace a conceptual register
  2. Check the address map
  3. Compare two routes to the same stored resource
  4. Check when mapping and access policy can change

Trace a conceptual register

Suppose two addresses both select a shared device setting. Writing five through one can make the other read five. This resembles object identity because two references denote one underlying entity.

Check the address map

Two numerically different addresses in a simple RAM may refer to different cells. Device maps and translations define any exceptions. A memory read and write contract should identify which addressing rules apply.[1]

Compare two routes to the same stored resource

In a toy mapping, virtual locations 100 and 500 can both refer to the same underlying byte. Writing through location 100 then reading 500 observes the same updated byte under ordinary coherent memory semantics. Different names or addresses alone do not prove independence. See object identity and equality.

Before: both view underlying byte X with value 4
Write 8 via address 100
Read via address 500 → 8 after observing the write
An unmapped address has a separate failure outcome

Check when mapping and access policy can change

Aliases may differ in permissions or lifetime. If one mapping is removed, another can still refer to the underlying resource. Test read and write permissions and interpret observed ordering according to the actual memory model.

References

  1. Noam Nisan and Shimon Schocken, From Nand to Tetris: Course Projects ↩