As illustrated in Figure 2.2, the front end invokes the COP compiler and passes in the communication structure in the form of COP code. The compiler generates a set of functions for each operator that can be used on each node of the mesh to perform communications. These functions are processor code, suitable for integration into the HLL compiler's internal representation. The actual router schedule code for scheduled routers is embedded in the generated processor code, since it is the processor that downloads router code at the appropriate moments. The HLL compiler then generates object code suitable to run on the processors of the mesh (either as a single program or as multiple node programs, depending on the HLL compiler).
The current COP compiler assumes that C is the internal representation, and the returned processor code contains suitable C functions. Accordingly, the C compiler is used to perform the integration step between the COP output and the application-specific code.
Each operator's first argument, as previously mentioned, is a label.
These labels define a flat namespace that the COP compiler uses to
name the returned functions: thus, the (broadcast 'b 0) operator
would cause functions named b_write() and b_read() to
be returned by the compiler (among others). These returned functions are
integrated into the HLL compiler's internal representation at the
points where communication is performed.