Implement support for creating arrays stored in multiple external memory blocks or processors ("big arrays").
Big arrays will be created using the external storage modifier. The modifier will accept a linked array. The array may contain memory cells/banks or processors.
In case of memory cells/banks, the big array will be split into segments stored in individual cells/banks. The entire cell/bank is reserved for the big array. Array access firstly locates the correct cell/bank, and then uses the block in question for access. The subarray syntax might be enhanced to allow easier access to a segment of the array stored in a single block. Mindcode using external memory-based big arrays can be compiled standalone as usual and only depends on the memory blocks to be linked under the expected names.
In case of external processors, the compiler will choose a suitable array organization to use. The processors will have to have a code defined. The following possibilities exists:
- Code for the processors will be generated when compiling the main program. The code for the other processors:
- The code will be somehow output (into extra files in case of command-line tool, or into additional output fields in case of web app).
- Compiling Mindcode will automatically produce a schematic containing all the processors and their code. Probably activated using a compiler option.
- Just the code of the main processor will be provided, the rest will be available in some other way (e.g.,
require bigarray; initializeBigArray();).
- When compiling schematic, the code for external processors will be passed on to the schematic builder, which will place the code into the processors. The schematic builder could create only memory blocks/processors that are actually needed for the array of given size.
As the storage processors will only contain some code creating the variables, it would be possible to place additional code into them, either completely independent, or callable from the main processor.
Possible syntax (see also #324):
linked(@memory-bank) memory[] = (memory1 .. memory10); // Array of symbolic memory-bank links
linked processors[] = (processor1 .. processor6); // Array of literal processor links
external(memory) array1[5000];
external(processors) array2[8000];
Implement support for creating arrays stored in multiple external memory blocks or processors ("big arrays").
Big arrays will be created using the
externalstorage modifier. The modifier will accept a linked array. The array may contain memory cells/banks or processors.In case of memory cells/banks, the big array will be split into segments stored in individual cells/banks. The entire cell/bank is reserved for the big array. Array access firstly locates the correct cell/bank, and then uses the block in question for access. The subarray syntax might be enhanced to allow easier access to a segment of the array stored in a single block. Mindcode using external memory-based big arrays can be compiled standalone as usual and only depends on the memory blocks to be linked under the expected names.
In case of external processors, the compiler will choose a suitable array organization to use. The processors will have to have a code defined. The following possibilities exists:
require bigarray; initializeBigArray();).As the storage processors will only contain some code creating the variables, it would be possible to place additional code into them, either completely independent, or callable from the main processor.
Possible syntax (see also #324):