Skip to content

Initialization of buffers in neighboring tiles causes link error when compiling with CHESS #2752

@jackl-xilinx

Description

@jackl-xilinx

In a scenario when a tile uses the local memories of adjacent tiles and those buffers are initialized with a starting value, the tool gives a linking error. The scenario looks like like:

main_tile = tile(1,3)
west_tile = tile(0,3)
north_tile = tile(1,4) 
south_tile = tile(1,2)

lut0_buf = buffer(west_tile, lut0_ty, initial_value=np.array(lut0_arr, dtype=np.int16)
lut1_buf = buffer(north_tile, lut1_ty, initial_value=np.array(lut1_arr, dtype=np.int16)
lut2_buf = buffer(south_tile, lut2_ty, initial_value=np.array(lut2_arr, dtype=np.int16)
lut3_buf = buffer(main_tile, lut3_ty, initial_value=np.array(lut3_arr, dtype=np.int16)

@core(main_tile, archvie)
def core_body():
    for _ in range_(sys.maxsize):
        di = self.din.acquire(ObjectFifoPort.Consume, 1)
        func(di, lut0_buf, lut1_buf, lut2_buf, lut3_buf)
        self.din.relase(ObjectFifoPort.Consume, 1)

This creates a llvm IR output (.ll) where the buffers are:

@lut3_buf = global [20064 x i16] [i16 0, i16 0 ...]
...

In chess, it seems to try to map these all to the same tile's local memory and complains that there is not enough space:

cd build && aiecc.py -v --aie-generate-xclbin --no-compile-host --xclbin-name=final.xclbin --alloc-scheme=basic-sequential \
            --aie-generate-npu-insts --npu-insts-name=insts.bin ../build/aie.mlir
Error: could not find space for DefSymbol 'lut1_buf' using base address 0
... Symbol was found in file   : '/wrk/xcohdnobkup1/jacklo/mlir-aie.ghe/programming_examples/ml/magika/build/aie.mlir.prj/main_input.o'
Error: error copying memory section item
Error: in "/wrk/xcohdnobkup1/jacklo/mlir-aie.ghe/programming_examples/ml/magika/build/aie.mlir.prj/main_core_1_3.elf.map": Linking ended with errors, check the map file for an overview of already mapped symb    ols
xchesscc Failed
The Program xchesscc has encountered an unexpected error exiting ... xchesscc Failed

However, in peano, this error does not occur. It's unclear what about the chess-clang compiler does not like the the llvm IR syntax.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions