E6008

E6008 — A Memory declaration has a non-positive capacity, bandwidth, or granule.

What the compiler reports

E6008 … 'Unaddressable' … non-positive `granule`

The fragments the test suite holds the compiler to. An ellipsis marks text the test does not constrain; the emitted message also carries a source location.

A program that triggers it

//
// Part of the Vx Project, under the Apache License v2.0 with LLVM Exceptions.
// See LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// The third field E6008 covers.
//
// `granule` is the unit a space is addressed in, so it is the divisor in every
// alignment and every occupancy figure computed against the space. Zero makes
// each of those a division by zero -- the declaration is refused here rather
// than left to fault somewhere in the middle of a placement decision.
//

Memory CPU_DRAM {}
Memory Unaddressable {
  within: Memory::CPU_DRAM, capacity: 8 GiB, granule: 0 KiB
}

fn main() -> i32 {
  return 0;
}

From tests/frontend/fail/memory_granule_is_positive.vx, which asserts this diagnostic on every commit.

Related