lava icon indicating copy to clipboard operation
lava copied to clipboard

Refactor creation of Var- and PortInitializers in subcompilers

Open PhilippPlank opened this issue 4 years ago • 0 comments

We should combine the creation of Var- and PortInitializers (for Vars, I/O Ports, RefPorts, VarPorts) in both the PyProcCompiler and CProcCompiler. There are currently many copies of the same functionality with slight differences (for instance, RefPorts vs. InPorts).

        inport_initializers = self._create_inport_initializers(process)
        outport_initializers = self._create_outport_initializers(process)
        refport_initializers = self._create_refport_initializers(process)
        varport_initializers = self._create_varport_initializers(process)

All these methods could be based on the same method with parameters.

See lava/src/lava/magma/compiler/subcompilers/py/pyproc_compiler.py

Reference: Originally posted by @awintel in https://github.com/lava-nc/lava/pull/46#discussion_r748910604

PhilippPlank avatar Nov 15 '21 23:11 PhilippPlank