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 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 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