Abstract:
The invention provides a compiler for generating assembly or configuration instructions from source code for an integrated circuit architecture of a plurality of different IC architectures. The source code is represented as a plurality of nodes of an abstract syntax tree. For each target architecture, a plurality of concrete instruction tiles are generated as concrete classes corresponding to and inheriting from a plurality of function tiles. Each function tile is implemented as an abstract class, represents a corresponding function, such as an ADD or MULT function, and implements a matching operation for the corresponding function. The compiler includes an instruction selector, formed as an abstract class, which implements a matching function and instruction generation for the abstract syntax tree by calling the corresponding matching operations of the concrete instruction tiles, inherited from the plurality of function tiles. When a concrete instruction tile or corresponding function has been matched to a node of the abstract syntax tree, the instruction selector calls an instruction generation function of the corresponding concrete instruction tile to generate an instruction for the corresponding IC architecture. By varying the concrete instruction tiles, the compiler may be targeted to any IC architecture.