Exemple #1
0
 def test_x(self):
     ramrgn = RamRegion(name='core0 ram', start=0x1fffa000, length=0x18000)
     assert ramrgn.contains_range(0x1fffc9f8, end=0x1fffc9fc)
     assert ramrgn.intersects_range(0x1fffc9f8, end=0x1fffc9fc)
     dualMap = MemoryMap(
         FlashRegion(name='flash', start=0, length=0x80000, blocksize=0x800, is_boot_memory=True),
         RomRegion(name='core1 imem alias', start=0x1d200000, length=0x40000),
         ramrgn,
         RomRegion(name='core1 imem', start=0x2d200000, length=0x40000),
         RamRegion(name='core1 dmem', start=0x2d300000, length=0x8000),
         RamRegion(name='usb ram', start=0x40100000, length=0x800)
         )
     rgns = dualMap.get_intersecting_regions(0x1fffc9f8, end=0x1fffc9fc)
     assert len(rgns) > 0
 def test_x(self):
     ramrgn = RamRegion(name='core0 ram', start=0x1fffa000, length=0x18000)
     assert ramrgn.contains_range(0x1fffc9f8, end=0x1fffc9fc)
     assert ramrgn.intersects_range(0x1fffc9f8, end=0x1fffc9fc)
     dualMap = MemoryMap(
         FlashRegion(name='flash',
                     start=0,
                     length=0x80000,
                     blocksize=0x800,
                     is_boot_memory=True),
         RomRegion(name='core1 imem alias',
                   start=0x1d200000,
                   length=0x40000), ramrgn,
         RomRegion(name='core1 imem', start=0x2d200000, length=0x40000),
         RamRegion(name='core1 dmem', start=0x2d300000, length=0x8000),
         RamRegion(name='usb ram', start=0x40100000, length=0x800))
     rgns = dualMap.get_intersecting_regions(0x1fffc9f8, end=0x1fffc9fc)
     assert len(rgns) > 0
 def test_empty_map(self):
     memmap = MemoryMap()
     assert memmap.region_count == 0
     assert memmap.regions == []
     assert memmap.get_boot_memory() is None
     assert memmap.get_region_for_address(0x1000) is None
     assert not memmap.is_valid_address(0x2000)
     assert memmap.get_contained_regions(0, end=0xffffffff) == []
     assert memmap.get_intersecting_regions(0, end=0xffffffff) == []
Exemple #4
0
 def test_empty_map(self):
     memmap = MemoryMap()
     assert memmap.region_count == 0
     assert memmap.regions == []
     assert memmap.get_boot_memory() is None
     assert memmap.get_region_for_address(0x1000) is None
     assert not memmap.is_valid_address(0x2000)
     assert memmap.get_contained_regions(0, end=0xffffffff) == []
     assert memmap.get_intersecting_regions(0, end=0xffffffff) == []
def memmap2(flash, rom, ram1, ram2, ram_alias):
    return MemoryMap(flash, rom, ram1, ram2, ram_alias)
def memmap(flash, rom, ram1, ram2):
    return MemoryMap(flash, rom, ram1, ram2)
Exemple #7
0
 def test_multiple_unnamed_regions(self):
     map = MemoryMap(RomRegion(0x01000000, length=0x8000),
                     RamRegion(0x20000000, length=0x8000))
     assert len(map) == 2
Exemple #8
0
 def test_abc(self):
     assert isinstance(MemoryMap(), collections.abc.Sequence)