Skip to content

Schemacode: block replacement #339

Description

@cardillan

Two new keywords will be added to Schemacode: fill and replace. They can be specified before the at keyword:

schematic
    C: @copper-wall at (1, 1) * (4, 4)
    B: @memory-bank replace at (2, 2)
    T: @titanium-wall fill at (0, 0) * (6, 6)
end

this should create

T T T T T T
T C C C C T
T C B B C T
T C B B C T
T C C C C T
T T T T T T
  • When a block is marked with replace, any earlier defined block which overlaps it - even partially - is completely removed from the schematic. It's label(s), if any, must not be reused and must not be referenced from any configuration.
  • When a block is marked with fill, it is placed only on positions which do not overlap already defined blocks. Positions that would overlap a block are not used and labels assigned to those blocks are not created.
  • When a region being placed is marked with rectangle or fill, all blocks instantiated by the region are handled as if declared with this flag.

Expected use-cases:

  • replace allows making changes to block arrays created with blocks or regions, for example a factory constructed by repeating a region containing a basic unit may be customized on the input/output edges.
  • fill allows creating rectangular walls around compact regions, or filling empty areas in the schematic with filler blocks (such as batteries, solar panels, walls).

Furthermore, @air will be accepted as a valid block name. There are two possible uses:

  • When used with replace, @air can be used to completely remove blocks from the schematics.
  • When used with a label, the label can be used to refer to the position of the block from configuration links (processor, nodes or bridges). Before, the only valid way to specify a position without an actual block was using absolute or relative coordinates.

Currently, any valid block type is accepted in Schemacode, even when the block type doesn't correspond to a buildable block. This is a bug; non-buildable block types will be refused.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions