# sch-rnd - attribute export naming

## Attribute export names

Each attribute in the abstract model has an optional "export name" field. If the export file format supports arbitrary key/value pairs exported (e.g. with nets, components or even ports), those attributes that have an export name set are exported, using the export name instead of the original attribute name. This allows plugins to control which attributes to export for a given workflow, under what output attribute name.

Usually the target plugin sets export name on some of the attributes, typically using the standard attribute export naming mechanism.

## Standard attribute export naming mechanism

The target plugin has the following configuration nodes:

end of node path | description
--- | ---
flow_prefix | workflow prefix (domain prefix)
sw_prefix | consumer software prefix
whitelist | list of attribute names to export with an option to use a different name in export
blacklist | list of attribute names that shall not be exported

The mechanism is specified in CoralEDA crl001, with the followint sch-rnd specific implementation details:

- flow_prefix is the same as "domain scope prefix" in crl001; it's typically the same as the target plugin's basename, e.g. "pcb" for plugin target_pcb, so symbol attribute "pcb:foo" is exported as component attribute "foo" when using target_pcb
- whitelist items are either plain attibute names, or "attr_name->export_name" pairs for a rename; e.g. "display/dnp->dnp" means the display/dnp attribute is exported under the name dnp
- blacklist is a list of attribute names; a blacklisted attribute's export name is removed even if it was also whitelisted or matched any of the prefixes or another plugin has set it earlier during the compilation process

The order of precedence (later items override earlier items on the list):

1. whitelist
2. sw_prefix
3. flow_prefix
4. blacklist