A method for implementing a hardware device to perform operations defined by high-level software code.

By translating high-level software code into lower-level code and optimizing memory transfers through automated roofline model generation and DSE, the method addresses HLS inefficiencies, achieving significant performance improvements and optimal hardware configurations for FPGAs and ASICs.

JP7542005B2Active Publication Date: 2024-08-29HUXELERATE SRL
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2021563674
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2019-04-26
Filing Date
2020-04-23
Publication Date
2024-08-29
Estimated Expiration
2040-04-23

AI Technical Summary

Technical Problem

Existing high-level synthesis (HLS) tools for hardware implementations, such as FPGAs and ASICs, face challenges in optimizing memory transfers and require significant user expertise, leading to inefficiencies and suboptimal performance due to the complexity of programmability and the lack of automated design space exploration (DSE) that considers off-chip memory interactions.

Method used

A method that translates high-level software code into lower-level code, evaluates parameters for peak performance, and configures hardware devices to optimize memory transfers by combining automated roofline model generation and DSE, considering both computational intensity and memory transfer performance.

Benefits of technology

The method achieves up to 14.36x performance improvements over traditional automated solutions and identifies optimal hardware configurations, providing designs comparable to custom-built state-of-the-art implementations, while reducing design time and resource usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007542005000008
    Figure 0007542005000008
  • Figure 0007542005000010
    Figure 0007542005000010
  • Figure 0007542005000009
    Figure 0007542005000009
Patent Text Reader

Abstract

The present disclosure provides a method for implementing a hardware device, particularly a hardware device implemented on an FPGA or fabricated as an ASIC, configured to meet the maximum performance achievable by a particular algorithm defined by high-level software code. The method involves translating the high-level software code into corresponding low-level software code defining lower-level operations for performing the same operations defined by the high-level software code, then evaluating certain parameters to calculate a peak performance value P and a memory transfer performance Pm of the hardware device, and finally implementing the hardware device using hardware resources that have performance within the range of the peak performance value P and the memory transfer performance Pm.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present disclosure relates to high level synthesis tools for hardware implementation of algorithms, and more particularly to methods for implementing hardware devices for performing operations defined by high level software code. [Background technology]

[0002] The ever-increasing demand for computational performance and energy-efficient solutions in the context of both High Performance Computing (HPC) and the Cloud is driving the adoption of heterogeneous systems. Among the hardware accelerators available on the market, Field Programmable Gate Arrays (FPGAs) offer an attractive trade-off between performance and power efficiency on the one hand, and flexible solutions due to their reconfigurability features on the other hand. Despite its benefits, one of the main limiting factors for the widespread adoption of FPGA technology is its complexity in programmability [1]. On the other hand, Application Specific Integrated Circuits (ASICs) offer the best power-performance profile, albeit at the expense of higher development and design time, but lack the reconfigurability features inherent to FPGAs. Today, High-Level Synthesis (HLS) tools are widely used to steadily reduce hardware design time compared to more traditional development with Hardware Description Languages ​​(HDLs). Starting from a high-level representation of an algorithm (e.g. C / C++), a designer can specify several optimization directives that refer to specific parts of the code. Such directives are often given in the form of pragmas, making it possible to define high-level architecture choices for implementing the corresponding kernel. Although this approach is highly effective in terms of the obtained performance / design time ratio, the HLS tool still requires a certain amount of time to generate the final design. Moreover, the performance of the final design depends mainly on the user's experience in selecting the best set of optimization directives.

[0003] For this reason, several works have been proposed to automate the design space exploration (DSE) of HLS optimization directives [2]–[5], proposing different methods to achieve an optimal kernel design in a relatively short time. Despite the quality of the exploration methods used, such works do not explicitly consider memory transfers to and from off-chip memories, nor do they assume that kernel inputs and outputs are fully cacheable on-chip. As a result, when a kernel communicates with an off-chip DDR memory through an AXI interface, as in Xilinx's SDAccel design flow [6], inefficiencies in memory transfers can easily threaten the effectiveness of the optimization directives. It is therefore important to identify where the current performance bottlenecks exist before optimizing the kernel itself. HLS tools provide directives that allow to explore several hardware implementations of the software description of an algorithm. While HLS directives can improve the hardware design in terms of computational complexity, in most cases optimizing memory transfers requires code restructuring by the designer. This aspect limits the effectiveness of DSE approaches that target only HLS directives.

[0004] In this regard, the roofline model [7], [8] can be used to analyze the performance limits of a given application running on a particular architecture. This analytical model allows to quickly check whether an algorithm is memory-bound and whether designers should restructure the code and apply memory transfer optimizations before investigating computer-specific optimization directives.

[0005] Below, we provide an overview of related work based on automated discovery of HLS directives and roofline model analysis.

[0006] A. Automatic HLS Code Optimization Several works in the literature have proposed methods to efficiently explore HLS optimization directives in different contexts [2]-[5]. In detail, [4] performs several preliminary HLS runs on a set of sample designs derived from the target code. The HLS resource and performance reports are used as the basis of an analytical linear model to drive DSE. The analytical model is parameterized with respect to the loop hierarchy of the algorithm, providing an assessment for a categorization of the application rather than the algorithm itself. Furthermore, the tool relies on the execution of an underlying HLS tool, which may require a large amount of time to execute according to the target code. Other approaches, such as COMBA [2] and Lin-Analyzer [3], do not require an external HLS tool. In particular, Lin-Analyzer leverages a dynamic data dependency graph obtained from the program trace to derive resource and performance assessments required by DSE. COMBA, on the other hand, performs static code analysis directly on the LLVM [9] intermediate representation (IR) generated from the Clang front-end

[20] . COMBA builds a hierarchical Data-Flow Graph (DFG) of the top-level function to accelerate and recursively compute resource and performance evaluation using analytical models. Both [2] and [3] consider DSP consumption, but do not evaluate LUT usage, which may be the most limiting resource in some scenarios. Moreover, both approaches do not consider the effect of code optimizations applied after loop unrolling, such as instcombine and gvn

[10] , which may significantly reduce code complexity. Thus, such approaches tend to overestimate resource consumption, even though they provide fairly accurate results when evaluating kernel latency. Finally, unlike previous works, [5] considers the effects of off-chip memory transfers. Nevertheless, it is restricted to applications with a load-compute-store paradigm whose working sets are on-chip and cacheable.

[0007] In our work, we employ the same model-based approach of COMBA augmented by a preprocessing optimization step with both built-in and custom LLVM compiler passes, thus allowing us to more accurately explore the design space and identify solutions that COMBA considers infeasible due to overestimation of resource requirements.

[0008] B. Generalized Roofline Model One of the first works to adapt the roofline model [7] to FPGA-based architectures is [8], where the authors propose a method to build the roofline model relying on the use of HLS tools. Taking advantage of the increased computation intensity brought about by loop unrolling, the HLS tool allows the user to evaluate the performance and resource usage of several unrolled versions, and the roofline model is obtained by interpolation. However, this work lacks automation for the calculation of both computation intensity and peak performance. Such limitations are addressed by

[11] , which presents a tool to semi-automatically build roofline models for OpenCL kernels. Peak bandwidth and peak performance are calculated through benchmarking on the target architecture without considering the computations to be accelerated. Nevertheless, since FPGAs and ASICs allow defining hardware accelerators according to the computations to be performed, the assumption of computation-independent peak performance makes the approach unreliable. On the other hand, in

[12] , the peak performance is calculated also taking into account the input algorithm. Combining data provided in the datasheets, they calculate several peak performance values ​​according to two factors: the ratio of floating-point additions and multiplications required by the kernels, and the ratio of DSP and LUT resources used for their implementation. Even though this work partially considers the algorithms to be accelerated, these two factors only provide a coarse-grained classification of algorithms. Moreover, users must manually specify the ratio of DSP and LUT usage. [Prior art documents] [Non-patent literature]

[0009] [Non-Patent Document 1] DFBacon, RMRabbah, S. Shukla et al., "Fpga programming for the masses", Commun.ACM, vol.56, no.4, pp. 56-63, 2013 [Non-Patent Document 2] J. Zhao, L. Feng, S. Sinha, W. Zhang, Y. Liang, and B. He, "Comba: A comprehensive model-based analysis framework for high level synthesis of real applications", in Proceedings of the 36th International Conference on Computer-Aided Design. IEEE Press, 2017, pp. 430-437. [Non-Patent Document 3] G. Zhong, A. Prakash, Y. Liang, T. Mitra, and S. Niar, "Lin-analyzer: a high-level performance analysis tool for fpga-based accelerators", in Proceedings of the 53rd Annual Design Automation Conference. ACM, 2016, p. 136. [Non-Patent Document 4] G. Zhong, V. Venkataramani, Y. Liang, T. Mitra, and S. Niar, "Design space exploration of multiple loops on fpgas using high level synthesis", in 2014 IEEE 32nd International Conference on Computer Design (ICCD), October 2014, pp. 456-463. [Non-Patent Document 5] J. Cong, P. Wei, CHYu, and P. Zhang, "Automated accelerator generation and optimization with composable, parallel and pipeline architecture," in 2018 55th ACM / ESDA / IEEE Design Automation Conference (DAC). IEEE, 2018, pp. 1-6. [Non-Patent Document 6] L. Wirbel, "Xilinx sdaccel: a unified development environment for tomorrow's data center", Technical Report, The Linley Group Inc, Tech. Rep., 2014 [Non-Patent Document 7] S. Williams, A. Waterman, and D. Patterson, "Roofline: An insightful visual performance model for multicore architectures," Commun. ACM, vol. 52, no. 4, pp. 65–76, April 2009. [Online]. Available: http: / / doi.acm.org / 10.1145 / 1498765.1498785 [Non-Patent Document 8] B. da Silva, A. Braeken, E. H. D'Hollander, and A. Touhafi, "Performance modeling for fpgas: Extending the roofline model with high-level synthesis tools," Int. J. Reconfig. Comput., vol. 2013, pp. 7:7–7:7, January 2013. [Online]. Available: http: / / dx.doi.org / 10.1155 / 2013 / 428078 [Non-Patent Document 9] C. Lattner and V. Adve, "Llvm: A compilation framework for lifelong program analysis & transformation", in Proceedings of the international symposium on Code generation and optimization: feedback-directed and runtime optimization. IEEE Computer Society, 2004, p. 75. [Non-Patent Document 10] C. Lattner, "LLVM and Clang: Next Generation Compiler Technology", In The BSD Conference, May 2008. [Non-Patent Document 11] J. Oppermann, A. Koch, T. Yu, and O. Sinnen, "Domain-specific optimization for the high-level synthesis of cellml-based simulation accelerators", in 2015 25th International Conference on Field Programmable Logic and Applications (FPL). IEEE, 2015, pp. 1-7. [Non-Patent Document 12] S. Muralidharan, K. O'Brien, and C. Lalanne, "A semi-automated tool flow for roofline anaylsis of opencl kernels on accelerators", in First International Workshop on Heterogeneous High-performance Reconfigurable Computing (H2RC'15), 2015 [Non-Patent Document 13] J. de Fine Licht, KFLarsen, T. Hoefler, and S. Ramos, "Modeling and implementing high performance programs on fpga", Master's thesis, University of Copenhagen, Department of Computer Science, 2016 [Non-Patent Document 14] https: / / en.wikipedia.org / wiki / LLVM [Non-Patent Document 15] https: / / llvm.org / ProjectsWithLLVM / [Non-Patent Document 16] Xilinx Inc., “Vivado HLS.” [Online]. Available: https: / / www.xilinx.com / products / design-tools / vivado / integration / esl-design.html [Non-Patent Document 17] JMCodina, J. Llosa, and A. Gonza'lez, "A comparative study of modulo scheduling techniques," in Proceedings of the 16th international conference on Supercomputing. ACM, 2002, pp. 97-106. [Non-Patent Document 18] L. de Souza Rosa, C. Bouganis, and V. Bonato, "Scaling up modulo scheduling for high-level synthesis", IEEE Transactions on Computer Aided Design of Integrated Circuits and Systems, pp. 1-1, 2018. [Non-Patent Document 19] J. Cong and Z. Zhang, "An efficient and versatile scheduling algorithm based on sdc formulation", in 2006 43rd ACM / IEEE Design Automation Conference. IEEE, 2006, pp. 433-438. [Non-Patent Document 20] L.-N. Pouchet, "Polybench: The polyhedral benchmark suite", URL: http: / / www. cs. ucla. edu / pouchet / software / polybench, 2012 [Non-Patent Document 21] E. Del Sozzo, M. Rabozzi, L. Di Tucci, D. Sciuto, and MD Santambrogio, "A scalable fpga design for cloud n-body simulation", in 2018 IEEE 29th International Conference on Application-specific Systems, Architectures and Processors (ASAP). IEEE, 2018, pp. 1-8. [Non-Patent Document 22] L. Di Tucci, K. O'Brien, M. Blott, and MD Santambrogio, "Architectural optimizations for high performance and energy efficient smith-waterman implementation on fpgas using opencl", in Design, Automation & Test in Europe Conference & Exhibition (DATE), 2017. IEEE, 2017, pp. 716-721. Summary of the Invention [Problem to be solved by the invention]

[0010] To overcome the above limitations, we propose a novel approach to automatically calculate the maximum performance achievable by a given algorithm defined by a high-level software code to realize a hardware device, in particular a hardware device implemented on an FPGA or fabricated as an ASIC, to meet its maximum performance. [Means for solving the problem]

[0011] A method according to the present disclosure is defined in the appended claims and is based on the steps of translating a high level software code into a corresponding lower level software code defining lower level operations for performing the same operations defined by the high level software code, then evaluating certain parameters to calculate at least a peak performance value P of hardware devices that can be manufactured or configured to execute the high level software code, selecting the hardware devices to be manufactured or configured according to the respective peak performance value P, and finally manufacturing or configuring the selected hardware devices to execute the high level software code.

[0012] According to one aspect of the method of the present disclosure, a total number of bytes of data transferred to and from the memory of the hardware device when the software code is executed and a maximum bandwidth for transferring data to and from the memory are evaluated, and an operational intensity of the low-level software code is calculated. Finally, a memory transfer performance value of the hardware device is calculated as a product of the operational intensity and the maximum bandwidth, and the hardware device to be manufactured or configured is selected according to the memory transfer performance value as well.

[0013] According to one aspect, the low-level software code is generated by translating the high-level software code into low-level software code using an LLVM front-end compiler, such as the Clang front-end compiler or the Flang front-end compiler (https: / / en.wikipedia.org / wiki / LLVM, https: / / llvm.org / ProjectsWithLLVM / ), and by processing the low-level software code with the LLVM compiler to evaluate the runtime occurrence and hardware resource usage of each operation, where the hardware resources may be, by way of non-limiting examples, block RAM, DSP, flip-flops, look-up tables, and area.

[0014] According to one aspect, the hardware device is configured on an FPGA or fabricated as an ASIC, and the hardware device is realized by running a design space exploration algorithm on the low-level software code to identify a suitable FPGA configuration or ASIC based on peak performance and memory transfer performance metrics to be met. [Brief description of the drawings]

[0015] [Figure 1] FIG. 1 is a block diagram illustrating one aspect of the method of the present disclosure. [Diagram 2] Pareto plot of designs explored by DSE for two PolyBench test cases: a) Gesummv test case, and b) Mm test case. [Diagram 3] Graph of the roofline model illustrating the optimization process for the N-body algorithm. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0016] The present disclosure provides a method for implementing a hardware device, particularly a hardware device implemented on an FPGA or fabricated as an ASIC, that is implemented to meet the maximum performance achievable by a particular algorithm defined by high-level software code. A comprehensive method is also provided to assist designers in generating optimal HLS-based hardware implementations.

[0017] First, we propose an automated roofline model generation that starts from a high-level software code description of the target algorithm. Our approach enables a fast assessment of the computational intensity of the target function, visualizes the main bottlenecks of the current HLS implementation, and provides guidance on how to improve it. Second, we present a DSE method for quickly assessing different HLS directives to identify the optimal implementation. We evaluate the DSE against several benchmarks from the PolyBench test suite and achieve up to 14.36x performance improvement compared to traditional automated solutions in the literature. Finally, we validate our holistic method against an N-body physical simulation algorithm and achieve results comparable to a custom-built state-of-the-art implementation.

[0018] Under these motivations, we propose a comprehensive method to combine roofline model analysis with automatic DSE to select the optimal set of optimization directives.The novel contributions of this work are as follows: - An automatic approach for generating a roofline model analysis for a given target hardware device (i.e., FPGA or ASIC technology) and high-level software code of an algorithm to help enable designers to assess performance bottlenecks and off-chip memory transfer optimizations and select the most suitable hardware device within a set of hardware devices according to a given objective function. - Analytical models for predicting application peak performance limits that consider both the application to be accelerated and the underlying target hardware device. - Automated DSE of HLS optimization directives driven by fine-grained evaluation and enabling thorough utilization of available hardware resources.

[0019] Section I provides an overview of the proposed methodology and shows how application designers can benefit from it. Section II describes our approach to obtain performance and resource evaluation from a given high-level software implementation. Section III considers the roofline model analysis and explains how we automate its generation and adapt it to FPGA-based architectures or a given ASIC technology. Section IV presents a DSE for the identification of optimal HLS directives. Finally, Section V evaluates the proposed methodology.

[0020] I. Overview of the proposed approach / / Unroll and pipeline the loop execution void __loop_unroll__(); void __loop_unroll_partial__(uint32_t factor); void __loop_pipeline__(); / / Specify array partitioning for a particular variable and dimension enum p_type { BLOCK, COMPLETE, CYCLIC}; void __array_partition__(const void *variable, p_type type, uint32_t factor, uint32_t dimension); / / Specify the I / O interface for the function arguments. void __axi_master__(void *argument, const char *bundle_name); Listing 1: Optimization directives to specify a particular design configuration

[0021] The different steps of our method are detailed in Figure 1. Our approach takes as input the target hardware and the target high-level software code (e.g., C / C++) extended with optimization pragmas similar to those from Vivado HLS

[13] . We support pragmas to specify loop unrolling, loop pipelining, loop flattening, array partitioning and memory transfers through an AXI protocol interface whose format is reported in the listing output 1. As with other approaches in [2], we require that all loop bounds in the target function are known. This is needed by the DSE to estimate kernel latency and by the roofline model generation to automatically derive peak performance and arithmetic intensity.

[0022] The first step performed by our method involves the generation of LLVM IR from high-level software input code (such as C and C++). The LLVM IR is then analyzed to provide an initial performance and resource assessment. Performance is evaluated by scheduling kernel functions and calculating the latency of the critical path, while resource usage is evaluated considering the resource utilization of the operations in the schedule. To support this phase, our method features a performance and resource modeling library. This library, referred to simply as the profiling library in the remainder of this document, contains estimates of performance (latency, timing) and resource usage (such as BRAM, DSP, FF, LUT and area) reported by the synthesis tool used for the target hardware realization for operations synthesized at different frequencies.

[0023] Examples of synthesis tools are Vivado HLS / Vivado by Xilinx for the realization of FPGA configurations as well as Catapult HLS by Mentor and Design Compiler by Synopsys aimed at ASICs of a given technology.

[0024] In the next step, the workflow automatically generates a Roofline model analysis and visualizes it in a web-based user interface, where the performance limits, computational intensity and the evaluated performance of the initial design are shown on the same chart. At this point, the user may restructure the code and try to overcome the memory bottlenecks identified by the Roofline model analysis, or may continue with the automated DSE of optimization directives. If the DSE is performed, the evaluated performance of the best feasible design resulting from the DSE is plotted directly on the Roofline model chart. In this way, the user has a comprehensive view of the current design configuration, both in terms of the potential achievable performance, limited either by peak performance or bandwidth limits, and the actual performance of the solution derived by the DSE. Finally, the user also has the possibility to modify the code or specify manual optimization directives. The resulting code can be used as a reference version for further iterations, where the Roofline model analysis and the DSE are performed iteratively. Overall, the proposed method allows the user to iteratively converge towards an optimal design, while taking into account the performance and memory bottlenecks specific to the solution being analyzed. In the next sections, the phases of our approach are described in detail.

[0025] II. Performance and Resource Evaluation In this section, we present a lightweight resource and performance evaluation performed on the LLVM IR of the target code. The overall process relies on both built-in LLVM passes and custom passes that are needed to improve the accuracy of the evaluation. In particular, we start by applying standard O1 level optimizations from LLVM, which are also common in commercial high-level synthesis tools. We then apply the following custom passes: unrolling loops marked by the loop unrolling optimization directive, tree balancing for associative operators, analysis and propagation of constant memory accesses, range analysis for type manipulation, instruction redundancy elimination, and resource mapping for multiplicative-additive operations. Furthermore, after the custom passes, we apply additional built-in LLVM passes (such as instcombine and gvn) that can further improve the code quality.

[0026] After code optimization, the function is scheduled to evaluate its overall latency. The approach calculates the arrival time of each basic block by recursively considering the arrival times of its predecessors and the latency of the basic block itself. If a predecessor is a complex structure such as a loop, its latency is calculated by recursively applying the same approach as for its basic blocks. The latency of a kernel function is obtained from the arrival time of the basic block where the function returns from the call. Furthermore, the latency of a loop is obtained from the latency of the loop body according to certain optimization directives. Since loop unrolling is applied directly as a code transformation, it is only necessary to distinguish between pipelined and non-pipelined loops. When pipelining is not applied, the loop latency is calculated as the product of the iteration latency IL and the number of iterations N. For pipelined loops, the loop latency is instead calculated as IL+II*(N1), where II is the initiation interval of the loop. To accelerate the search, we approximate II as the minimum initiation interval

[14] without running time-consuming modulo scheduling algorithms

[14] -

[16] . We compute the minimum initiation interval

[14] as MII = max(RecMII,ResMII), where RecMII and ResMII are the contributions to the recursion constraint minimum initiation interval and the resource constraint minimum initiation interval. RecMII is a constraint on the initiation interval given by loop-carried dependencies such as accumulations. It is expressed as RecMII = max i [delay i / distance i ] is calculated as follows: i is the delay in clock cycles along the dependency path of the i-th dependency, and distance i is the distance of the i-th recursion through the loop iteration. For each dependency, the path considered is the path starting from the destination operation and passing through the back edges to the source operation. ResMII is instead a constraint on the resource usage of a bounded functional unit. In general, it is ResMII=maxi [numOps i / numFUs i ], except for numOps i is the number of operations of type i in the loop, and numFUs i is the number of available functional units of type i. In our case, the constrained operations are those that access memory, and memory is divisible, so the formula is ResMII=max i [numAccs i / numPorts i However, numAccs i is the number of accesses to the i-th partition, and numPorts i is the number of ports available to access the i-th partition. The number of iterations N performed by a particular loop is equal to its trip count obtained from LLVM scalar evolution analysis applied to the loop induction variables. However, to account for the loop flattening optimization for fully nested loops, including pipelined loops, we modify the loop iteration assignment. In particular, for a full loop nest with the innermost loop pipelined, the number of iterations performed by the pipelined loop is equal to the product of the trip counts of all loops in the loop nest, while other loops in the loop nest are assigned a number of iterations equal to 1. This approach emulates the collapse of a loop nest into a single loop that occurs when loop flattening is performed.

[0027] Apart from the optimizations applied to the loops, the latency of a single iteration is obtained from the arrival times of its latch blocks, considering that the header block has no predecessors. Finally, the latency of a single basic block is calculated using an adaptive ALAP version of the resource-constrained list scheduling algorithm, including instruction chaining. This algorithm imposes constraints on instructions accessing the same memory port in the same clock cycle. It considers accesses to partitioned arrays, which are modeled by instantiating one queue for each partition, as well as accesses to the external AXI interface. Each queue identifies the partition it models (baseAddr, id1, id2, ..., id n-1 ), where baseAddr is the base address of the n-dimensional array being accessed, and id i is the partition index associated with each dimension i. i Given a memory access to, the corresponding queue to be accessed is determined as follows: -id i =[index i / [size i / f i ]], in case of block division -id i =(index i )mod(f i ), in the case of periodic partitioning -id i =index i , in case of perfect partitioning However, size i is the size of dimension i, and f i is the partitioning factor for dimension i. When a kernel is scheduled, the overall resource consumption for each resource type specific to the target hardware is evaluated. In our model, 2 [log2(partitionSize / capacity)]We consider the amount of BRAM banks to allocate an array equal to *partitions, where partitionSize is the size in bits of each partition, capacity is the capacity of the BRAM bank, and partitions is the total number of partitions that make up the array. The resource consumption given by the operators is taken from the profiling library, taking into account resource sharing between instances of the same operator that start their computation in different clock cycles. Finally, we also model the LUT and FF usage due to the multiplexing and routing logic introduced by resource sharing. A more detailed description of the resource evaluation follows.

[0028] 1) Expressions: Instances of an expression that constitute an algorithm may consume resources such as DSPs, FFs and LUTs. Shareable operators executed in different clock cycles can be reused, saving resources but increasing routing complexity. For this reason, we allow sharing of two expressions only that utilize at least one DSP (usually the critical resource) and complex operations with latency greater than 1. Since we consider shareable operators to be fully pipelined, the number of instances required by a single operator in a basic block depends on the maximum number of instances of an operator that start their computation in the same clock cycle. Combining this data with the number of operators that would be instantiated if no reuse were applied, it is possible to calculate the reuse rate of an operator. The number of instances required by a non-shareable operator instead depends only on the number of operators of that type used by the application. Once the number of instances required by the application is obtained, we multiply this amount by the estimated resource usage of a single instance given by the profiling library.

[0029] 2) Partial Result Storage: Partial results of a computation over multiple clock cycles are stored in registers (FFs). Therefore, we evaluate the FF usage by considering that instructions cannot be chained because results must be stored for further computation. The FF usage of a single instruction can be calculated by multiplying the amount of these instructions to the bit width of the operation, weighted by the reuse factor of that operator.

[0030] 3) Shared Resource Routing: Resource sharing requires the use of multiplexers to feed the right operands to the instances. Since multiplexers are implemented using LUTs, assuming that for each operand a multiplexer with a number of inputs given by the reuse factor is used, we can calculate the number of LUTs required to implement a multiplexer with a given number of inputs and thus the LUT usage for each instance.

[0031] III. Automated Roofline Model Analysis In this section, we describe how to adapt the classical Roofline model [7] to FPGAs / ASICs, and how to automatically compute the Roofline model starting from a given code and target device. In the classical Roofline model for CPUs, both the peak bandwidth and peak performance depend on the architecture, while the computation intensity is a property of the algorithm. However, when considering FPGAs or ASICs, it is not accurate to provide the peak performance independent of the target computation to be accelerated. In fact, different computations require different resource consumption for their implementation in hardware. Thus, the number of processing elements that can be configured in parallel, and therefore the peak performance, strongly depends on the computation to be performed. For this reason, we propose a method to compute the peak performance that accounts for both the algorithm and the target FPGA or ASIC technology. Furthermore, the computation of the Roofline model is automated by a custom LLVM pass that operates on the IR of the high-level software code.

[0032] Although a fixed architecture (like a CPU) has performance metrics that correlate to the architecture itself (e.g., Giga Floating-point OPerations per second (GFLOPs)), a reconfigurable architecture (like an FPGA) or ASIC relates those performance metrics better to the algorithm being synthesized (since the algorithm itself, once synthesized, defines the target architecture). For example, considering an image processing algorithm, a meaningful performance metric might be the number of images processed per second executed using the hardware implementation. For this reason, users can specify the preferred performance metric in two formats: - Define the set of operations to be measured (e.g. GFLOPs). - At the place in your code where results are generated, insert a custom directive that defines the throughput metric (results / s) like this:

[0033] In practice, the throughput metric is specified by inserting the custom directive _result_generation_() next to the instruction responsible for the computation. As operator (or simply op) we intend a string identifying a single LLVM instruction (add, fmul, ...), whereas for function calls (llvm::CallInst instruction) it is assumed to be the name of the function to be called. Independent of the format of the performance metric, it is necessary to define a subset of operators that is of interest to the user. Thus, we first define a set OP of the operators that make up the code, and name the set of operators of interest to the user SOP ⊆ OP. If the first format is considered, the user directly defines the set SOP of operators he wants to measure. If the second format is considered, the set SOP = {op r}. However, op ris a single operator that identifies the function call _result_generation_() required to specify the throughput. We implement the algorithm by creating a data structure OP whose indices are the elements of a set OP (map). map We define,,where,x,is the execution count of the associated index operator during,the algorithm execution, computed by static code analysis.,We analyze the code with the LLVM framework to fill,the OPmap.,In detail, the analysis starts from the LLVM IR of,kernelfunction,, and goes through each basic block,bb,, which in turn goes through each instruction,i,it contains.

[0034] For each basic block bb ∈ kernel function, the analysis calculates the number of times e bb Since the loop bound is presumably known at compile time, we use Listing 2 to calculate e bb can be calculated.

[0035] unsigned long long computeExecutionTimes(llvm::BasicBlock *bb) { llvm::LoopInfo *LI = &getAnalysis <llvm::loopinfowrapperpass>().getLoopInfo(); llvm::ScalarEvolution *SE = &getAnalysis <llvm::scalarevolutionwrapperpass>().getSE(); unsigned long long executionTimes = 1; llvm::Loop *parentLoop = LI->getLoopFor(bb); while (parentLoop != nullptr) { executionTimes *= SE->getSmallConstantTripCount(parentLoop); parentLoop = parentLoop->getParentLoop(); } return executionTimes; Listing 2: C++ code for the computeExecutionTimes function needed to calculate the number of times a certain basic block bb is executed.

[0036] For each instruction i ∈ bb, the analysis is - the associated operator op (as above) i Calculate - operator op i is already OP map Checks whether the array is an index of some value in - If so, set the indexed value to e bb (where bb is the basic block that contains that instruction), - Otherwise, set the indexed value to e bb Initialize with index op i OP map (where bb is the basic block containing that instruction).

[0037] Similarly, we also count the total number of memory accesses to function arguments that are mapped to (but not limited to) AXI master / slave interfaces, and derive the total number of bytes accessed, tb. The user specifies that a particular argument, arg, of function f is mapped to an AXI master / slave interface by inserting the directive _axi_master_(arg,bundle) into function f. We calculate the number of bytes transferred by considering all llvm::LoadInst and llvm::StoreInst whose base address corresponds to a particular argument that is mapped to an AXI master / slave interface. In particular, we initialize the variable tb to zero, and for each basic block bb∈kernelfunction, the analysis calculates the number of times the basic block is executed, e, taking into account the loop nest in which the basic block resides. bb Since we assume that the loop bound is known at compile time, we can use Listing 2 to calculate e bb For each instruction i ∈ bb, the analysis - Checks if instruction i is an llvm::LoadInst or llvm::StoreInst operation. - If so, check if the base address is the function argument arg1 of function f. - If so, then check whether there is a function call instruction of the form _axi_master_(arg,bundle) in f, without considering the value of the bundle, which is not important here. - If so, the number of bytes tb loaded or stored by instruction i, taking into account the types of the loads and stores i and set the value of tb to tb i Increase the factor by .

[0038] The resulting value of tb represents the total number of bytes transferred to or from off-chip memory during kernel execution. op Once and tb are calculated, the operation strength can be calculated automatically as follows:

number

[0039] Peak performance assessment is calculated by assuming an ideal hardware implementation of the algorithm on the target hardware with no data dependencies between the operations of the algorithm. For each operation (e.g. floating-point addition), we associate a corresponding operator (e.g. a floating-point adder) that is physically implemented on the hardware. We consider the operator to be fully pipelined and run at the target clock frequency f. Thus, at each clock cycle, the operator is able to produce a valid result. Within the profiling library, we collect performance and resource usage assessments of several operators synthesized (offline) at a certain frequency on the target hardware, in particular a given FPGA or ASIC technology. In detail, for each target hardware and frequency, we build an instance of a profiling library associated with some operators appearing in the code, to let the framework load the correct instance of the library according to the target frequency and target hardware considered, providing for each operator the latency (clock cycles required for the operator to complete), timing (maximum combined time required for the slowest stage of the operator to complete) and the amount of resources (like BRAM, DSP, FF, LUT and area) required to implement the operator. Having built the profiling library, we synthesize each single instruction that constitutes the library by an HLS tool (the same one that will be used to finally generate the final design of our method). In particular, we synthesize a=f(op1,op2,...,op n ), we rely on a template function to build a kernel that is further synthesized by the HLS tool to provide the required evaluation.

[0040] This template is the string kernel in Listing 3 that represents a Python function to implement an instance of the kernel function, given the instruction to be synthesized and the input and output types of the instruction itself (other parameters are not important here).

[0041] def writeCppKernel(iType, oType, instruction, projectRootPath, solutionNumber=1): kernel = """ #include "ap_int.h" #include "ap_fixed.h" #define iType ””” + iType + ””” #define oType ””” + oType + ””” oType innerKernel(iType v1, iType v2) { #pragma HLS INLINE off return ””” + instruction + ”””; } void kernel(iType *x, iType *y, oType *z) { #pragma HLS INTERFACE s_axilite port=x #pragma HLS INTERFACE s_axilite port=y #pragma HLS INTERFACE s_axilite port=z #pragma HLS INTERFACE s_axilite port=return *z = innerKernel(*x,*y); """ f = open(projectRootPath + ' / kernel.cpp', 'w') f.write(kernel) f.close() return Listing 3: The writeCppKernel Python function to generate a simple C++ HLS kernel consisting of a single instruction to be profiled.

[0042] Once the kernel is synthesized, the tool reports the required resources, latency and timing of the targeted instructions. Thus, once a profiling library with a target frequency and architecture corresponding to the current configuration is loaded, the tool can start calculating peak performance. Ideally, the implementation with the highest performance on the target hardware will have a corresponding operation count of 0.01. op For each resource type r∈R={BRAM, DSP, FF, LUT, area}, we need to instantiate each operator the same number of times as

number

number

number

number

[0043] The formula considers that each operator can produce a useful result every clock cycle (pipelined operators) and that the operators are never idle (no data dependency). Finally, within the roofline model chart, we empirically consider 80% of P as the peak performance to take into account routing congestion and timing closure issues. Regarding the peak bandwidth limit, we run a set of microbenchmarks against the target FPGA or consider the bandwidth evaluation when targeting an ASIC with a given off-chip memory and memory interconnect. The microbenchmark or evaluation is performed considering different configurations for the communication interface between the accelerator and the off-chip memory. In particular, we consider several combinations of the number of DMA channels used, the bit width of the AXI interface, and the burst length. In this way, we can derive an appropriate peak bandwidth limit according to the configuration of the HLS interface for a given code. Finally, from a given peak bandwidth (bw) for transferring data to and from the memory of the hardware device, the memory transfer performance limit can be calculated as Pm=bw*CI.

[0044] IV. Design space exploration Several hardware design configurations are iteratively explored by evaluating the performance offered by a particular set of optimization directives to select the corresponding next directive configuration using the approach described in Section II. Throughout the iterations, directive configurations are saved in a stack so that if a particular configuration is not feasible due to resource constraints, the corresponding loop that resulted in exceeding the available resources is marked as fully optimized and is not considered for subsequent optimization. The search then backtracks to the previous feasible configuration and continues to explore other optimization opportunities for other loops in the code.

[0045] Each iteration is performed as follows. - Inject optimization directives into the LLVM IR to be analyzed. - Evaluate the performance and resource usage of the current configuration. - Select the optimization directives to apply in the next iteration.

[0046] The selection of the next configuration to investigate is performed by a controller that switches between loop optimization (through loop unrolling, pipelining, and flattening) and local memory optimization (through array partitioning). For loop optimization, at each step, loops with higher latency contained in the function body or loop are recursively visited until the innermost loop l is identified. If loop l is not yet pipelined, it first tries to pipeline it. This selection relies on the fact that pipelining a loop does not increase resource usage as much as unrolling it, thus keeping the configuration feasible and the analysis faster. However, if l is already pipelined, DSE tries to achieve higher performance by unrolling it further. Any subsequent unrolling optimization of loop l is done by selecting the next highest unrolling factor that divides the loop's trip count.

[0047] Every loop optimization is followed by a global memory optimization. Indeed, after pipelined or unrolled loops, performance may now be constrained by the number of available memory ports. In this step, for each array a in the function and for each dimension d of array a, we collect the number k of different offsets used to access dimension d. Then we partition dimension d by a factor k. The choice between cyclic and block partitioning is made by simulating the number of collisions that occur within the partitioning. The partitioning type that minimizes the maximum number of collisions per partition is selected. Note that if either block or cyclic partitioning is applied with a factor k equal to the number of elements in dimension d, a full partitioning is automatically performed. Finally, the search continues with the loop optimization step and ends when there are no more loops to explore, either because they are all fully unrolled or because they are marked as fully optimized.

[0048] V. Experimental Evaluation We evaluate our DSE against HLS optimization directives on the PolyBench test suite

[17] and validate the overall methodology on a case study of N-body physics simulation. The experiments are performed on an Intel Xeon E5-2680 v2 while using Vivado HLS 2018.2 as the baseline for resource and performance evaluation comparison.

[0049] A.PolyBench Test Suite The PolyBench test suite

[17] is a collection of benchmarks that includes several kernels with different loop nests. Through these benchmarks, we compare our results with [2] to evaluate the DSE efficiency and evaluation accuracy of our approach. To reproduce the settings in [2], we target a Xilinx Virtex-7 XC7V2000T-FLG1925 FPGA device running at 100 MHz. Furthermore, the latency and area results from [2] are obtained by running Vivado HLS 2018.2 applying the best optimization directives reported in their study.

[0050] Table I summarizes the results achieved by DSE. [Table 1]

[0051] In particular, we report the execution time of our DSE on different test cases compared to the execution time required to run the same DSE approach but based on Vivado HLS for performance and resource evaluation. The table reports the size of the solution space (possible combinations of optimization directives for a given benchmark) and the number of designs required for our DSE to converge to a final solution. As can be seen, our DSE requires 1 / 8 to 1 / 28 of the time compared to the HLS-based solution while achieving the same final configuration. Moreover, DSE effectively explores a smaller number of interesting optimization configurations from a larger design space.

[0052] Table I also reports the results achieved by [2] in terms of improvements with respect to the baseline unoptimized HLS implementation and the overall reduction in kernel latency. Moreover, the table shows the area utilization (calculated considering the most constraining resources) of both our final design and the design from [2]. Overall, it can be observed that an average latency reduction of 7.53 times compared to the optimal configuration found by [2] is achieved in less than one minute. The main reasons for the improved results come from the additional code transformations applied during the resource and performance evaluation phase as well as the policies adopted by the DSE controller. Since [2] and our DSE do not explore optimizations that lead to exceeding the available resources, our accurate predictions prevent the search from stopping too early and drive the search towards a solution that utilizes 65.83% of the device area on average, which is 2.03 times higher than [2]. On the other hand, by switching between loop optimization and array partitioning optimization, the DSE controller is able to fine-tune the partitioning factor and type according to the array accesses.

[0053] Table II reports the optimal configurations found by our DSE and illustrates how our method identifies consistent array partitions with loop optimization applied. [Table 2]

[0054] Figure 2 describes the DSE process in terms of latency and area utilization for two test cases, Gesummv and Mm. We focus on these test cases because they required the smallest and largest number of DSE iterations to converge, respectively. The first test case (Gesummv) explores the design space with a prediction error of 1.90% in performance and 1.24% in resource utilization, while the second test case (Mm) provides a prediction error of 4.08% in performance and 5.60% in resource utilization. For each graph, the curves obtained by interpolating all designs show how the DSE controller switches between loop pipelining (sharp characteristic) and loop unrolling (linear characteristic), converging to 75.56% and 80% area utilization, respectively.

[0055] BN Simulation Test Case To validate our overall method, we consider a real application from the astrophysics domain: N-body physics simulation. We start the optimization process with a basic memory-bound implementation of the algorithm and our method achieves a final version with performance comparable to

[18] but following an automated approach. For this test case, we target a Xilinx Virtex UltraScale+ VU9P FPGA board on Amazon Web Services (AWS) with a target design frequency of 126 MHz.

[0056] Before starting the optimization process, a throughput metric needs to be specified. This step is performed by inserting a custom directive in the code where the result of interest (in this case, body comparison) is generated. Then, we analyze the plain version of the algorithm by our method and report all steps in Figure 3. The plotted roofline analysis clearly visualizes that the initial design is memory-bound (green dotted line in Figure 3). Indeed, the chart reports an arithmetic intensity of 2.15e-2 pairs / B, which is well below the 1.35 pairs / B of the ridge point. Furthermore, our method estimates a performance of 2.52e+6 pairs / s for the initial implementation (red triangles on the green dotted line in Figure 3). However, for the current arithmetic intensity and available memory bandwidth (14.5GB / s for one DDR port), the roofline model reports an achievable performance of 3.12e+8 pairs / s due to limitations on memory transfers (the accuracy of benchmark-based evaluations of peak bandwidths is extensively discussed in [8]

[11]

[19] ). This means that DSE can only find designs with performance lower than 3.12e+8 pairs / s, which is clearly lower than the estimated peak performance of 1.57e+10 pairs / s that can be reached in the compute-limited area. For this reason, we try to improve the arithmetic intensity to go beyond the ridge point. In particular, we consider caching data in local memory to increase the arithmetic intensity. We rewrite the kernel by adding an initial phase to copy data to local memory before computation and a final phase to copy data to the host after computation.

[0057] Analyzing the cached version of the algorithm confirms that the BRAM resource constraint is satisfied and the arithmetic intensity increases to 6.77e+2 pairs / B (blue dotted line in Figure 3) reaching the area bounded computation. According to the roofline model, we expect to find a design with the newer implementation whose performance is bounded by the peak performance (1.57e+10 pairs / s). By running the automated DSE, we obtain an optimal design with an estimated performance of 1.51e+10 pairs / s (red triangles on the blue dotted line in Figure 3) and an area usage of 75.57%, a solution whose estimated performance is only 3.7% lower than the theoretical limit. Furthermore, the evaluation on the final design reports a latency estimation error of 0.000298%. Finally, we test the resulting design on-board and measure 1.207e+10 pairs / s, which is about 20% lower than both the DSE and Vivado HLS evaluations due to memory transfer overhead. In terms of state-of-the-art implementations, the work in

[18] achieves 1.3441e+10 pairs / s with an adapted implementation, while we provide a solution obtained from an automated search with only an 8.98% loss in performance.

[0058] This disclosure provides a comprehensive methodology for high-level software code optimization to achieve an ASIC hardware implementation or FPGA configuration that meets the target performance requirements. The disclosed approach combines automated DSE for identification of an optimal set of HLS optimization directives with automated generation of roofline model analysis for FPGAs / ASICs, which allows identifying candidate FPGA or ASIC technologies from a given set and quickly identifying whether the application is memory or compute bound. DSE efficiency is evaluated on the PolyBench test suite, which outperforms solutions in the literature and achieves up to 14.36x reduction in kernel latency. Furthermore, the overall methodology is validated against real applications from the astrophysics domain, resulting in a solution with performance comparable to state-of-the-art custom implementations.

[0059] References [1] D.F. Bacon, R.M. Rabbah, S. Shukla et al., "Fpga programming for the masses", Commun. ACM, vol. 56, no. 4, pp. 56 - 63, 2013 [2] J. Zhao, L. Feng, S. Sinha, W. Zhang, Y. Liang, and B. He, "Comba: A comprehensive model - based analysis framework for high level synthesis of real applications", in Proceedings of the 36th International Conference on Computer - Aided Design. IEEE Press, 2017, pp. 430 - 437 [3] G. Zhong, A. Prakash, Y. Liang, T. Mitra, and S. Niar, "Lin - analyzer: a high - level performance analysis tool for fpga - based accelerators", in Proceedings of the 53rd Annual Design Automation Conference. ACM, 2016, p. 136 [4] G. Zhong, V. Venkataramani, Y. Liang, T. Mitra, and S. Niar, "Design space exploration of multiple loops on fpgas using high level synthesis", in 2014 IEEE 32nd International Conference on Computer Design (ICCD), October 2014, pp. 456 - 463 [5] J. Cong, P. Wei, CHYu, and P. Zhang, "Automated accelerator generation and optimization with composable, parallel and pipeline architecture," in 2018 55th ACM / ESDA / IEEE Design Automation Conference (DAC). IEEE, 2018, pp. 1-6. [6] L. Wirbel, “Xilinx sdaccel: a unified development environment for tomorrow's data center”, Technical Report, The Linley Group Inc, Tech. Rep., 2014 [7] S. Williams, A. Waterman, and D. Patterson, "Roofline: An insightful visual performance model for multicore architectures," Commun. ACM, vol. 52, no. 4, pp. 65-76, April 2009. [Online]. Available: http: / / doi.acm.org / 10.1145 / 1498765.1498785 [8] B. da Silva, A. Braeken, E. H. D'Hollander, and A. Touhafi, "Performance modeling for fpgas: Extending the roofline model with high-level synthesis tools," Int. J. Reconfig. Comput., vol. 2013, pp. 7:7–7:7, January 2013. [Online]. Available: http: / / dx.doi.org / 10.1155 / 2013 / 428078 [9] C. Lattner and V. Adve, "Llvm: A compilation framework for lifelong program analysis & transformation", in Proceedings of the international symposium on Code generation and optimization: feedback-directed and runtime optimization. IEEE Computer Society, 2004, pp. 75

[10] J. Oppermann, A. Koch, T. Yu, and O. Sinnen, "Domain-specific optimisation for the high-level synthesis of cellml-based simulation accelerators", in 2015 25th International Conference on Field Programmable Logic and Applications (FPL). IEEE, 2015, pp. 1 - 7

[11] S. Muralidharan, K. O'Brien, and C. Lalanne, "A semi-automated tool flow for roofline anaylsis of opencl kernels on accelerators", in First International Workshop on Heterogeneous High-performance Reconfigurable Computing (H2RC’15), 2015

[12] J. de Fine Licht, K. F. Larsen, T. Hoefler, and S. Ramos, "Modeling and implementing high performance programs on fpga", Master’s thesis, University of Copenhagen, Department of Computer Science, 2016

[13] Xilinx Inc., "Vivado HLS" [Online]. Available: https: / / www.xilinx.com / products / design-tools / vivado / integration / esl-design.html

[14] J.M. Codina, J. Llosa, and A. Gonza’lez, "A comparative study of modulo scheduling techniques", in Proceedings of the 16th international conference on Supercomputing. ACM, 2002, pp. 97 - 106

[15] L. de Souza Rosa, C. Bouganis, and V. Bonato, "Scaling up modulo scheduling for high-level synthesis", IEEE Transactions on Computer Aided Design of Integrated Circuits and Systems, pp. 1 - 1, 2018

[16] J. Cong and Z. Zhang, "An efficient and versatile scheduling algorithm based on sdc formulation", in 2006 43rd ACM / IEEE Design Automation Conference. IEEE, 2006, pp. 433 - 438

[17] L.-N. Pouchet, "Polybench: The polyhedral benchmark suite", URL: http: / / www.cs.ucla.edu / pouchet / software / polybench, 2012

[18] E. Del Sozzo, M. Rabozzi, L. Di Tucci, D. Sciuto, and M. D. Santambrogio, "A scalable fpga design for cloud n-body simulation", in 2018 IEEE 29th International Conference on Application-specific Systems, Architectures and Processors (ASAP). IEEE, 2018, pp. 1-8

[19] L. Di Tucci, K. O'Brien, M. Blott, and M. D. Santambrogio, "Architectural optimizations for high performance and energy efficient smith-waterman implementation on fpgas using opencl", in Design, Automation & Test in Europe Conference & Exhibition (DATE), 2017. IEEE, 2017, pp. 716-721

[20] C. Lattner, "LLVM and Clang: Next Generation Compiler Technology", In The BSD Conference, May 2008< / llvm::scalarevolutionwrapperpass> < / llvm::loopinfowrapperpass>

Claims

1. 1. A computer-implemented method of implementing a hardware device to perform operations defined by high-level software code, comprising: translating said high level software code into corresponding lower level software code for performing the same operations defined by said high level software code, said lower level software code defining low level operations; For each hardware device in a set of hardware devices that can be manufactured or configured to execute the low-level software code, For each low-level operation (op) and for each type of hardware resource (r) of the hardware device, a usage (u op,r ) and For each low-level operation (op) among the low-level operations, a run-time occurrence (o op ) and For each type of said hardware resource (r), a corresponding number of required hardware resources of said type (c r ) to the run-time occurrence count (o op ) and the corresponding usage (u) of said type of hardware resource (r). op,r ) over all said lower order operations; The scale factor (SF) for the hardware device is calculated by multiplying the number of required hardware resources (c r ) and a predetermined amount of available hardware resource in said hardware device of said type of said hardware resource (r); The peak performance value (P) of the hardware device is calculated by multiplying the number of occurrences (o op ) and a rate (f) defining the number of low-level operations per second that can be executed by said hardware device, divided by said scale factor (SF), as the sum over all said low-level operations; and selecting said hardware devices of said set to be manufactured or configured as a function of said respective peak performance values ​​(P) calculated for each hardware device of said set; manufacturing or configuring said hardware device to execute said high level software code; A method comprising:

2. For each hardware device of said set: evaluating a total number of bytes (tb) of data transferred to and from the memory of the hardware device when the low level software code is executed; The arithmetic intensity (CI) of the low-level software code is calculated by the number of occurrences of the low-level operations (o op tb) and the total number of bytes of data transferred to or from said memory as the sum over all said lower order operations; evaluating a maximum bandwidth (bw) for transferring data to and from the memory of the hardware device; Calculating a memory transfer performance value (Pm) of the hardware device as the product of the computational intensity (CI) and the maximum bandwidth (bw); selecting said hardware devices of said set to be manufactured or configured also as a function of said respective memory transfer performance value (Pm) calculated for each hardware device of said set; The method of claim 1 , comprising:

3. said low level software code comprising: translating the high level software code into the low level software code using an LLVM front-end compiler; The number of occurrences at execution time (o op ) and the amount used (u op,r processing said low level software code with an LLVM compiler to evaluate The method of claim 1 or 2, wherein the compound is produced by

4. For each low-level operation (op) among the low-level operations, a resource evaluation algorithm is used to estimate the usage (u op,r The method of claim 1 , further comprising the step of evaluating

5. The method of any one of claims 1 to 4, wherein the types of hardware resources are block RAM, DSP, flip-flops, look-up tables and area.

6. The method of any one of claims 3 to 5 when relying on claim 2, wherein the hardware device is configured on an FPGA or manufactured as an ASIC, and the method includes the step of running a design space exploration algorithm on the low-level software code to identify a suitable FPGA configuration or ASIC based on the peak performance value (P) and memory transfer performance value (Pm) to be met.

7. 7. The method of claim 1, wherein the peak performance value (P) is calculated over a subset of low level operations of the low level software code.

8. 8. The method of claim 3 when dependent on claim 2, wherein the arithmetic intensity (CI) is calculated over a subset of low level operations of the low level software code.

Citation Information

Patent Citations

  • Operation synthesis method, operation synthesis program and operation synthesis device

    JP2016177454A

  • Predictable design of low power systems by pre-implementation estimation and optimization

    WO2005072054A2

  • Design assistance device, design assistance method, and recording medium storing design assistance program

    WO2017135219A1