Compilation flow for heterogeneous multicore architectures
The compilation flow for heterogeneous multi-core architectures addresses the lack of support for reconfigurable logic in existing compilers by optimizing kernel mapping and communication routing, enhancing performance and resource utilization in SoCs and ASICs.
Patent Information
- Application Number
- JP2021569551
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2019-05-23
- Filing Date
- 2020-05-07
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2040-05-07
AI Technical Summary
Existing compilers do not directly support heterogeneous multi-core architectures, particularly those with reconfigurable/programmable logic like field programmable gate arrays (FPGAs), failing to effectively map computational kernels, data structures, and perform data routing in systems-on-chips (SoCs) and application-specific integrated circuits (ASICs).
A compilation flow for heterogeneous multi-core architectures that involves determining a graph representation of applications, mapping kernels to data processing engines (DPEs) in a DPE array, routing communication channels, and generating implementation data for programming SoCs, using a DPE array compiler to optimize performance and resource utilization.
Enables efficient compilation and execution of applications on heterogeneous multi-core architectures by optimizing kernel mapping, data structure placement, and communication routing, thereby improving performance and resource efficiency.
Smart Images

Figure 0007595587000005 
Figure 0007595587000006 
Figure 0007595587000007
Abstract
Description
[Technical field]
[0001] Technical Field Examples of the present disclosure relate generally to electronic circuit design, and more particularly to compilation flows for heterogeneous multi-core architectures. [Background technology]
[0002] background Processors, systems-on-chips (SoCs), and application-specific integrated circuits (ASICs) may contain multiple cores for performing computational tasks such as processing digital signals, performing encryption, running software applications, rendering graphics, etc. Although there are many multi-core architectures, none of the compilers for these architectures directly address heterogeneous architectures, especially multi-core processors coupled with reconfigurable / programmable logic (such as field programmable gate array (FPGA) fabric). Furthermore, existing compilers do not address the mapping of computational kernels to processor cores, the mapping of data structures to memory banks, and the routing of stream data and direct memory access (DMA) data between processor cores and between processor cores and programmable logic. Summary of the Invention [Means for solving the problem]
[0003] overview Techniques relating to compilation flows for heterogeneous multicore architectures are described. In one example, a method for implementing an application for a system-on-chip (SOC) having a data processing engine (DPE) array includes determining a graph representation of the application, the graph representation including nodes representing kernels of the application and edges representing communication between the kernels, mapping the kernels to DPEs of the DPE array and mapping data structures of the kernels to memory in the DPE array based on the graph, routing communication channels between the DPEs and circuitry of the application configured in programmable logic of the SOC, and generating implementation data for programming the SOC to implement the application based on results of the mapping and routing.
[0004] In another example, a non-transitory computer-readable medium having stored thereon instructions that, when executed by a processor, cause the processor to perform a method for implementing an application for a system-on-chip (SOC) having a data processing engine (DPE) array, the method including: determining a graph representation of the application, the graph representation including nodes representing kernels of the application and edges representing communication between the kernels; mapping the kernels to DPEs of the DPE array based on the graph and mapping data structures of the kernels to memory within the DPE array; routing communication channels between the DPEs and circuitry of the application configured in programmable logic of the SOC; and generating implementation data for programming the SOC to implement the application based on results of the mapping and routing.
[0005] In another example, a computer system includes a memory configured to store program code; and a processor configured to execute the program code for implementing an application on a system-on-chip (SOC) having a data processing engine (DPE) array by determining a graph representation of the application, the graph representation including nodes representing kernels of the application and edges representing communication between the kernels; mapping the kernels to DPEs of a DPE array and mapping data structures of the kernels to memory in the DPE array based on the graph; routing communication channels between the DPEs and circuitry of the application configured in programmable logic of the SOC; and generating implementation data for programming the SOC to implement the application based on results of the mapping and routing.
[0006] These and other aspects can be understood with reference to the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS So that the above-recited features can be understood in detail, a more detailed description briefly summarized above can be had by reference to exemplary embodiments, some of which are illustrated in the accompanying drawings, which it should be noted, however, that the accompanying drawings depict only typical example embodiments and therefore should not be considered as limiting the scope thereof. [Brief description of the drawings]
[0007] [Figure 1] FIG. 1 is a block diagram of a system on chip (SoC) according to an example. [Diagram 2] FIG. 2 is a block diagram illustrating a tile circuit according to an example. [Diagram 3] 3 is a block diagram illustrating the tile circuitry of FIG. 2 in greater detail according to an example. [Figure 4] FIG. 2 is a block diagram illustrating an interconnect circuit according to an example. [Diagram 5]FIG. 1 is a block diagram illustrating an example of a circuit design system according to an example. [Figure 6] FIG. 2 is a block diagram illustrating an implementation of an application on a target platform according to an example. [Figure 7] FIG. 1 is a block diagram illustrating an application according to an example. [Figure 8] FIG. 1 is a block diagram illustrating a data processing engine (DPE) array compiler according to an example. [Figure 9A] 2 is a block diagram illustrating an exemplary directed graph representation of a portion of an application targeted to a DPE array, according to one example. [Figure 9B] 2 is a block diagram illustrating an exemplary directed graph representation of a portion of an application targeted to a DPE array, according to one example. [Figure 9C] 2 is a block diagram illustrating an exemplary directed graph representation of a portion of an application targeted to a DPE array, according to one example. [Figure 9D] 2 is a block diagram illustrating an exemplary directed graph representation of a portion of an application targeted to a DPE array, according to one example. [Figure 10] 2 is a block diagram illustrating the placement and routing of a directed graph within a DPE array, according to an example. [Figure 11] 1 is a flow diagram illustrating a method for generating code and configuration data for a data processing engine array of a SOC, according to an example. [Figure 12] 4 is a flow diagram illustrating a method for partitioning kernels in an application among data processing engines, according to an example. [Figure 13] 4 is a flow diagram illustrating a method for assigning kernels to partitions, according to an example. [Figure 14] 4 is a flow diagram illustrating a method for mapping kernels and kernel clusters to DPEs, according to an example. [Figure 15] 1 is a flow diagram illustrating a method for FIFO insertion when implementing an application for a heterogeneous multi-core architecture. [Figure 16]FIG. 1 is a block diagram illustrating a processing system according to an example. [Figure 17A] 17 is a block diagram illustrating an implementation of the processing system of FIG. 16 according to an example. [Figure 17B] 17 is a block diagram illustrating an implementation of the processing system of FIG. 16 according to another example. [Figure 18] 4 is a flow diagram illustrating a method for populating a FIFO, according to an example. [Figure 19] 1 is a flow diagram illustrating a method for routing applications mapped to a DPE array, according to an example. [Figure 20] 2 is a block diagram illustrating an example of a programmable IC that can be used as one implementation of the SoC shown in FIG. 1. [Figure 21] FIG. 21 illustrates a field programmable gate array (FPGA) implementation of the programmable IC of FIG. 20, according to an example. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0008] For ease of understanding, wherever possible, identical reference numbers have been used to designate identical elements common to the figures. It is contemplated that elements of one example may be beneficially incorporated in other examples.
[0009] Detailed Description Various features will now be described with reference to the figures. It should be noted that the figures may or may not be drawn to scale, and that elements of similar structure or function are represented by similar reference numerals throughout the figures. It should be noted that these figures are intended only to facilitate functional description. These figures are not intended as an exhaustive description of the claimed invention, or as a limitation of the scope of the claimed invention. Furthermore, an illustrated example need not have all aspects or advantages shown. An aspect or advantage described in connection with a particular example is not necessarily limited to that example, and may be implemented in any other example, even if not so illustrated or explicitly described.
[0010] The techniques described herein provide a process for taking a graph-based program description of an application for a multi-core architecture of a system-on-chip (SOC) and compiling the application into the multi-core architecture to generate execution binaries for each core and configuration code for programmable components. The compilation step includes converting the input graph description into an internal representation, performing code analysis and optimization, identifying computation kernels to be grouped (e.g., clustering), mapping these groups to specific data processing engines (e.g., cores), and mapping data structures used by the kernels to local memory. The compilation step further includes routing stream and direct memory access (DMA) data between the data processing engines and to and from the programmable logic via a stream switch. The compilation step further includes generating wrapper code to coordinate the execution of each data processing engine, generating configuration code for the DMA and stream switch, and generating a program for execution by a processing system to control the application. These and further aspects are described below with reference to the drawings.
[0011] FIG. 1 is a block diagram of a device 100 including a data processing engine (DPE) array 105 according to an example. In the example, the device 100 is a system-on-chip (SoC) type device. In general, a SoC refers to an IC that includes two or more subsystems that can interact with each other. As an example, a SoC may include a processor that executes program code and one or more other circuits. The other circuits may be implemented as hardwired circuits, programmable circuits, other subsystems, and / or any combination thereof. The circuits may operate in cooperation with each other and / or with the processor. The DPE array 105 includes multiple data processing engines (DPEs) 110 that may be arranged in a grid, cluster, or checkerboard pattern within the device 100. Although FIG. 1 illustrates arranging the DPEs 110 in a 2D array with rows and columns, the example is not limited to this arrangement. Additionally, the array 105 may be of any size and may have any number of rows and columns formed by the DPEs 110.
[0012] In one embodiment, the DPEs 110 are identical. That is, each DPE 110 (also referred to as a tile or block) may have the same hardware components or circuitry. Furthermore, the examples herein are not limited to the DPEs 110. Instead, the device 100 may include an array of any type of processing elements or data processing engines. Furthermore, the DPEs 110 may be cryptographic engines or other specialized hardware for performing one or more specialized tasks. Thus, the DPEs 110 may be generally referred to as data processing engines.
[0013] 1, the array 105 includes DPEs 110 that are all of the same type (e.g., a homogenous array). However, in alternative embodiments, the array 105 may include engines of different types. For example, the array 105 may include DPEs 110, encryption engines, forward error correction (FEC) engines, etc. Whether the array 105 is homogenous or heterogeneous, the DPEs 110 may include connections to memory modules in adjacent DPEs 110 that allow the DPEs 110 to share memory modules, as described in more detail below.
[0014] In one embodiment, the DPE 110 is formed from non-programmable logic, i.e., hardened. One advantage of doing so is that the DPE 110 may take up less space in the device 100 compared to using programmable logic to form the hardware elements in the DPE 110. That is, by using hardened or non-programmable logic to form the hardware elements in the DPE 110, such as the program memory, instruction fetch / decode unit, fixed point vector unit, floating point vector unit, arithmetic logic unit (ALU), multiply-adder (MAC), etc., the footprint of the array 105 in the device 100 may be significantly reduced. Although the DPE 110 may be hardened, this does not mean that the DPE 110 is not programmable. That is, the DPE 110 may be configured to perform different functions or tasks when the device 100 is powered on or rebooted.
[0015] The DPE array 105 also includes a SOC interface block 115 that serves as a communication interface between the DPE 110 and other hardware components within the device 100. In this example, the device 100 includes a network-on-chip (NoC) 120 communicatively coupled to the SoC interface block 115. Although not shown, the NoC 120 may extend throughout the device 100 to allow various components within the device 100 to communicate with each other. For example, in a physical implementation, the DPE array 105 may be located in the upper right portion of an integrated circuit forming the device 100. However, using the NoC 120, the array 105 may nevertheless communicate with various subsystems, such as, for example, the programmable logic (PL) 120, the processor subsystem (PS) 130, or the input / output (I / O) 135, which may be located in different locations throughout the device 100.
[0016] In addition to providing an interface between the DPE 110 and the NoC 120, the SoC interface block 115 may also provide a direct connection to a communications fabric within the PL 122. In one embodiment, the SoC interface block 115 includes separate hardware components for communicatively coupling the DPE 110 to the NoC 120 and the PL 122 located near the array 105 within the device 100.
[0017] 1 shows one block of PL 122, device 100 may include multiple blocks of PL 122 (also referred to as constituent logic blocks) that may be located at different locations within device 100. For example, device 100 may include hardware elements forming a field programmable gate array (FPGA). However, in other embodiments, device 100 may not include any PL 122 at all, for example device 100 is an ASIC.
[0018] FIG. 2 is a block diagram illustrating a DPE 110 according to an example. The DPE 110 can be used to implement a DPE in a DPE array, as described above and shown in FIG. 1. The DPE 110 includes a core 202, a memory 204, a DPE interconnect 209, and support circuits 214. The DPE interconnect 209 includes a streaming interconnect 210 and a memory-mapped (MM) interconnect 212. In one example, the support circuits 214 include a debug / trace / profile circuit 216, a hardware (HW) synchronization circuit ("HW lock 218"), and a direct memory access (DMA) circuit ("DMA 220"). The memory 204 includes a program memory ("PM 206") and a data memory ("DM 208").
[0019] Core 202 includes one or more computational units for processing data according to instruction(s) stored in PM 206. In one example, core 202 includes a very long instruction word (VLIW) processor, a single instruction multiple data (SIMD) or vector processor, or a VLIW SIMD / vector processor. In one example, PM 206 is private to core 202 (e.g., PM 206 stores instruction(s) only for use by core 202 in DPE 200). In one example, PM 206 includes single-port random access memory (RAM). PM 206 can be coupled to MM interconnect 212 for configuring and loading instructions. In one example, PM 206 supports parity, error correcting code (ECC) protection and reporting, or both parity and ECC. For example, PM 206 can support 9-bit ECC and can correct 1-bit or 2-bit errors in program instructions (e.g., 128-bit).
[0020] Core 202 may be directly coupled to streaming interconnect 210 to receive input stream(s) and / or provide output stream(s). Additionally, core 202 may read and write data to DM 208 in DPE 200. As described further below, core 202 of DPE 200 may also access DMs of one or more adjacent tile circuits (e.g., north, south, east, and west adjacent tile circuits). In one example, as described further below, core 202 may also include direct connections (e.g., input and output cascade connection(s)) with data processing engines in one or more adjacent tiles for forwarding accumulator outputs. In one example, core 202 views DM 208 in DPE 200 and other DM(s) in adjacent tile(s) as one contiguous block of memory. Core 202 may also include an interface to HW lock 218 and an interface to debug / trace / profile circuit 216. The debug / trace / profile circuitry 216 may include trace, debug, and / or profile circuitry.
[0021] The MM interconnect 212 may be an AXI memory-mapped interconnect or the like configured to transmit data using address transactions between components. In one example, the MM interconnect 212 is used for configuration, control, and debug functions of the DPE 200. The MM interconnect 212 includes one or more switches that route transactions based on addresses. Circuits can use the MM interconnect 212 to access memory 204, core 202, DMA 220, and configuration registers in the DPE 200.
[0022] The streaming interconnect 210 may be an Advanced eXtensible interconnect (AXI) streaming interconnect or the like configured to transmit streaming data between components. The streaming interconnect 210 is used to transfer data between the DPE 200 and external circuitry. The streaming interconnect 210 may support both circuit-switched and packet-switched mechanisms for both data and control.
[0023] In one example, as described further below, the DM 208 may include one or more memory banks (e.g., random access memory (RAM) banks). The DMA 220 is coupled between the streaming interconnect 210 and the DM 208. The DMA 220 is configured to move data from the streaming interconnect 210 to the DM 208 and to move data from the DM 208 to the streaming interconnect 210. In this manner, an external circuit (e.g., a circuit configured in a programmable logic or a circuit in an embedded processing system of an IC) may read and write data to the DM 208 via the streaming interconnect 210 using the DMA. The DMA 220 may be controlled via the MM interconnect 212 and / or the streaming interconnect 210. In one example, the DM 208 supports parity, error correcting code (ECC) protection and reporting, or both parity and ECC. For example, the DM 208 may support 9-bit ECC (e.g., 128-bit data).
[0024] The HW lock 218 may be used to lock a particular memory bank of the DM 208 for access by the core 202, another data processing engine in another tile, or the DMA 220. The HW lock 218 provides synchronization between adjacent data processing engines in adjacent tiles, between the core 202 and the DMA 220, and between the core 202 and an external circuit (e.g., an external processor). The HW lock 218 may also be used to lock a particular buffer in the DM 208, which may be stored in one or more memory banks or in a portion of a single memory bank. The debug / trace / profile circuit 216 is configured to provide debug, trace, and profile functions. The debug / trace / profile circuit 216 may trace events generated by circuits in the DPE 200. The debug / trace / profile circuit 216 may provide profile functions, e.g., configurable execution counters.
[0025] FIG. 3 is a block diagram illustrating a DPE 200 in more detail according to an example. In this example, the DPE 200 includes a core 202, a memory module 351, and a DPE interconnect 209. The core 202 includes a computation circuit 203 and a PM 206. The memory module 351 includes memory interfaces 302N, 302S, 302E, and 302W (collectively memory interfaces or individually "memory IF"), a RAM bank 318, a HW lock 218, a register ("register 304"), a DMA interface 204A, and a DMA interface 220B. The computation circuit 203 includes a register ("register 306"). The DPE interconnect 209 includes a MM interconnect 212 and a streaming interconnect 210 (shown in FIG. 2). Both the MM interconnect 212 and the streaming interconnect 210 can access a RAM bank 318. The RAM bank 318 includes arbitration logic 319 for each bank. Arbitration logic 319 is configured to control which interface (N, S, E, W, DMA, external PS, etc.) has access to which bank. Further details of DPE interconnect 209 are discussed below with respect to the example of FIG.
[0026] The DPE interconnect 209 includes a streaming connection 314W to the west tile, a streaming connection 314E to the east tile, a streaming connection 314N to the north tile, and a streaming connection 314S to the south tile. Each streaming connection 314 includes one or more independent streaming interfaces (e.g., buses), each of which has a particular bit width. The DPE interconnect 209 also includes a memory-mapped connection 312S from the south tile and a memory-mapped connection 312N to the north tile. Although only north and south MM connections are illustrated, it should be understood that the DPE interconnect 209 may include other configurations for the MM interconnects (e.g., east to west, west to east, north to south, etc.). It should be understood that the DPE interconnect 209 may include other arrangements of streaming and memory-mapped connections other than those shown in the example of FIG. 3. Generally, the DPE interconnect 209 includes at least one streaming connection 314 and at least one memory mapped connection 312 .
[0027] The computation circuit 203 includes a connection 308W to a memory circuit in the west tile, a connection 308S to a memory circuit in the south tile, a connection 308N to a memory circuit in the north tile, and a connection 308E to a memory module 351. The computation circuit 203 includes a streaming interface to the DPE interconnect 209. The computation circuit 203 also includes a connection 310A from a core in the west tile and a connection 310B (e.g., a cascade connection) to a core in the east tile. It should be understood that a DPE may include other arrangements of memory and cascade connections than those shown in the example of FIG. 3. In general, the computation circuit 203 includes at least one memory connection and may include at least one cascade connection.
[0028] Memory IF 302W is coupled to memory connection 308E of computation circuit 203. Memory IF 302N is coupled to memory connection of the data processing engine in the north tile. Memory IF 302E is coupled to memory connection of the data processing engine in the east tile. Memory IF 302S is coupled to memory connection of the data processing engine in the south tile. Memory IFs 302W, 302N, 302E, and 302S are coupled to RAM bank 318. DMA 220A includes an output coupled to DPE interconnect 209 to process the memory to interconnect stream. DMA 220B includes an input coupled to DPE interconnect 209 to process the interconnect to memory stream. Register 304 and register 306 are coupled to DPE interconnect 209 to receive configuration data therefrom (e.g., using a memory mapped interconnect).
[0029] FIG. 4 is a block diagram illustrating a DPE interconnect 209 according to an example. The DPE interconnect 209 includes a stream switch 402 and an MM switch 404. The stream switch 402 is coupled to a west stream interface 406W, a north stream interface 406N, an east stream interface 406E, and a south stream interface 406S. The west stream interface 406W receives and feeds streams to the DPE interconnects of the west tile. The north stream interface 406N receives and feeds streams to the DPE interconnects of the north tile. The west stream interface 406W receives and feeds streams to the DPE interconnects of the west tile. The south stream interface 406S receives and feeds streams to the DPE interconnects of the south tile. The MM switch 404 is coupled to a north MM interface 408N and a south MM interface 408S. The north MM interface 408N is coupled to the DPE interconnects in the north tile. The South MM interface 408S is coupled to the DPE interconnect in the South tile.
[0030] The stream switch 402 includes a first-in, first-out (FIFO) circuit (FIFO 412) and a register (register 410). The FIFO 412 is configured to buffer streams passing through the stream switch 402. The register 410 stores configuration data for the stream switch 402, which controls the routing of streams through the stream switch. The register 410 may receive the configuration data from the MM switch 404. The stream switch 402 may include an additional interface to the compute circuit 203 and an additional interface to the DMA circuit 220. The stream switch 402 can send and receive control streams and receive trace streams (e.g., from the debug / trace / profile circuit 216).
[0031] FIG. 5 is a block diagram illustrating an example of a circuit design system 500 according to an example. The circuit design system 500 includes a computer 501 coupled to an input / output (IO) device 512, a display 514, and an SOC 100. The computer 501 includes a hardware platform 518 that can include conventional components of a computing device, such as a central processing unit (CPU) 502, a system memory 508, various support circuits 504, storage 520, and an IO interface 506. The CPU 502 can include one or more microprocessors. The CPU 502 is configured to execute instructions to perform one or more operations described herein. The instructions can be stored in the system memory 508, the storage 520, or any other memory (e.g., cache memory) in the hardware platform 518. The system memory 508 includes devices that store information and can include, for example, a random access memory (RAM), a read-only memory (ROM), or a combination thereof. The storage 520 includes a local storage device, such as a hard disk, a flash memory module, a solid-state disk, an optical disk, and the like. Storage 520 may also include an interface configured to communicate with one or more network data storage systems. Support circuits 504 may include conventional cache, power supplies, clock circuits, data registers, IO interfaces, etc. IO interface 506 includes conventional interfaces to computer 501 known in the art. IO interface 506 may be coupled to IO devices 512, which may include a conventional keyboard, mouse, etc. IO interface 506 may also be coupled to display 514, which may present a GUI 516 to a user.
[0032] Computer 501 further includes a software platform including an operating system (OS) 522 and a design tool 510. OS 522 and design tool 510 include instructions executed by CPU 502. OS 522 may include known operating systems such as Linux, Microsoft Windows, Mac OS, etc. Design tool 510 is an application that runs within OS 522 that provides an interface to hardware platform 518. The operation of design tool 510 is described below. An exemplary design tool that can be adapted to include the techniques described herein is the Vivado® design suite available from Xilinx, Inc. of San Jose, Calif., although other circuit design tools can be similarly adapted.
[0033] Compiler flow for heterogeneous multicore architectures 6 is a block diagram illustrating an implementation of an application on a target platform according to an example. The design tools 510 include a software compiler ("SW compiler 602"), a DPE array compiler 604, and a hardware design tool ("HW design tool 606"). The design tools 510 receive an application 608, user constraints 610, and a hardware-based platform ("HW-based platform 612"). The user defines the application 608 to be implemented for the SoC 100. The application 608 includes portions that map to the PL 122, the PS 130, and the DPE array 105. The SW compiler 602 is configured to compile the portions of the application 608 that map to the PS 130, which may include source code defined using any programming language (e.g., C, C++, etc.). The HW design tools 606 are configured to implement the portions of the application 608 that are mapped to the PL 122, which may include circuit descriptions defined using any hardware description language (HDL), register transfer language (RTL), high level synthesis (HLS) models, parallel programming languages (e.g., SystemC), etc. The DPE array compiler 604 is configured to compile the portions of the application 608 that are targeted to the DPE array 105, as further defined below.
[0034] 7 is a block diagram illustrating an application 608 according to an example. A user interacts with design tool 510 to define an application 608 targeted to SOC 100. In this example, application 608 includes input circuit 702, kernel 704, kernel 706, output circuit 708, and control software 710. Input circuit 702 is coupled to kernel 704 and provides data to kernel 704. Kernel 704 is coupled to kernel 706 and provides data to kernel 706. Kernel 706 is coupled to output circuit 708 and provides data to output circuit 708. Control software 710 controls kernel 704 and kernel 706 and provides data to them. In general, application 608 includes one or more circuits, one or more kernels, and control software connected together in a particular manner according to the design.
[0035] In this example, the input circuit 702 includes digital logic (and optionally analog logic) configured to communicate with an external system / circuit and provide data to the kernel 704 for processing. The input circuit 702 is mapped to the PL 122. Similarly, the output circuit 708 includes digital logic (and optionally analog logic) configured to communicate with an external system / circuit and receive data from the kernel 706 that has been processed. The output circuit 708 is mapped to the PL 122. In one example, the kernels 704 and 706 include program descriptions of a data processor. The kernels 704 and 706 are mapped to the DPE array 105. The control software 710 is a program description of a controller for the kernels 704 and 706. In one example, the control software 710 is mapped to the PS 130.
[0036] Returning to FIG. 6, the implementation data 614 includes stream switch configuration code 616, DMA engine configuration code 618, PS binaries 624, DPE binaries 620, and PL bitstream 622. The SW compiler 602 generates the PS binaries 624 from the source code of the application 608 that targets the PS 130 (e.g., control software 710). The PS binaries 624 are configured to target a particular microprocessor architecture (e.g., x86, ARM, etc.). The HW design tool 606 generates the PL bitstream 622 from the portion of the application 608 that targets the PL 122 (e.g., input circuit 702 and output circuit 708). The PL bitstream 622 targets a particular SOC device. The DPE array compiler 604 generates the stream switch configuration code 616, DMA engine configuration code 618, and DPE binaries 620 based on the portion of the application 608 that targets the DPE array 105 (e.g., kernels 704 and 706). The stream switch configuration code 616 contains data for programming the stream switch 402 in the DPE interconnect 209. The DMA engine configuration code 618 contains data for programming the DMA circuitry 220 in the memory module 351 of the DPE 110. The DPE binaries 620 contain code for execution by the computation circuitry 203 in the cores 202 of the DPE 110.
[0037] The implementation output 614 is configured for implementation on a target platform 626. The target platform 626 includes a simulation platform ("Simulation 628"), an emulation platform ("Emulation 630"), and a hardware platform ("Hardware 632"). The hardware 632 includes the SOC 100. The simulation platform 628 and the emulation platform 630 simulate / emulate the hardware 632.
[0038] FIG. 8 is a block diagram illustrating a DPE array compiler 604 according to an example. The DPE array compiler 604 includes a front end 806, a mapper 808, a back end 810, and a single core compiler 812. Although the DPE array compiler 604 is described as having separate components, it should be understood that the functionality of these components can be implemented using more or fewer components in a structure different from the example shown in FIG. 8. The portion of the application 608 targeted to the DPE array 105 includes a user-defined graph description 802 and kernel source code 804. The user-defined graph description 802 describes the components and their connectivity (e.g., input circuitry 702, kernels 704 and 706, output circuitry 708, and control software 710). The kernel source code 804 provides a programmatic description of the functionality implemented in the DPE 110 of the DPE array 105.
[0039] The user-defined graph description 802 may be specified using a variety of programming languages (e.g., C, C++, etc.) or data structure languages (e.g., XML, JSON, etc.) An example of a user-defined graph description 802 specified in C++ is shown below:
[0040] [Table 1]
[0041] In the above example, the wireless class is derived from a class library (cardano) with graph construction primitives. Using these primitives, the user-defined graph description 802 defines computational nodes a, b, c, d, e, and f. Computational nodes a and f are circuits mapped onto the PL 122. Computational nodes b, c, d, and e are kernels mapped onto the DPE array 105. Circuit a is connected to kernel b using a DMA streaming connection. Kernel b is connected to kernel c, which is connected to kernel d, which is connected to kernel e, which is connected to kernel b, with each such connection being made through a memory block in the DPE 105. Kernel d is connected to circuit F via a DMA streaming connection.
[0042] The user-defined graph description 802 may also include a top-level description of the platform. For example, the description is as follows:
[0043] [Table 2]
[0044] In the above example, the user instantiates the wireless class (mygraph) and sets the simulation target. The user can also specify the control program to be executed on the PS 130 as follows:
[0045] [Table 3]
[0046] In the above example, the user initializes mygraph, runs mygraph, and terminates mygraph for simulation on the simulation platform.
[0047] Kernel source code 804 provides a source code description of each compute node targeted to DPE 110 (e.g., compute nodes b, c, d, and e in the example above). Kernel source code 804 may be defined using any programming language (e.g., C, C++, etc.). An example of C++ source code for defining compute node c (the equalizer) is shown below:
[0048] [Table 4]
[0049] In this example, the compute node c (the equalizer) is implemented using a C / C++ function with input parameters that define the compute node's inputs. The code includes pragmas to aid in scheduling the execution. The code includes built-in functions to perform vectorized computations and an application programming interface (API) to access the data.
[0050] The front end 806 is configured to process the user-defined graph description 802 and generate a directed graph as an internal representation. In the directed graph, the nodes represent the computational nodes and the edges represent the connections between the computational nodes. The mapper 808 is configured to implement the directed graph of the DPE array 105 in the target device based on the device description 814. The mapper 808 partitions the computational nodes into groups and maps the partitioned computational nodes to the DPE 110. The back end 810 is configured to route connections between the DPE 110 and the circuitry in the PL 122, then invoke the single-core compiler 812 to generate the DPE binaries, and also generate stream switch and DMA configuration code based on the output of the mapper 808.
[0051] 9A-9D are block diagrams illustrating an exemplary directed graph representation of a portion of an application 608 targeted to the DPE array 105, according to one example. FIG. 10 is a block diagram illustrating directed graph placement and routing within the DPE array 105. The directed graphs of FIGS. 9A-9D represent the example described above of a user-defined graph description 802 having computational nodes a, b, c, d, e, and f, where computational nodes a and f are mapped to the PL 122 and computational nodes b, c, d, and e are mapped to the DPE array 105. As shown in FIG. 9A, the directed graph includes nodes A 902, B 904, C 906, D 908, E 910, and F 912. Node A is connected to node B, which is connected to node C, which is connected to node D, which is connected to nodes F and E. 9B-9D show how mapper 808 processes a directed graph through various steps, as further described below.
[0052] 11 is a flow diagram illustrating a method 1100 of generating code and configuration for a DPE array 105 of a SOC 100, according to one example. The method 1100 is performed by a design tool 510 executing on a computer system 501. As described above, the design tool 510 is configured to process an application 608 to generate code and configuration data for the SOC 100. The method 1100 is performed by a DPE array compiler 604.
[0053] Method 1100 begins at step 1102, where the DPE array compiler 604 analyzes the application 608 and generates a directed graph based on a user-defined graph description of the design. In one example, the DPE array compiler 604 identifies the computational nodes 902-912 and the connections between them. The DPE array compiler 604 then forms a graph in which the nodes are kernels and the edges are connections, as shown in FIG.
[0054] In step 1104, the DPE array compiler 604 processes the directed graph to cluster the kernels into groups that can be executed on the cores of the data processing engine. In this example, the kernels are selected from computation nodes B 904, C 906, D 908, and E 910. That is, each DPE 110 can execute one or more kernels, and the DPE array compiler 604 determines which kernels can be combined to execute as a group. As shown in FIG. 9B, the DPE array compiler 604 can combine nodes B 904 and C 906 into group 905, and nodes D 908 and E 910 into group 907.
[0055] In step 1106, the DPE array compiler 604 processes the code defining each kernel for optimization to improve performance and reduce the memory footprint of the kernel cluster. In step 1108, the DPE array compiler 604 maps the kernels (or kernel clusters, if present) to DPEs 110 in the DPE array 105. As shown in Figure 10, the kernels represented by nodes B 904 and C 906 are mapped to core 202-1 of one DPE, and the kernels represented by nodes D 908 and E 910 are mapped to core 202-3 of another DPE.
[0056] In step 1110, the DPE array compiler 604 maps data structures defined in the kernel code to local memory banks in the corresponding DPE 110, or to DMA for non-local communication. As described above, DPEs that are close to each other can share memory banks. Communication via the shared memory can be single buffered or double buffered, as described further herein. However, in some cases, a DPE may be far enough away from another DPE that a kernel running on the DPE may require DMA communication. As shown in FIG. 9C, communication between nodes A 902 and B 904 is via double buffer 914. Communication between nodes B 904 and C 906 is via single buffer 916. Communication between nodes C 906 and D 908 is via double buffer 918. Communication between nodes D 908 and E 910 is via single buffer 920. Communication between nodes E 910 and B 904 is via double buffer 922. 10, buffer 914 is mapped to RAM bank 318 in memory module 351-1. Buffer 918 is mapped to RAM bank 318 in memory module 351-2. Buffer 924 is mapped to RAM bank 318 of memory module 351-4. Memory buffers 916, 920, and 922 are mapped to RAM bank 318 of memory module 351-3.
[0057] In step 1112, the DPE array compiler 604 can allocate communication channels between the DPE array 105 and the PL 122, such as communication channels to input / output circuits configured in the PL 122 (e.g., compute nodes a and f). For example, as shown in Figure 10, node A 902 is configured for DMA communication with DMA 220 in memory module 351-1. Node F 912 is configured for DMA communication with DMA 220 in memory module 351-4.
[0058] In step 1114, the DPE array compiler 604 allocates locks for core-to-core and core-to-DMA (if necessary) synchronization between the kernels. As shown in Figure 9D, the DPE array compiler 604 allocates lock 924 between nodes A 902 and B 904, allocates lock 928 between nodes C 906 and D 908, allocates lock 926 between nodes E 910 and B 904, and allocates lock 930 between nodes D 908 and F 912. Locks 924, 926, 928, and 930 provide double buffer synchronization between the nodes.
[0059] In step 1116, the DPE array compiler 604 routes stream data communications between the cores and to / from the PL 122 via a stream switch (e.g., circuit and / or packet switching). In step 1118, the DPE array compiler 604 generates wrapper code for each DPE 110 and compiles the wrapper code to generate DPE binaries. In step 1120, the DPE array compiler 604 generates control code for configuring the DMA stream switch. In step 1122, the DPE array compiler 604 generates application programming interfaces (APIs) for control software running on the processing system to access and control the kernels running in the data processing engine array.
[0060] Heuristic Partitioner In the above method 1100, the DPE array compiler 604 clusters kernels into groups that can be executed on the DPE 110 (step 1104). Computationally, the partitioning problem is non-polynomial (NP) hard. This is due to the reduction of the classical problem of bin packing with contention to the partitioning problem. In the examples herein, for tractability, a greedy heuristic is used in the partitioning algorithm. In a graph-based programming model, each kernel has an associated execution time ratio, which indicates an upper bound on the execution time compared to the cycle budget. The sum of the execution time ratios of kernels clustered together should not exceed 1. In addition, the user can also specify colocation constraints between kernels, or absolute location constraints for kernels. This affects the allocation of kernels to partitions and the mapping of kernels / partitions to data processing engines. Compared to previous efforts, the partitioning scheme described herein is unique in that it handles a variety of constraints, including absolute, relative, and derived constraints. These techniques can also dynamically infer some constraints during the creation of partitions, resulting in finding a feasible partition-to-core mapping. Furthermore, these techniques allow the user to choose from a variety of partitioning heuristics, each with a multi-criteria objective function.
[0061] FIG. 12 is a flow diagram illustrating a method 1200 of partitioning kernels in an application among DPEs, according to an example. Method 1200 may be performed as part of step 1104 above. Method 1200 begins at step 1202, where DPE array compiler 604 receives a directed graph (e.g., formed at step 1102 above). In the directed graph, the nodes are kernels and the edges represent data flows between the kernels. A user may define absolute constraints, such as a particular kernel must be placed on a particular data processing engine. A user may also define relative constraints, such as a particular set of kernels must be placed on the same data processing engine. At step 1204, DPE array compiler 604 groups some kernels into "macro nodes" based on user-defined constraints ("user constraints"). At this point, the graph includes nodes and macro nodes, where a node includes a single kernel and a macro node includes two or more kernels. In the remainder of this description, no distinction is made between nodes and macro nodes, and node and kernel are used interchangeably.
[0062] In step 1206, the DPE array compiler 604 sorts the nodes in the graph based on their execution time ratio and importance. This is done in two steps. First, the DPE array compiler 604 sorts the nodes based on their static level to create a list L1. The static level of a node n is calculated as the maximum cumulative execution time ratio from n to any sink in the graph. Next, the DPE array compiler 604 scans L1 to find an unexplored node m. With m as the root, it performs a reverse post-order (RPO) traversal, prioritizing depth-first exploration. In this description, this traversal is called depth-first RPO. All nodes explored in the RPO traversal are added to a new list L2. Then, a new unexplored node is selected from L1, and step 1206 is repeated until all nodes in L1 are explored. The RPO traversal exploits locality, increasing the likelihood of placing producer-consumer kernels in the same partition, increasing the likelihood that the critical path will not deteriorate.
[0063] In step 1208, the DPE array compiler 604 processes the sorted nodes one at a time and places them into the final partitions. Each node can be placed into an existing partition or a new partition. The allocation is performed by determining constraints between the selected kernel and the existing kernels of each partition. For example, the DPE array compiler 604 maintains the execution time ratio of each partition to be equal to or less than 1 (e.g., to ensure that a given data processing engine is not overcommitted) (step 1210). Thus, if the sum of the execution time ratio of the kernels in b_a and the execution time ratio of kernel k_a exceeds 1, kernel k_a cannot be assigned to partition b_a.
[0064] In another example, a partition with a kernel with an absolute constraint inherits the absolute constraint (step 1212). Thus, if kernel k_a has an absolute constraint that fixes the kernel to a particular data processing engine, and the partitioning algorithm maps k_a to partition b_a, the absolute constraint of k_a is extended to partition b_a. The DPE array compiler 604 then does not add a different kernel k_b to partition b_a, where k_b has an absolute constraint that maps it to a different data processing engine than k_a.
[0065] In another example, the DPE array compiler 604 ensures that the partitions meet the physical constraints of the data processing engine array (step 1214). For example, a partition cannot contain more than the number of input / output stream ports defined for a given architecture. Two kernels in the same partition cannot have certain types of connections between them, such as stream connections, cascade connections, asynchronous connections, etc.
[0066] In another example, the DPE array compiler 604 satisfies any dynamic location constraints that result from the partitioning process (step 1216). As the partitioning progresses, some location constraints may arise dynamically between two partitions that have intersecting double-buffered data edges. Such partitions may need to be mapped to adjacent data processing engines in the array.
[0067] In step 1208, the partitioning algorithm keeps track of all constraints and respects them while assigning kernels to partitions. If the kernel cannot be added to any existing partition due to constraint conflicts, the DPE array compiler 604 creates a new partition. However, if there are multiple partitions to which the kernel can be added, there are two possibilities: (1) the DPE array compiler 604 can add the kernel to one of the existing partitions, or (2) the DPE array compiler 604 can add the kernel to a new partition. The first option minimizes the number of partitions opened, which directly impacts power consumption. The second option helps to reduce the overall execution latency. Since users may have different objectives for different applications (e.g., reducing power usage vs. reducing execution time), the DPE array compiler 604 can offer two implementations to the user: (1) whenever possible, minimize the number of partitions, i.e., add the kernel to one of the existing partitions without conflicts; (2) add the kernel to a partition without conflicts only if it does not worsen the critical path length, otherwise a new partition is created. In either case, if the algorithm determines that a kernel can be added to multiple partitions, it prioritizes the partition that minimizes the number of double-buffered edges that span the partitions.
[0068] In step 1218, the design tool determines the execution order of the kernels in each partition based on their importance. After partitioning, the kernels in each partition are executed in sequence. To avoid increased execution latency, the kernels in a given partition are executed based on their importance.
[0069] Some constraints of the partitioning problem can also be formulated as an integer linear programming (ILP) problem, which can be solved using an ILP solver. However, not all constraints / objective functions can be effectively expressed in ILP, and the solution can be exponential in time. The heuristic-based partitioner described here is greedy and therefore linear in time. Partitioning is done in parallel with the mapping. Alternatively, partitioning and mapping can be performed simultaneously.
[0070] 13 is a flow diagram illustrating a method 1300 of assigning kernels to partitions, according to an example. Method 1300 can be performed as part of step 1208 of method 1200 above. Method 1300 begins at step 1302, where DPE array compiler 604 obtains a set P of nodes sorted in depth-first reverse-post-row order (e.g., from step 1206). At step 1304, DPE array compiler 604 determines whether set P is empty (e.g., whether all kernels have been assigned to partitions). If so, method 1300 proceeds to step 1306, where it performs post-partitioning optimization for communication minimization. Otherwise, method 1300 proceeds to step 1308. At step 1308, DPE array compiler 604 removes node n from set P. At step 1310, DPE array compiler 604 assigns node n to an existing or new partition.
[0071] In particular, the DPE array compiler 604 determines a set R of existing partitions to which n can be added. In step 1312, the DPE array compiler 604 sorts partition R in descending order of buffers shared with n. As noted above, some kernels may share memory buffers with other kernels. In step 1314, the DPE array compiler 604 selects the first partition r of the sorted R such that merging n and r does not result in (1) a deterioration of the critical path, or (2) an infeasible topology arrangement.
[0072] In step 1316, the DPE array compiler 604 determines whether r is empty (i.e., there is no existing partition for n). If not, the method 1300 proceeds to step 1318, where the DPE array compiler 604 merges node n with partition r and updates the location constraints of partition r based on node n (e.g., any absolute and / or relative constraints defined for n). If r is empty, the method 1300 instead proceeds to step 1320, where the DPE array compiler 604 creates a new partition, adds n to the new partition, and updates the location constraints of the new partition based on n. The method 1300 proceeds from either step 1318 or step 1320 to step 1304 and repeats until all nodes have been processed.
[0073] mapping As described in step 1108 above, the DPE array compiler 604 maps kernels and kernel clusters to the DPE 110. The input to the mapping algorithm is a static directed graph (such as FIG. 9B) and a device description. The mapping algorithm provides as output the physical locations in the DPE array 105 where each kernel is placed, where buffers between kernels are placed, and where IO nodes are mapped.
[0074] 14 is a flow diagram illustrating a method 1400 of mapping kernels and kernel clusters to a DPE 110, according to an example. The method 1400 may be performed as part of step 1108 of the method 1100 described above. The method 1400 begins at step 1402, where the DPE array compiler 604 performs a first pass of mapping kernels, buffers, and IO nodes without introducing DMA communication for block-based data movement between kernels (e.g., data movement within the DPE array 105). At step 1404, the DPE array compiler 604 determines whether any DMA is required. If not, the method 1400 proceeds to step 1410 and ends. If required, the method 1400 proceeds to step 1406.
[0075] In step 1406, the DPE array compiler 604 inserts additional buffers into the directed graph to provide DMA communication between kernels in the DPE array 105. In step 1408, the DPE array compiler 604 performs a second pass of mapping with DMA communication links. The second pass of mapping can run faster than the first pass because it can use the solution from the first mapping pass as a starting point. Thus, the DPE array compiler 604 only needs to position the newly inserted buffers for DMA communication. The method 1400 then ends in step 1410.
[0076] Both mapping passes (1402 and 1408) use a heuristic cost objective to solve an ILP-based optimization problem whose goals are: (1) to minimize the number of data movements, 2) to minimize memory contention, and 3) to minimize latency.
[0077] Data Movement Optimization: Each core 202 of the DPE 110 can access memory modules 351 on all cardinal directions (North, South, East, West) as shown in FIG. 3. When mapping a kernel to a core 202, the DPE array compiler 604 ensures that all buffers accessed by the kernel are placed in one of the memory modules 351 that can be directly accessed from the particular core 202. Two kernels mapped to different cores 202 can communicate through memory in two different ways: non-DMA and DMA. In the non-DMA case, a kernel is writing data to memory, which is read by another kernel. If two kernels are mapped to cores 202 that can access the same memory module 351, no DMA communication between the cores 202 is required. In the DMA case, two kernels are mapped to cores 202 that cannot access the same memory module 351. In such a case, the buffers between the kernels are replicated in two different memory modules 351, one of which may be accessed by the first core 202 and the other of which may be accessed by the second core 202. Data from the first memory module 351 is transferred to the second memory module 351 via the DPE interconnect 209 using DMA. Compared to non-DMA, DMA requires twice the memory footprint, twice the number of locks, and two DMA channels, in addition to routing resources in the DPE interconnect 209.
[0078] The DPE array compiler 604 models the DPE array 105 as a lattice architecture using a cost model in which the access cost of adjacent memory modules for each core is zero and the remaining memory modules have a higher cost. The optimization problem is then to map kernels to cores and buffers to memory modules with minimal cost. This problem can be naturally expressed as a quadratic optimization problem. The DPE array compiler 604 works to reduce the quadratic problem to an ILP problem.
[0079] Memory Contention Optimization: Each memory module 351 includes RAM banks 318 (e.g., eight banks of RAM). When there are multiple accesses to the same RAM bank in the same cycle, memory access contention occurs. Memory access contention can be categorized into different types: (1) intra-core memory access contention, (2) inter-core memory access contention, (3) core-DMA memory access contention, and (4) DMA-DMA memory access contention. In the case of intra-core memory access contention, a core executes a very long instruction word (VLIW) instruction. Each VLIW instruction can have multiple memory access instructions (e.g., up to two loads and one store). When two or more memory operations in a single instruction access the same memory bank, a memory stall occurs, which in turn causes a core stall. Two or more different cores accessing the same memory bank in the same cycle causes inter-core memory access contention. When a core and a DMA channel access the same memory bank in the same cycle, a core-DMA memory access contention occurs. When multiple DMA channels access the same memory bank in the same cycle, a DMA-DMA memory access contention occurs.
[0080] Because completely avoiding contention is not possible for all applications, the DPE array compiler 604 allows the user to select from a set of contention avoidance and contention minimization settings. The DPE array compiler 604 distinguishes between local buffers (e.g., buffers accessed by a single kernel) and shared buffers (e.g., buffers accessed by multiple kernels) and performs different optimizations. The DPE array compiler 604 takes a two-pronged approach to address memory contention: 1) contention avoidance and 2) contention minimization. For contention avoidance, to avoid access contention between producers and consumers of data blocks, the DPE array compiler 604 ensures that double buffers (e.g., ping and pong buffers) are mapped to different RAM banks. Similarly, the DPE array compiler 604 ensures that there is no contention between accesses of local buffers from different kernels by placing them in different banks. Intra-core memory contention is avoided by placing all buffers accessed by a single kernel in different RAM banks 318.
[0081] In the case of contention minimization, the problem reduces to one of minimizing the number of independent actors (cores, DMA channels) accessing a given memory bank. Modeling this as an ILP problem can be costly on large devices because the number of cores and DMA channels is proportional to c×r, where c is the number of columns and r is the number of rows in the device's DPE array 105. The DPE array compiler 604 employs a technique to reduce the number of ILP variables by modeling every DMA channel as two separate actors (reader and writer) rather than c×r× 4 distinct entities.
[0082] Latency Minimization: Similar to FPGA placement algorithms, the DPE array compiler 604 minimizes the latency of stream-based communication by minimizing the distance between sources and sinks.
[0083] Stream FIFO Insertion in Heterogeneous Multicore Architectures FIFO decision-making and insertion for deadlock avoidance and performance has been studied in the past, but mainly in the context of theoretical models of computation (synchronous dataflow, Kahn process networks, etc.) and high-level synthesis. The problem has not been solved for multiprocessor systems, primarily because very few systems communicate with each other using elastic handshake streams (e.g., most multiprocessor systems use shared memory for data communication or are systolic arrays operating in lockstep).
[0084] FIG. 15 is a flow diagram illustrating a method 1500 of FIFO insertion in implementing an application for a heterogeneous multi-core architecture. The method 1500 can be executed during any of steps 1108, 1110, 1112, 1114, and 1116 of the method 1100 described above. The method 1500 begins at step 1502, where the DPE array compiler 604 determines whether the application is deadlocked or does not meet performance criteria due to a mismatch in stream data latency along reconvergent computation and communication paths. If a failure occurs (step 1504), the method 1500 proceeds to step 1506. If no failure occurs, the method 1500 ends at step 1516. At step 1506, the DPE array compiler 604 determines a minimum FIFO size to avoid deadlocks and / or performance failures identified in the computation and communication paths. In one example, one or more minimum FIFO sizes can be predefined (e.g., specified by a user).
[0085] Analyzing this theoretically in the general case is difficult and conservative, which can lead to very large FIFOs. Therefore, in one example, the DPE array compiler 604 implements a simulation-based approach. The DPE array compiler 604 simulates the system with the selected FIFO size until the deadlock / performance failure is avoided (step 1508). The simulation can be done at various levels of abstraction, i.e., the computation kernel code can be untimed, but the kernels are executed concurrently ("untimed and concurrent execution of kernels"), or the kernels can be modeled cycle-accurately ("cycle-accurate concurrent execution of kernels").
[0086] Once the FIFO size is determined in step 1506, FIFOs need to be inserted along the stream routes between the producer and consumer compute kernels (step 1510). The DPE array 105 has two options: either each stream switch has two FIFOs of limited size (e.g., 16 words each), or a local data memory can be used as a FIFO via a tile DMA engine. The latter option is necessary if the FIFO size is very large. One problem with the former option is that the total number of size-limited FIFOs that can be used is limited by the number of stream switches along the route from producer to consumer. Thus, the route itself may need to be artificially long to meet the total specified or determined FIFO size. Another problem is that multiple routes may share a stream switch. Thus, the heuristic that distributes the specified or determined FIFO lengths along the stream switches of a route takes such sharing into account. Thus, in step 1512, the DPE array compiler 604 can select a FIFO in the DPE interconnect. Additionally or alternatively, the DPE array compiler 604 may implement a FIFO in local memory in step 1514. The method 1500 then ends in step 1516.
[0087] 16 is a block diagram illustrating a processing system 1600 according to an example. The processing system 1600 may be the result of step 1506 described above. In this example, the processing system 1600 includes a data source 1602 and a number of DPEs 1604A-1604D. The data source 1602 provides data that is processed by each of the DPEs 1604. The DPEs 1604 are coupled in series (e.g., a pipeline formed by DPE 1604A, DPE 1604B, DPE 1604C, and DPE 1604D, in that order). In step 1506, the DPE array compiler 604 may determine that the path between the data source 1602 and the DPE 1604A does not require a FIFO, that the path between the data source 1602 and the DPE 1604B requires a FIFO of depth 10, that the path between the data source 1602 and the DPE 1604C requires a FIFO of depth 20, and that the path between the data source 1602 and the DPE 1604D requires a FIFO of depth 30.
[0088] 17A is a block diagram illustrating an implementation 1700 of processing system 1600 according to one example. In this example, implementation 1700 includes nodes 1702, 1704, and 1706, each of which represents a switch in DPE interconnect 209. Implementation 1700 is the worst-case implementation of processing system 1600 because it requires the most FIFO resources (e.g., FIFOs of depths 10, 20, and 30, for a total of 60). Thus, in step 1510, DPE array compiler 604 can perform a more efficient placement of FIFOs, as described in the algorithm below.
[0089] 17B is a block diagram illustrating an implementation 1701 of processing system 1600 according to another example. In the example of FIG. 17B, implementation 1701 includes FIFOs of depths 10, 10, and 20, for a total depth of 40. Implementation 1701 achieves the FIFO needs of processing system 1600 using fewer resources than implementation 1700.
[0090] 18 is a flow diagram illustrating a method 1800 of arranging FIFOs, according to one example. Method 1800 may be performed by DPE array compiler 604 at step 1510 of method 1500. Method 1800 begins at step 1802, where DPE array compiler 604 determines a path order. A path is a collection of one or more nodes between data source 1602 and DPE 1604. In one example, DPE array compiler 604 processes paths in any order (e.g., from left to right). Another example is further described below. In step 1804, DPE array compiler 604 determines node order along each path. In one example, DPE array compiler 604 determines node order from DPE 1604 to data source 1602. Another example is further described below.
[0091] In step 1810, the DPE array compiler 604 selects a path to process. In step 1812, the DPE array compiler 604 annotates edges with FIFO requirements along the node order until a feasible FIFO placement is reached. In some cases, the DPE array compiler 604 "retimes" as many common FIFOs as possible to reach feasibility while still meeting the FIFO requirements (step 1814). For example, consider the path between the data source 1602 and the DPE 1604C. When processing this path, the DPE array compiler 604 may allocate a FIFO of depth 10 between nodes 1704 and 1706, and a FIFO of depth 10 between node 1706 and the DPE 1604C. This satisfies the FIFO requirements of both DPEs 1604B and 1604C. However, when processing the path between data source 1602 and DPE 1604D, DPE array compiler 604 may retime the FIFO between data source 1602 and node 1704 from a depth of 0 to a depth of 10, and retime the FIFO between nodes 1704 and 1706 from a depth of 10 to a depth of 0. The result is shown in Figure 17B. DPE array compiler 604 determines a FIFO of depth 20 between node 1704 and DPE 1704D to meet the FIFO requirements.
[0092] In one example, in step 1802, the DPE array compiler 604 performs a full graph analysis to determine the order of paths to be processed. Instead of looking at one path at a time to allocate FIFOs, the DPE array compiler 604 can look at all paths that require FIFO insertion. The DPE array compiler 604 can then sort the paths in ascending order of path size, with respect to the number of nodes along the path (step 1804). If the paths have an equal number of nodes, the DPE array compiler 604 can sort them based on the FIFO depth of the paths, from least deep to most deep.
[0093] In one example, in step 1806, the DPE array compiler 604 reorders the nodes along each path identified in step 1804. The degree of a node is defined as the total number of times the node has been used across all paths. The DPE array compiler 604 can sort the nodes in ascending order of degree. By performing full graph analysis and node ordering before the FIFO decision, the method 1800 can update the depth near the DPEs while moving the common FIFO depth towards the data source. Additionally, the method 1800 can handle broadcasts from FIFO ports.
[0094] In the example of FIG. 17A, the shortest path requiring a FIFO is between data source 1602 and DPE 1604D. The path between data source 1602 and DPE 1604B and the path between data source 1602 and 1604C are the same length (e.g., three nodes). However, the path between data source 1602 and DPE 1604B has a shallower FIFO depth (e.g., 10) relative to the path between data source 1602 and DPE 1604C (e.g., 20). Thus, DPE array compiler 604 can process the path between data source 1602 and DPE 1604D, followed by the path between data source 1602 and DPE 1604B first, and finally the path between data source 1602 and DPE 1604C.
[0095] In the example of Figure 17A, node 1702 is part of three paths, node 1704 is part of three paths, and node 1706 is part of two paths. Thus, for the paths between the data source and DPEs 1604B and 1604C, the node order is 1706, 1704, and 1702. For the path between the data source 1602 and DPE 1604D, the node order is 1704 and 1702.
[0096] Next, the DPE array compiler 604 performs steps 1810-1816 by processing the paths in the determined order and with the determined node order for each path. The result is shown in Figure 17B, which is the same as the result from the previous example (without path sorting and node reordering) in this example. However, in a real example, the resulting solution may be different.
[0097] Routing connections between cores in a DPE array Routing between cores in a DPE array can be achieved by greedily allocating channels to routes that require communication with the PL 122. Being a greedy heuristic, this approach reveals limitations when routing larger graphs or when special constraints need to be handled. Conventional approaches do not support handling of architectural constraints, packet switching, and channels that require upsize / downsize conversion and routing for explicit packet switching in the programming model. This specification describes techniques for routing that handle these requirements.
[0098] The following terms are introduced for use in describing the routing techniques described herein for routing applications mapped to the DPE array 105: Routing Node: A node in the routing graph that represents a source or destination of data or an intermediate switch. Node Capacity: An integer representing the maximum allowed data flow through a node. Routing Edge: A routing edge represents a possible flow of data from a source to a destination. Routing Graph: A routing graph represents all possible routing options. These options model the routing constraints imposed by architectural switching constraints, user-defined shim constraints, channel upsizing / downsizing constraints, and programmer-defined constraints with explicit packet splitting and merging operations. Net: A net represents a desired routing with a source node in the routing graph and multiple destinations in the routing graph. Net Utilization: An integer that models the bandwidth required by a net. Low bandwidth nets can be routed together by sharing switching resources.
[0099] 19 is a flow diagram illustrating a method 1900 of routing applications mapped to a DPE array 105, according to an example. The method 1900 can be performed during step 1116 of the method 1100 described above. The method 1900 begins at step 1902, where the DPE array compiler 604 builds a routing graph. The DPE array compiler 604 builds the routing graph based on a description of the DPE array 105 architecture. Each stream switch port is modeled as a single routing node. Each DMA, control port, and core stream port are modeled as a routing node. Possible choices for switching are represented as edges between nodes. All possible switching options allowed in the architecture are modeled in the routing graph. To build the routing graph, only a description of the DPE array 105 architecture is required.
[0100] In step 1904, the DPE array compiler 604 models the PL connections. Because the output of a PL node can be connected to any shim port, the DPE array compiler 604 models each PL connection as a crossbar connection from the PL source to all channels in the shim. If the user specifies specific constraints for the shim channels, the crossbar connections can be specialized for a given set of shim constraints.
[0101] In step 1906, the DPE array compiler 604 models the upsizer / downsizer connections. The shim architecture allows higher bit-width channels running at lower frequencies to be connected to lower bit-width channels running at higher frequencies. The shim channels have a fixed bit-width, so implementing some higher bit-width channels requires the use of multiple adjacent shim channels. The architecture further imposes the restriction that groups of shim channels must be distributed on even boundaries. These constraints are incorporated by modifying the routing graph with new nodes and edges. The constraints are expressed by replacing the crossbar connections with all shim channels with limited connectivity.
[0102] In step 1908, the DPE array compiler 604 models other constraints. Some constraints are not easily expressible as connections in the routing graph. These are expressed as additional global constraints on the nets and resource routes. For example, an architectural constraint might be to allow four packet switch nets to pass through all switch ports. Another example is to allow only one net to pass through a shim channel, even if bandwidth utilization is low. Early or late explicit packet switch node merging is handled using the constraint mechanism.
[0103] In step 1910, the DPE array compiler 604 invokes a satisfiability solver (SAT solver) to route the application within the DPE array 105. The input specification graph is examined for nets that require routing. The source and destination of the nets are identified. The source or destination net must be a node in the routing graph. Net utilization is provided by the user to enable packet switching. All nets in the input specification are passed together along with their constraints to the SAT solver. The solution provided by the SAT solver is used to program the stream switch (e.g., stream switch configuration code 616) of the DPE array 105.
[0104] FIG. 20 is a block diagram illustrating an example programmable IC 1 that can be used as one implementation of the device 100 shown in FIG. 1. The programmable IC 1 includes programmable logic 3, configuration logic 25, and configuration memory 26. The programmable IC 1 can be coupled to external circuits such as non-volatile memory 27, DRAM 28, and other circuits 29. The programmable logic 3 includes logic cells 30, support circuits 31, and programmable interconnects 32. The logic cells 30 include circuits that can be configured to implement a common logic function of multiple inputs. The support circuits 31 include dedicated circuits such as transceivers, input / output blocks, digital signal processors, memories, and the like. The logic cells and support circuits 31 can be interconnected using programmable interconnects 32. Information for programming the logic cells 30, setting parameters of the support circuits 31, and programming the programmable interconnects 32 is stored in the configuration memory 26 by the configuration logic 25. Configuration logic 25 may obtain configuration data from non-volatile memory 27 or any other source (e.g., from DRAM 28, or other circuitry 29). In some examples, programmable IC 1 includes a processing system 2. Processing system 2 may include microprocessor(s), memory, support circuitry, IO circuitry, etc.
[0105] 21 shows a field programmable gate array (FPGA) implementation of a programmable IC 1 that includes a number of different programmable tiles, including transceivers 37, configurable logic blocks ("CLBs") 33, random access memory blocks ("BRAMs") 34, input / output blocks ("IOBs") 36, configuration and clocking logic ("CONFIG / CLOCKS") 42, digital signal processing blocks ("DSPs") 35, specialized input / output blocks ("I / Os") 41 (e.g., configuration and clock ports), and other programmable logic 39, such as digital clock managers, analog-to-digital converters, system monitoring logic, etc. The FPGA may also include a PCIe interface 40, an analog-to-digital converter (ADC) 38, etc.
[0106] In some FPGAs, each programmable tile may include at least one programmable interconnect element ("INT") 43 with connections to input and output terminals 48 of programmable logic elements within the same tile, as shown by the example included at the top of FIG. 21. Each programmable interconnect element 43 may also include connections to interconnect segments 49 of adjacent programmable interconnect element(s) within the same tile or other tile(s). Each programmable interconnect element 43 may also include connections to interconnect segments 50 of general routing resources between logic blocks (not shown). The general routing resources may include routing channels between logic blocks (not shown) that comprise tracks of interconnect segments (e.g., interconnect segments 50) and switch blocks (not shown) for connecting the interconnect segments. The interconnect segments of the general routing resources (e.g., interconnect segments 50) may span one or more logic blocks. The programmable interconnect elements 43 together with the general routing resources implement the programmable interconnect structure ("programmable interconnect") of the illustrated FPGA.
[0107] In an exemplary embodiment, the CLB 33 may include configurable logic elements ("CLEs") 44 that can be programmed to implement user logic and a single programmable interconnect element ("INT") 43. The BRAM 34 may include BRAM logic elements ("BRLs") 45 in addition to one or more programmable interconnect elements. Typically, the number of interconnect elements included in a tile depends on the height of the tile. In the illustrated example, the BRAM tile has a height of five CLBs, although other numbers (e.g., four) may be used. The DSP tile 35 may include DSP logic elements ("DSPLs") 46 in addition to any suitable number of programmable interconnect elements. The IOB 36 may include, for example, two instances of input / output logic elements ("IOLs") 47 in addition to one instance of the programmable interconnect element 43. As will be apparent to those skilled in the art, for example, the actual I / O pads connected to the I / O logic element 47 are typically not limited to the area of the input / output logic element 47.
[0108] In the illustrated example, a horizontal region near the center of the die (as shown in FIG. 12) is used for configuration, clocks, and other control logic. Vertical columns 51 extending from this horizontal region or column are used to distribute clock and configuration signals across the width of the FPGA.
[0109] Some FPGAs utilizing the architecture shown in Figure 21 include additional logic blocks that disrupt the regular columnar structure that makes up most of the FPGA. The additional logic blocks can be programmable blocks and / or dedicated logic.
[0110] It should be noted that Figure 21 is intended to illustrate an exemplary FPGA architecture only. For example, the number of logic blocks in a row, the relative width of the rows, the number and order of the rows, the types of logic blocks included in the rows, the relative sizes of the logic blocks, and the interconnect / logic implementation included in the upper portion of Figure 21 are purely exemplary. For example, in an actual FPGA, two or more adjacent rows of CLBs are typically included wherever a CLB appears to facilitate efficient implementation of user logic, although the number of adjacent CLB rows will vary depending on the overall size of the FPGA.
[0111] While the above is directed to particular examples, other and further examples may be devised without departing from the basic scope thereof, which scope is determined by the appended claims.
Claims
1. A method executed by a computer to implement an application for a system-on-chip (SOC) having an array of data processing engines (DPEs), comprising: The computer, determining a graph representation of the application, the graph representation including nodes representing kernels of the application and edges representing communications between the kernels; based on said graph representation, mapping said kernels to DPEs of said DPE array and mapping data structures of said kernels to memory within said DPE array; routing a communication channel between a DPE and the application's circuitry configured within the programmable logic of the SOC; generating implementation data for programming the SOC to implement the application based on results of the mapping and the routing; determining a graph representation and clustering the kernels into groups prior to the mapping step; Includes performing, The method, wherein the mapping step includes mapping at least one cluster of kernels to one DPE in the DPE array.
2. optimizing code for one or more of the kernels prior to the mapping step; allocating locks for DPE-to-DPE communication in the DPE array; The method of claim 1 , comprising:
3. The mapping step includes:
2. The method of claim 1, comprising mapping the data structures to at least one of a memory bank within the DPE and a direct memory access (DMA) stream between DPEs.
4. 1. A non-transitory computer-readable medium storing instructions that, when executed by a processor, cause the processor to perform a method for implementing an application for a system-on-chip (SOC) having a data processing engine (DPE) array, the method comprising: determining a graph representation of the application, the graph representation including nodes representing kernels of the application and edges representing communications between the kernels; based on said graph representation, mapping said kernels to DPEs of said DPE array and mapping data structures of said kernels to memory within said DPE array; routing a communication channel between a DPE and the application's circuitry configured within the programmable logic of the SOC; generating implementation data for programming the SOC to implement the application based on results of the mapping and the routing; Including, prior to the mapping step, further comprising determining a graph representation and clustering the kernels into groups; 11. A non-transitory computer-readable medium, wherein the mapping step includes mapping at least one cluster of kernels to one DPE in the DPE array.
5. The non-transitory computer-readable medium of claim 4 , further comprising optimizing code for one or more of the kernels prior to the mapping step.
6. The mapping step includes: The non-transitory computer-readable medium of claim 4 , further comprising mapping the data structure to at least one of a memory bank within the DPE and a direct memory access (DMA) stream between DPEs.
7. 5. The non-transitory computer-readable medium of claim 4, further comprising the step of allocating locks for DPE-to-DPE communication in the DPE array.
8. The step of generating the mounting data includes: The non-transitory computer-readable medium of claim 4 , further comprising generating code for each DPE to implement one or more of the kernels.
9. The step of generating the mounting data includes:
5. The non-transitory computer readable medium of claim 4, further comprising generating control code for configuring direct memory access (DMA) and switch circuitry in the DPE array.
10. 1. A computer system comprising: a memory configured to store program code; and a processor configured to execute the program code to implement an application for a system on a chip (SOC) having a data processing engine (DPE) array, the processor comprising: determining a graph representation of the application, the graph representation including nodes representing kernels of the application and edges representing communications between the kernels; based on said graph representation, mapping said kernels to DPEs of said DPE array and mapping data structures of said kernels to memory within said DPE array; routing a communication channel between a DPE and the application's circuitry configured within the programmable logic of the SOC; generating implementation data for programming the SOC to implement the application based on results of the mapping and the routing; Run prior to the mapping step, further comprising determining a graph representation and clustering the kernels into groups; The computer system, wherein the mapping step includes mapping at least one cluster of a kernel to one DPE in the DPE array.
11. 11. The computer system of claim 10, wherein said mapping step includes mapping said data structure to at least one of a memory bank within said DPE and a direct memory access (DMA) stream between DPEs.
12. The computer system of claim 10 , further comprising optimizing code for one or more of the kernels prior to the mapping step.
13. The step of generating the data comprises: generating code for each DPE to implement one or more of said kernels therein; generating control code for configuring direct memory access (DMA) and switch circuitry within said DPE array; 11. The computer system of claim 10, comprising:
Citation Information
Patent Citations
Methods for compiling high-level programming languages
JP2002508102A
Communication system using ring architecture
JP2005516432A
computer image processing pipeline
JP2016536692A
System, method and software for static and dynamic programming and configuration of an adaptive computing architecture
US20070157166A1
Code partitioning for the array of devices
US20170262567A1
