This disclosure relates generally to electronic design automation, and more specifically, to electronic design automation using high level synthesis techniques to generate circuit designs that include safety features.
Adding safety features to particular portions of a circuit design can be desirable, for example, to reduce the risk of error or failure when the resultant device is deployed. For example, particular applications using such devices, such as automotive, avionics, aerospace, aeronautical, industrial machinery and military applications, may require or especially benefit from increased safety considerations and protections. Indeed, some applications explicitly require particular safety features. But design flows in which circuit designers directly specify such safety features, measures or protection mechanisms using high level synthesis languages may be undesirable, prone to error, ineffective, insufficient, inefficient or too costly in terms of time or monetary expense.
The systems, devices, methods and processes described in this disclosure each have several innovative aspects, no single one of which is solely responsible for the desirable attributes disclosed herein.
One innovative aspect of the subject matter described in this disclosure can be implemented in tangible computer-readable media storing non-transitory code executable by one or more processors. The code can be configured to, when executed by the one or more processors, cause operations to be performed including accessing an algorithmic description representation of a circuit design. The algorithmic description representation can be specified in a first language and include at least one programming language construct associated with a first safety data type. The operations also can include compiling the algorithmic description representation of the circuit design. In some implementations, the compiling includes identifying the at least one construct, accessing a first safety data type definition associated with the first safety data type, and generating a second representation of the circuit design based on the algorithmic description representation and the first safety data type definition. The second representation can be provided in a second language and include at least one safety feature for a portion of the circuit design associated with the at least one construct.
In some implementations, the algorithmic description representation is a control-flow-based representation. In some implementations, the first language is a high level synthesis (HLS) programming language. For example, the first language can be an OpenCL-compatible programming language. In some implementations, the second representation of the circuit design is a data-flow-based representation. In some such implementations, the second representation of the circuit design is a register-transfer level (RTL) representation. For example, the second language can be a hardware description language (HDL).
In some implementations, the algorithmic description representation includes one or more directives identifying one or more header files, the one or more header files defining one or more safety data types including the first safety data type. In some such implementations, the compiling further includes: identifying the one or more directives, identifying the one or more header files, accessing the one or more header files, retrieving the contents of the one or more header files, and including the contents of the one or more header files in the algorithmic description representation prior to generating the second representation.
In some implementations, the at least one construct includes at least one variable defined using the first safety data type. In some implementations, the at least one construct includes at least one function having a return type defined using the first safety data type. In some implementations, the at least one construct includes at least one function including at least one parameter defined using the first safety data type. In some implementations, the at least one construct includes at least one pragma directive identifying a function as a safety-critical function.
Another innovative aspect of the subject matter described in this disclosure can be implemented in a system including one or more memory devices storing non-transitory processor-executable code configured to implement instructions. The system includes one or more processing devices to execute the processor-executable code to implement the instructions. The instructions are configured to cause operations to be performed including accessing an algorithmic description representation of a circuit design. The algorithmic description representation can be specified in a first language and include at least one programming language construct associated with a first safety data type. The operations can further include compiling the algorithmic description representation of the circuit design. The compiling can include identifying the at least one construct, accessing a first safety data type definition associated with the first safety data type, and generating a second representation of the circuit design based on the algorithmic description representation and the first safety data type definition. The second representation can be provided in a second language and include at least one safety feature for a portion of the circuit design associated with the at least one construct.
In some implementations, the algorithmic description representation is a control-flow-based representation. In some implementations, the second representation of the circuit design is a data-flow-based representation. In some implementations, the algorithmic description representation includes one or more directives identifying one or more header files, the one or more header files defining one or more safety data types including the first safety data type. In some implementations, the compiling further includes identifying the one or more directives, identifying the one or more header files, accessing the one or more header files, retrieving the contents of the one or more header files, and including the contents of the one or more header files in the algorithmic description representation prior to generating the second representation.
In some implementations, the at least one construct includes at least one variable defined using the first safety data type. In some implementations, the at least one construct includes at least one function having a return type defined using the first safety data type. In some implementations, the at least one construct includes at least one function including at least one parameter defined using the first safety data type. In some implementations, the at least one construct includes at least one pragma directive identifying a function as a safety-critical function.
Another innovative aspect of the subject matter described in this disclosure can be implemented in a method including accessing, by a computer system, an algorithmic description representation of a circuit design. The algorithmic description representation can be specified in a first language and include at least one programming language construct associated with a first safety data type. The method also includes compiling, by the computer system, the algorithmic description representation of the circuit design. The compiling can include identifying the at least one construct, accessing a first safety data type definition associated with the first safety data type, and generating a second representation of the circuit design based on the algorithmic description representation and the first safety data type definition. The second representation can be provided in a second language and include at least one safety feature for a portion of the circuit design associated with the at least one construct.
In some implementations, the algorithmic description representation is a control-flow-based representation. In some implementations, the second representation of the circuit design is a data-flow-based representation.
Details of one or more implementations of the subject matter described in this disclosure are set forth in the accompanying drawings and the description below. Other features, aspects, and advantages will apparent to persons having ordinary skill in the art from the description, the drawings and the claims.
These and other aspects are described further below with reference to the drawings. Like reference numbers and designations in the various drawings indicate like elements. Note that the relative dimensions of the elements of the drawings may not be drawn to scale.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the presented implementations. The disclosed implementations may be practiced without some or all of these specific details. While the disclosed implementations will be described in conjunction with the specific implementations described and shown, the disclosed implementations are not limited to the specific implementations. In some instances, well-known process operations have not been described in detail to not unnecessarily obscure the disclosed implementations. Additionally, in some implementations, the disclosed processes may include more or fewer blocks than are described. As another example, some blocks described herein as separate blocks may be combined in some other implementations. Conversely, what may be described herein as a single block may be implemented in multiple blocks in some other implementations. Additionally, the conjunction “or” is intended herein in the inclusive sense where appropriate unless otherwise indicated; for example, the phrase “A, B or C” is intended to include the possibilities of “A,” “B,” “C,” “A and B,” “B and C,” “A and C” and “A, B and C.”
Various implementations relate generally to systems, devices, programs and methods enabling high level synthesis of a design project such as a circuit design. In one aspect, some implementations more specifically relate to a high level synthesis software program (also referred to herein as a “tool”) that enables a programmer, designer, developer or user (all of which may be used interchangeably herein) to specify, construct or otherwise input or provide a circuit design at a high level of abstraction. In some implementations, the high level representation (or “description”) of the circuit design is specified in the form of an algorithmic or behavioral description of the circuit to be implemented. For example, a programmer can specify the high level representation of the circuit design using a high level programming language. The high level synthesis tool is further configured to compile the high level representation of the circuit design to generate an intermediate level representation of the circuit design. In some implementations, the intermediate level representation can then be integrated with other portions of a grander, top-level design at an intermediate level of abstraction. In some implementations, the high level synthesis tool is additionally configured to generate a low level representation of the circuit design based on the intermediate level representation.
In particular implementations, the high level synthesis tool enables a programmer designing a high level representation of a circuit design to specify, declare, mark, flag, identify or otherwise indicate that particular parameters, functions, memory addresses or other programming language constructs are to be given special attention when compiled. In some implementations, a programmer can specify that particular parameters (for example, variables) are special by declaring, instantiating or otherwise defining such parameters using special data types. In some implementations, a programmer also can specify that particular functions are special by declaring such functions using special return types, or by defining such special functions using parameters that are themselves defined using special data types. For example, a programmer can specify that particular parameters or functions are safety-critical parameters or functions with the use of specialized safety versions of data types, referred to hereinafter as “safety data types.” In some implementations, the high level synthesis tool compiles the parameters or functions specified as safety-critical differently than their non-safety-critical counterparts would be compiled. For example, parameters and functions specified as safety-critical can be compiled to include additional safety features, measures or protection mechanisms (collectively referred to hereinafter as “safety features”) in the intermediate level representation, or can otherwise be compiled with special considerations not taken when compiling other portions of the design.
In some implementations, the high level synthesis tool also can compile the intermediate level representation including the safety features into a low level representation including safety logic for implementing the safety features. In some implementations, the low level representation can be compiled to generate configuration settings in the form of programming bits for implementing the circuit design in a programmable logic device (PLD), such as a field-programmable gate array (FPGA). Additionally or alternatively, the low level representation can be compiled or otherwise converted to generate a physical design layout for implementing the circuit design in an application-specific integrated circuit (ASIC) or other fixed logic device.
Adding safety features to particular portions of a circuit design can be desirable, for example, to reduce the risk of error or failure when the resultant device is deployed. For example, particular applications using such devices, such as automotive, avionics, aerospace, aeronautical, industrial machinery and military applications, may require or especially benefit from increased safety considerations and protections. Indeed, some applications explicitly require particular safety features. But design flows in which circuit designers directly specify such safety features, measures or protection mechanisms using high level synthesis languages may be undesirable, prone to error, ineffective, insufficient, inefficient or too costly in terms of time or monetary expense.
In some implementations, the high level synthesis tools disclosed herein (as well as other tools described herein) can be used in the construction of circuit designs particularly suited for implementation in programmable logic (also referred to herein as “configurable” or “reconfigurable” logic). For example, such circuit designs can be programmed into PLDs such as FPGAs or complex PLDs (CPLDs). Additionally or alternatively, the high level synthesis tools disclosed herein (as well as other tools described herein) can be used in the creation of circuit designs particularly suited for implementation in non-configurable “fixed” or “hardwired” logic. For example, such circuit designs can be masked, patterned, deposited, grown or otherwise fixed in a non-configurable form in a semiconductor (for example, silicon) integrated circuit die. Examples of such latter devices include application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), application-specific instruction set processors (ASIPs) or general purpose central processing units (CPUs) among other examples. Additionally or alternatively, the high level synthesis tools disclosed herein (as well as other tools described herein) can be used in the creation of circuit designs suitable for implementation in either configurable logic or non-configurable hardware logic, or a combination of configurable and non-configurable logic.
FPGAs and CPLDs are PLDs designed to be configured for use after the physical device is manufactured. One example of a CPLD is the MAX II CPLD produced by Altera Corporation of San Jose, Calif. Some examples of FPGAs, including partially-reconfigurable FPGAs and System-on-Chip (SoC) FPGAs, include the MAX 10 FPGA, Arria 10 FPGA SoC, Cyclone V FPGA SoC, and Stratix 10 FPGA SoC produced by Altera Corporation. Broadly, FPGAs include programmable logic blocks and reconfigurable interconnects that allow the programmable logic blocks to be interconnected in different configurations.
A typical FPGA logic block 102 includes one or more logic cells, also referred to as logic elements (LEs).
Many FPGAs are based on static random-access memory (SRAM). Typically, 2n SRAM cells and corresponding bits are used to implement an n-input LUT-a LUT that maps “n” inputs or input functions to a single output. Thus, to implement a 4-input LUT, sixteen SRAM programming bits can typically be required. The SRAM cells are often referred to as the configuration RAMs or “CRAMS.” The programming bits used to configure the FPGA are programmed into the CRAMs (for example, on power-up or during partial reconfiguration) to implement the circuit design. In some implementations, each LUT 222 can be implemented as a 2n:1 multiplexer (or “MUX”) where each CRAM provides the input to a corresponding input of the multiplexer. In some such implementations, a 2n:1 multiplexer can be implemented as 2n−1 individual 2:1 multiplexers.
Referring back to
In some implementations, the FPGA also can include fixed, embedded components including, for example, high speed I/O logic, multipliers, memory arrays and digital signal processing (DSP) blocks (constructed on the silicon (Si) die itself). For example, some FPGAs include integrated flash memory arrays to store configuration settings enabling “instant on” functionality. Some FPGAs also are configured as System on Chip (SoC) devices. For example, some FPGA SoCs produced by Altera Corporation include an integrated hard processor system (HPS). For example, the Stratix® 10 FPGA provided by Altera Corporation includes an assortment of embedded components including an HPS, a transceiver, DSP blocks, external memory interfaces, embedded flash memory, embedded DDR3 SDRAM, high speed I/O logic. Other FPGA SoCs also can include additional processing units such as one or more CPLDs, other FPGAs, or fixed processing units for implementing embedded microcontrollers, graphic processing units (GPUs), digital signal processors (DSPs), or one or more hardware accelerators (for parallel processing/computing). For example, some SoCs can include a host processor as well as one or more FPGA accelerators. Such an arrangement is an example of a high-performance reconfigurable computing (HPRC) architecture.
In some instances, the host processor can be a CPU or multi-core microprocessor. The ARM® Cortex®-M1 32-bit reduced instruction set computing (RISC) processor is an example of such a host processor suitable for use in some instances. The ARM processor can be provided as a gate level netlist or as a synthesizable register transfer level (RTL) representation to a chipmaker, which then fixes the design permanently in silicon as a hard core processor. Alternatively, the ARM M1 processor core can be optimized as a soft core processor to be programmed into a hosting FPGA device within the SoC. The Nios II processor (provided by Altera Corporation) is another example of a suitable host processor in some instances. Like the ARM® Cortex®-M1 processor, the Nios II processor is a 32-bit processor designed for embedded applications and particularly for FPGAs.
The initial programming, configuring or configuration of a PLD (such as an FPGA or CPLD), as well as the reprogramming, reconfiguring or reconfiguration of the PLD, can be accomplished using a download cable. The download cable functions similarly to a router in that it receives configuration settings in a programming file from a computer system via a first communication protocol (for example, the USB or Ethernet Protocol), converts (or “transforms” or “translates”) the configuration settings for communication in a second communication protocol (for example, the JTAG protocol), and transmits the configuration settings to the PLD (or a configuration device as described below) via the second communication protocol. For example, the conversion from the first communication protocol to the second communication protocol can include unpackaging the configuration data communicated via the first communication protocol and repackaging the configuration data for communication via the second communication protocol. Some examples of some currently available download cables include the ByteBlaster II download cable, which enables a computer to transfer the configuration data of a programming file to a PLD using a standard parallel printer port of the computer, the USB-Blaster download cable, which enables a computer to transfer the configuration data of a programming file to a PLD using a Universal Serial Bus (USB) port of the computer, or the Ethernet-Blaster download cable, which enables a computer to transfer the configuration data of a programming file to a PLD using an Ethernet network port of the computer (all offered by Altera Corporation).
As described above, many FPGAs are static RAM (SRAM)-based. FPGAs are typically programmed (or “configured”) by loading the configuration settings (in the form of “programming bits”) into the SRAM cells. SRAM-based cells are volatile and thus the SRAM cells are programmed upon every power-up of the FPGA. That is, each time the FPGA is powered on, the programming bits must be retrieved from a memory device and loaded into the FPGA. Logic within the FPGA then programs the configuration settings into the appropriate SRAMs. In some instances, the download cable can couple the computer directly to the PLD. If the download cable is used to directly program the volatile memory (the SRAM cells) of an FPGA, the configuration data only remains programmed in the FPGA while the FPGA remains on (because the configuration data is stored in volatile memory, when the FPGA is powered off, the FPGA is no longer programmed with the configuration data).
In some other instances, an FPGA or other PLD can be programmed using an intermediate configuration device. The configuration device generally includes a memory controller and a non-volatile memory. The memory of the configuration device can include a flash memory array, for example, implemented with NAND or NOR logic gates. The memory controller in the configuration device can be or can include the Parallel Flash Loader (PFL) offered by Altera Corporation. The configuration device can be programmed with configuration settings via a download cable whether or not the configuration device is connected with a PLD or whether or not a connected PLD is powered on. Some examples of such configuration devices include the EPCS, EPCQ, and EPCQ-L configuration devices offered by Altera Corporation. In some instances, the configuration device can be mounted on the same board as the PLD. In such instances, when the PLD is powered on, the controller in the configuration device reads the configuration settings stored in the memory and loads the configuration settings into the PLD.
In some other instances in which the PLD is an FPGA SoC that includes a hardwired or embedded memory controller and an embedded non-volatile memory array (for example, a flash memory array), a configuration device is not necessary. In some such FPGA SoCs, the memory controller can be or can include the Parallel Flash Loader (PFL) produced by Altera Corporation. In such instances, a download cable can be used to transfer the configuration settings to the memory controller of the FPGA SoC, which then stores the configuration settings in the non-volatile memory array. As similarly described above, when the PLD is powered on, the controller reads the configuration settings stored in the non-volatile memory and loads the configuration settings into the PLD.
Many circuit developers have used hardware description languages to design digital logic descriptions and other aspects of digital circuits and systems. Generally, a hardware description language (HDL) is a computer specification language or modeling language that can be used to describe a circuit's operation, its design and organization, and tests to verify its operation by means of simulation. Examples of HDLs include Verilog (standardized in IEEE 1364), VHDL (VHSIC HDL), ABEL (Advanced Boolean Expression Language), and Altera HDL (AHDL) (a proprietary digital HDL from Altera Corporation of San Jose, Calif.). The level of abstraction implemented with HDL is generally characterized as the register-transfer-level (RTL). The RTL design abstraction models a circuit design as a synchronous digital circuit in terms of digital signals between, for example, hardware registers, as well as the logical operations performed on those signals by combinational logic. The use of HDL enables a circuit developer to specify the functionality of a circuit at a relatively high level without requiring the developer to specify a particular electronic technology platform and physical layout. Typically, a developer uses HDL to specify a data flow model of a circuit design with timing information. For example, a developer can specify a design using hard-coded logic such as HDL text-based expressions of the spatial and temporal structure and behavior of the circuit or system.
With the increased use and complexity of digital circuits, many circuit developers have turned to high level synthesis (HLS) (also referred to as C synthesis, electronic system-level (ESL) synthesis, algorithmic synthesis, or behavioral synthesis) tools to generate at least portions of circuit designs. For example, such HLS languages include C (for example, ANSI C versions including C99, C11 or other versions), C++, SystemC, SystemVerilog, Handel-C, LabVIEW FPGA from National Instruments Corp., CoreFire Design Suite from Annapolis Micro Systems, Inc., among others. Additionally, software developers skilled in high level languages such as C, C++ and other C-based languages or frameworks are increasingly developing circuit designs for use in PLDs such as FPGAs and FPGA SoCs. In particular, many developers have turned to the Open Computing Language (OpenCL™) standard framework as the use of heterogeneous system architectures and parallel computing have grown. OpenCL is especially well-suited for designing accelerating algorithms in heterogeneous systems. The OpenCL standard enables the use of a C-based programming language (for example, based on the ANSI C99 version) for developing circuit designs across different technology platforms such as FPGAs, CPLDs, ASICS, ASSPs, ASIPs, general purpose CPUs, GPUs and DSPs, among other examples. The OpenCL framework also includes an application program interface (API) enabling a host processor within an SoC to communicate with one or more hardware accelerators (for example, over a PCI Express® bus), or more generally, for one kernel executing within one accelerator to communicate with another kernel executing within the host processor or within another accelerator without host interaction.
For example, a circuit developer using the HLS tool 400 to complete all or a portion of a circuit design is not necessarily the same user as the developer who wrote the source code for a different portion of the circuit design (although they may be the same person or on the same team). For example, a developer can input and integrate his own circuit design with source code from another developer within the same enterprise, as well as source code from a third party developer or vendor. A user of the HLS tool 400 can input source code developed by another user into the system in which the HLS tool 400 is executing via a number of mechanisms, such as by way of downloading a file containing the source code through a wired or wireless network interface or by copying or transferring the source code file from an external memory device. As another example, the programmer of the source code can write some or all of the source code using a text editor in another computer system and then write other portions of the source code, debug the source code, or compile the source code on the system that includes the HLS tool 400.
The HLIL compiler 404 can be a single compiler or can collectively refer to a set or suite of compilers, one or more of which are configured to compile the high level representation in the form of the source code to an intermediate level representation. In some implementations, the intermediate level representation describes the circuit at the RTL level of abstraction. For example, the HLIL compiler 404 can compile the source code into HDL. In some specific implementations, the HLIL compiler 404 compiles source code specified in an OpenCL-compatible language, SystemC, C, C++, or another C-based programming language into an intermediate level representation specified in Verilog, VHDL or AHDL. For example, the HLIL compiler 404 can include functionality similar to other C-to-HDL (or C-to-RTL) compilers such as the C2H compiler provided in the Nios II Embedded Design Suite (EDS) or the Altera OpenCL SDK compiler (both provided by Altera Corporation).
In some implementations, the HLIL compiler 404 can additionally or alternatively be configured to compile source code specified in a first higher-level C-based language (for example, an OpenCL-compatible language or SystemC) into an intermediate level representation specified in a second lower-level C-based language (for example, C or C++). In some implementations, the HLIL compiler 404 can additionally or alternatively be configured to compile source code specified in a high level language into an intermediate representation specified in other intermediate representation languages or formats. For example, such other intermediate representation languages can include or be based on the LLVM intermediate representation (IR) or “intermediate form” (IF) (developed by the LLVM Developer Group).
The HLS tool 400 advantageously enables circuit developers to program designs for implementation on various technology platforms without having to understand or target particular technology platforms. For example, because intermediate level representations such as HDL or other RTL representations are generally agnostic to technology platforms, higher level synthesis languages that are compiled into such intermediate representations using the HLIL compiler 404 also are agnostic to technology platforms. The HLS tool 400 also advantageously enables circuit developers to program circuit designs without having the understanding of, or skill in using, traditional circuit design languages such as Verilog or VHDL (such as software designers). Additionally, whether or not such circuit developers are capable of, let alone proficient in, designing a circuit using a traditional specification or modeling language such as HDL, the circuit developers may prefer to specify their designs using high level synthesis languages. Such developers may prefer coding in high level synthesis languages for a number of reasons including, for example, to avoid having to understand, incorporate or perform timing analysis. This is because high level synthesis languages such as C-based programming languages generally do not include the notion of time. Rather, C-based programming languages are generally control-flow-based as opposed to HDL languages or other RTL abstraction languages that are generally data-flow-based.
As described above, adding safety features, measures or protection mechanisms to particular portions of a design can be desirable, for example, to reduce the risk of error or failure when the resultant device is deployed. For example, particular applications using such devices, such as automotive, aerospace, aeronautical, industrial or military applications, may require or especially benefit from increased safety features. For example, the RTCA DO-254/Eurocae ED-80 standard provides guidance for design assurance of airborne electronic hardware, and in particular, defines objectives that must be met by avionics equipment manufacturers according to EASA and FAA guidelines. But techniques in which a programmer of the source code directly specifies safety features using a high level synthesis language may be undesirable, prone to error, ineffective, insufficient, inefficient or too costly in terms of time or monetary expense. As an example, when safety features are specified in control-flow-based languages such as C-based programming languages, and subsequently compiled into HDL using traditional compilers, the generated HDL implementations of the safety features can in some instances be sloppy, misrepresented, error prone or inaccurate. In such instances, human intervention is generally desirable or necessary to clean-up or correct the HDL representations of the safety features. Additionally, in such instances involving human intervention, traceability between the safety features as coded in the source code and the safety features as implemented at the logic level or physical level is lost.
In some high level C-based programming languages, the programmer begins the source code by entering one or more directives. For example, the directives can include one or more preprocessor directives such as one or more “include directives.” In C syntax, an include directive can be entered in a command line of the code editor 402 as:
The header files 406 that form the standard library for the HLS tool 400 can include data type definitions, function prototypes, function definitions, macro definitions, global variables, and class definitions. Each one of the header files 406 can be stored with the HLIL compiler 404 in the system, stored at another location within the system in a directory created or selected by default by the HLS tool 400, or stored at another location defined by a programmer. Each data type defined in the header files 406 is a classification that can be associated with various parameters (variables). Each data type can generally determine the possible data values for the variables associated with that data type, the operations that can be done on variables of that data type, the meaning of the data identified by the variables, and how the data associated with the variables of that data type can be stored.
In C-based programming languages, data types are used to declare variables of different types. For example, such data types can include: char (smallest addressable unit), signed char, unsigned char, short, short int, signed short, signed short int, unsigned short, unsigned short int, int, signed, signed int, unsigned, unsigned int, logint, insideint long, long int, signed long, signed long int, unsigned long, unsigned long int, long long, long long int, signed long long, signed long long int, unsigned long long, unsigned long long int, float (referred to as a single-precision floating-point type), double (referred to as double-precision floating-point type), and long double (extended precision floating-point number format), among numerous others. For example, to declare and define a variable “a” of type int, the following code can be entered on a command line in the code editor 402:
A function can be declared using a function prototype. For example, to declare a function named “MyFunction” that returns a result (variable) of type float based on two parameters “a” and “b” (referred to as the arguments of the function), the following code can be entered on a command line in the code editor 402:
As described above, predefined data types for variables can be specified, defined and stored in various ones of the header files 406. Predefined function prototypes and predefined function definitions for particular functions, such as regularly used functions, complex functions, custom functions, or any other desired functions, also can be previously specified, defined and stored in various ones of the header files 406. In this way, a programmer developing a circuit design using the HLS tool 400 need not redefine the data types, function prototypes and function definitions. Instead, the programmer can declare and define variables using the data types already defined in the header files 406, and declare and define new functions that call other functions already defined in the header files 406.
In various implementations, one or more of the header files 406 include definitions for various special data types and/or definitions or prototypes for various special functions. In some specific implementations, one or more of the header files 406 define various safety data types and safety functions. In some implementations, the safety data types include specialized safety versions of other data types, such as typical standard data types. For example, in some implementations, standard data types such as char, short, int, long, float and double can have safety version counterparts safe_char, safe_short, safe_int, safe_long, safe_float and safe_double. In some implementations, the safety data types are defined by the provider, producer or manufacturer (hereinafter “provider”) of the HLS tool 400 in one or more safety-associated ones of the header files 406 included with the HLS tool 400.
In some such implementations, the safety data types are defined in the same language that a downstream circuit designer using the HLS tool 400 codes in (for example, the downstream circuit designer can be an employee of a buyer of the HLS tool 400 or an employee of a customer of the provider of the HLS tool 400). In some implementations, the provider of the HLS tool 400 can specify, define and store safety data types in header files 406 using existing C-based constructs such as “struct tag,” “union tag,” or “typedef.” Additionally or alternatively, the safety data types can be specified or defined via other mechanisms. For example, templates also can be used to specify generic code that can generate safety versions of standard or other complex or custom data types. In implementations in which the HLS tool 400 enables a circuit designer to specify a circuit design in more than one high level language, the HLS tool 400 can include predefined safety data types and safety functions in each of multiple programming languages, whether such safety data types or safety functions are stored in header files 406 or in other suitable files or formats as appropriate. Additionally, because the intermediate level representation output from the HLIL compiler 404 can be agnostic to technology platforms, the same source code can be used to implement circuit designs across multiple technology platforms without adjustments.
The provider of the HLS tool 400 can define, specify, design or otherwise implement one or more safety features corresponding to the safety data types. In some implementations, the source code for the safety data types and safety functions has already been tested and optimized before its inclusion in the header files 406 by the provider of the HLS tool 400. For example, the source code included in the header files 406 for each of the safety data types and safety functions can previously be tested, validated or verified to ensure that it is compiled into an HDL or other intermediate representation that properly implements the corresponding safety features. To ensure that the HDL or other intermediate representation properly implements the corresponding safety features, the intermediate representation can itself also be previously tested, validated or verified to ensure that it is synthesized into a gate level netlist or other lower level representation that properly implements the corresponding safety features. In turn, to ensure that the gate level netlist or other lower level representation properly implements the corresponding safety features, the lower level representation can itself also be previously tested, validated or verified to ensure that it is generated into configuration settings, a physical design layout or generally a physical or low level representation that properly implements the corresponding safety features. In this way, when the HLIL compiler 404 compiles the source code for a later-developed circuit design that includes safety data types and safety functions in the header files 406, the intermediate representation output from the HLIL compiler 404 after compiling should include reliable intermediate level code for implementing the safety features later on in the design flow.
In some implementations, the safety-critical variables and safety-critical functions are compiled together with the remainder of the source code to generate the intermediate level representation. In some other implementations, the HLIL compiler 404 is configured to temporarily ignore or set aside various aspects of the safety data types and safety functions when compiling the source code. In some such implementations, the HLIL compiler 404 is configured to compile the source code as if these safety data types and safety functions were non-safety-critical versions (for example, standard versions) of themselves. In some such implementations, the safety features corresponding to the safety data types and safety functions can be integrated with the other portions of the compiled source code at the intermediate representation level. As an example, after compiling the high level source code of a circuit design that includes safety-critical variables or functions into an intermediate level representation (such as in HDL), the HLIL compiler 404 can integrate previously verified intermediate level code (e.g., HDL) for implementing the safety features into other portions of the compiled HDL circuit design. Furthermore, the HLIL compiler 404 can be configured to compile the source code such that the source code simulation/emulation performance is not affected by the inclusion of the safety data types, safety functions or other safety triggers. In some other implementations, the safety features can be implemented and integrated with the other portions of the compiled source code using other intermediate representation languages or formats. In yet other implementations, the safety features can be implemented and integrated with the other portions of the compiled source code at lower levels of abstraction, such as in a gate-level netlist format.
In some implementations, safety-critical functions constructed by a circuit developer also can be specified using safety data types. For example, a safety version of the function above can be constructed by specifying the return type of the function as a safety data type as shown below:
Additionally or alternatively, a safety-critical function can be marked or otherwise identified in the source code for a circuit design using a special pragma directive (or simply “pragma”). The special pragma is a source code comment that is ignored by standard compilers, but recognized by the HLIL compiler 404 and interpreted as some kind of control. For example, a safety pragma (for example, #safe_function) can be inserted by the programmer ahead of a function call. As another example, a safety pragma can be entered on a command line preceding a definition of a safety-critical function. As described above, the special pragmas would be ignored by standard compilers, but recognized by the HLIL compiler 404 as marking the subsequently identified or defined function as a safety-critical function. Using this approach, the source code for the circuit design can be input to a standard compiler (such as a C-based compiler) without requiring modification of the standard compiler or removal of the safety-critical portions. This enables the designer to program and test various portions of the circuit design on other systems using standard compilers. The high level circuit design can be input to the HLS tool 400 for compiling by the HLIL compiler 404 when the circuit design is ready for the next stage of the design flow, for example, conversion into an intermediate representation level for integration with other components of a grander circuit design or for additional analysis, validation or verification.
As described above, when compiling the source code, the HLIL compiler 404 is able to recognize the safety data types and safety functions defined in the included header files 406 as well as to recognize other safety triggers or identifiers such as special safety pragmas. Based on the recognition of predefined safety data types, safety functions or safety pragmas, the HLIL compiler 404 can integrate various safety features in the intermediate level representation of the circuit design while or after compiling the source code. In some implementations, different safety data types and different safety functions can be associated with different safety features. Which safety features are included with which safety data types and safety functions can be defined in the associated header files 406 or defined in the operational code of the HLIL compiler 404 itself. For example, different safety data types and safety functions can be associated with different levels of safety-criticality or sensitivity, and thus, different safety features. Such safety features can include error detection and error correction techniques such as forward error checking (FEC) mechanisms. Such FEC mechanisms can in turn include, for example, error-correcting code (ECC), the use of parity bits, redundancy, or other techniques for improving the robustness of the design. Such safety features can be used to detect, correct for, or otherwise prevent or reduce the effects of or the number of errors that can result from, for example, improperly managed noise and timing margins, parasitic inductances and capacitances, or inadequately filtered supply signals or data signals.
For example, ECC codes can be included with sensitive safety-critical data. As another example, safety-critical data can be stored in special memory locations such as in embedded memory, and in some instances, in non-volatile memory as opposed to volatile memory. As one specific example, consider an engine throttle position variable specified in the source code using a safety data type. In some implementations, the HLIL compiler 404 generates an intermediate level representation of a safety feature that is synthesizable into logic configured to implement ECC protection. Alternatively, the HLIL compiler 404 can generate an intermediate level representation synthesizable into logic configured to store two copies of the value of the variable (for example, one in on-chip memory and one in off-chip memory), and to compare the two copies of the value when performing an operation or making a decision based on that variable. In some such instances, the value stored in the on-chip memory can be used only when it matches that in the off-chip memory. Alternatively, the HLIL compiler 404 can generate an intermediate level representation synthesizable to create two redundant logic blocks, for example, each performing the same calculation or other duplicative process to obtain the value of the variable. When performing an operation or making a decision based on that variable, the results obtained from each of the redundant logic blocks can be compared and the value of the results only used when the results match.
Advantageously, because the HLIL compiler 404 can be configured to generate such safety features based on the identification of safety data types, safety functions or other triggers or flags indicating safety-critical elements of a circuit design, a designer need not directly design and code such safety features in the source code. In some instances, the designer need only have nominal knowledge of the safety data types, safety functions, safety pragmas or other safety feature triggers or identifiers made available via the HLS tool 400 such that he can declare, define or otherwise mark or identify particular variables or functions as safety-critical elements of the circuit design in the source code. Indeed, the designer need not be proficient in implementing or even understanding the operations of the safety features at the high level synthesis level (the source code level), the intermediate representation level (for example, the HDL/RTL level), or a lower level (for example, the gate level or the physical device level). However, it can generally be desirable for the designer to have some knowledge of what safety features are afforded based on each of the safety data types, safety functions or other safety triggers or flags so that suitable, sufficient and relevant safety features are implemented while in some instances also bearing in mind considerations of complexity, efficiency, power consumption and timing constraints.
In some implementations, the process 500 begins in block 502 with accessing the source code. The process 500 continues in block 504 with preprocessing various directives such as any include directives in the source code. Preprocessing the include directives in block 504 can generally include identifying the one or more include directives, identifying the one or more associated header files, accessing the one or more identified header files, retrieving the contents of the one or more accessed header files, and including the contents of the one or more retrieved header files in the source code in place of the associated include directives. Any macros in the source code also can be expanded in block 504. In some implementations, the process 500 continues in block 506 with preprocessing any special pragma directives in the source code. For example, preprocessing the pragma directives can include marking the subsequently identified or defined functions or function calls in the source code as safety critical.
In block 508, the process 500 continues with converting the source code into the target intermediate level representation form. For example, block 508 can include converting the source code based on the declarations and definitions included in the contents retrieved from the header files. Block 508 also can include converting the source code based on special safety pragmas or other indicators. In some implementations, the conversion in block 508 includes identifying at least one safety-critical variable declared, defined or otherwise identified with a safety data type. The conversion in block 508 also can include accessing a safety data type definition associated with the safety data type. In some implementations, the conversion in block 508 can additionally or alternatively include identifying at least one safety-critical function declared, defined or otherwise identified as safety critical.
In some implementations, the safety-critical variables and safety-critical functions are compiled together with the remainder of the source code in block 508 to generate the intermediate level representation. In some other implementations, the HLIL compiler 404 is configured to temporarily ignore or set aside various aspects of the safety data types and safety functions when compiling the source code. In some such implementations, the HLIL compiler 404 is configured to compile the source code as if these safety data types and safety functions were non-safety-critical versions (for example, standard versions) of themselves. In some such implementations, the process 500 can additionally include a block 510 for integrating the safety features corresponding to the safety data types and safety functions with the other portions of the compiled source code at the intermediate representation level. In some implementations, the resultant intermediate representation generated by the HLIL compiler 404 after converting the source code in block 508, and in some instances also after integrating safety features for safety-critical elements of the circuit design in block 510, is a data-flow-based representation (such as at the RTL level of abstraction). As an example, after compiling the high level source code of a circuit design that includes safety-critical variables or functions into an intermediate level representation (such as in HDL), the HLIL compiler 404 can integrate previously verified intermediate level code (e.g., HDL) for implementing the safety features into other portions of the compiled HDL circuit design. In some other implementations, the safety features can be implemented and integrated with the other portions of the compiled source code using other intermediate representation languages or formats.
In some implementations, the HLS tool 400 is bundled or packaged with one or more other tools as an integrated tool or suite of tools that includes functionality for implementing one, some or all stages of a circuit design development project. For example, the other tools packaged with the HLS tool 400 can include various computer-aided design (CAD) tools and electronic design automation (EDA) tools for completing particular stages of the circuit design development project.
For example, the design tool 600 also can include an HDL editor 602 to input additional HDL expressions or to integrate the HDL representation generated by the HLS tool 400 with various I/O interfaces or other peripherals as well as other circuit designs in the form of HDL representations of IP blocks or entire IP cores. Advantageously, when a circuit design is converted into HDL, it is more easily connected or otherwise integrated with the rest of a top-level design.
The design tool 600 can additionally include an analysis tool 604 to analyze the integrated HDL design, an HDL verification tool 606 to verify the analyzed HDL design, a logic synthesis tool 608 to synthesize the HDL design into a lower level representations such as in the form of a gate level netlist, a netlist verification tool 610 to verify the gate level netlist, a placement and routing tool 612 to perform placement and routing of the synthesized gate level netlist, and in some implementations, a configuration tool 614 to generate configuration settings for a target PLD based on the placement and routing. In some non-PLD implementations, the configuration tool 614 can generate a physical design layout, for example, in the form of a GDSII file, for use by a fabrication facility in fabricating the circuit in a semiconductor die.
However, there is no requirement that any of the tools described herein be bundled into one package. Indeed, in some implementations, the HLS tools disclosed herein can be provided as standalone tools. In such latter implementations, the HLS tool can be stored in and execute within the same or a different computer system than the various other tools. In some implementations in which each of one or more of the functionalities just described are implemented as separate tools within the same system 600, an interface between the tools can be a database file, a log, or simply messages transmitted between the tools.
The process 700 continues in block 706 with synthesizing the HDL-implemented design. For example, the result of the synthesis can be a design implementation in terms of, for example, logic circuits and logic gates. In some instances, the result of the synthesis is a physically-realizable gate level netlist. A netlist generally includes a Boolean-algebra representation of the functions of the design implemented as logic gates or process-specific standard cells. In contrast to an HDL-implemented design representation, which can be used to express structural, behavioral, or RTL architectures that include temporal characteristics, a netlist representation generally expresses only the circuit connectivity between a hierarchy of blocks or logic elements.
In some implementations, the process 700 continues in block 708 with verifying the synthesized design. In some implementations, a place-and-route operation is then performed on the synthesized and verified design in block 710. The place-and-route operation uses knowledge of the target architecture to determine connections between the inputs and outputs of the various logic elements in accordance with the logic and security required to implement the design. The user can then validate the place-and-route results via timing analysis, simulation, and other verification methodologies. In some instances, the user may cause the programming engine to perform a verification operation after the place-and-route operation in addition to, or in lieu of, the verification operation in block 708.
In PLD implementations, the process 700 can continue in block 712 with the performance of a programmable logic configuration operation using the output of the place-and-route operation to generate configuration data for the target PLD. The output of the programmable logic configuration operation is typically a programming file (also referred to herein as a “configuration data file”) that includes the configuration settings in the form of programming bits (also referred to herein as a “configuration data”) for the target PLD. In some implementations, the timing, power, or other requirements of the PLD design can then be verified again, this time using the programming bits. For example, the programming bits can then be programmed into an actual PLD that is then subjected to verification or certification. Again, in some non-PLD implementations, the configuration operation can generate a physical design layout, for example, in the form of a GDSII file, for use by a fabrication facility in fabricating the circuit in a semiconductor die.
The system 800 generally includes at least one processor or processing unit 802 (hereinafter used interchangeably) such as a single core or multicore central processing unit (CPU). The system 800 also includes at least one non-volatile memory device 804, such as a magnetic, optical or solid state hard drive, and at least one volatile memory device 806, such as random access memory (RAM), dynamic RAM (DRAM), or double data rate synchronous DRAM (DDR SDRAM) (including third generation DDR3, fourth generation DDR4 or other generations). The system also includes a display 808 and one or more user input devices 810. The user input devices 810 can include or work in conjunction with the display 808 as a touchscreen interface. Additionally or alternatively, the user input devices 810 can include one or more of a computer mouse, a keyboard, a trackball, a touchpad or other user input device. The system 800 also generally includes one or more ports 812 for connecting the system 800 with external devices. One example of an external device that can be connected with the system 800 is a download cable (described above with reference to
Generally, the non-volatile memory 804 is a computer-readable medium that can store non-transitory processor-executable instructions (also referred to herein as “code”), which when executed by the processor 802, cause various operations to be performed by or in conjunction with the processor 102. For example, the non-volatile memory device 804 typically stores code for implementing an operating system (“OS”) such as, for example, a Linux® kernel-based operating system, a UNIX®- or Unix-like-based operating system, a Microsoft Windows®-based operating system, or another suitable operating system. The non-volatile memory device 804 also can store code for implementing a number of software programs including associated device drivers including the HLS tool 400 described above, and in some instances, one or more of the other tools described with reference to the design tool 600 of
In some implementations, the non-volatile memory 804 also can store a library or database of previously generated logic, functions, circuits or entire intellectual property (IP) blocks, macros or cores. For example, to simplify or accelerate the design process, especially for the production of complex circuit designs, existing libraries of predefined complex functions and circuits that have already been tested and optimized can be stored in the non-volatile memory 804. Such IP cores can be previously created by the designer or by other designers within a business organization and recycled in subsequent designs. IP cores also can be licensed from and otherwise made available by third parties such as various PLD vendors, third-party IP suppliers or developer communities. IP cores can be broadly categorized as “hard” IP cores or “soft” IP cores depending on the manifestation of the design as licensed, provided or otherwise made available to the subsequent designer desiring to include the IP core within his grander design. A soft IP core is typically provided as a synthesizable RTL representation, such as in the form of a hardware description language (HDL) specification. When provided in RTL form, a designer can modify the design at the functional level. Soft IP cores also can be provided as gate level netlists. Gate level netlists are harder to reverse engineer, and thus, provide the soft IP core provider with more protection, but may be harder to integrate with other portions of a design. Both RTL and netlist-level representations can be used to implement both configurable logic or non-configurable hardwired logic.
The volatile memory 806 is a computer-readable medium that can temporarily store data retrieved from the non-volatile memory 804 as well as data input by the programmer, data retrieved from another memory device (such as a portable or pluggable external memory device) or data calculated or otherwise determined by the processor 802 while performing various operations (including blocks in the process 500 and the process 700).
Although many of the components and processes are described above in the singular form for convenience, it will be appreciated by one having ordinary skill in the art that multiple components and repeated processes also can be used to practice the techniques presented in this disclosure. While particular innovative aspects have been particularly shown and described with reference to specific implementations thereof, it will be understood by those having ordinary skill in the art that changes in the form and details of the disclosed implementations may be made without departing from the spirit or scope of the innovative aspects described. For example, innovative aspects of the present disclosure may be employed with a variety of components and should not necessarily be restricted to the ones mentioned above. Additionally, certain steps or blocks in one or more of the processes described above may be omitted, performed multiple times, performed in parallel, and performed in different orders. It is therefore intended that the disclosed implementations be interpreted to include all variations and equivalents that fall within the true spirit and scope of the innovative aspects described.
This is a continuation of U.S. patent application Ser. No. 15/633,461 filed Jun. 26, 2017, entitled “SAFETY FEATURES FOR HIGH LEVEL DESIGN,” which is a continuation of U.S. Pat. No. 9,690,894, filed Nov. 2, 2015, entitled “SAFETY FEATURES FOR HIGH LEVEL DESIGN,” the entirety of both are herein incorporated by reference for all purposes.
Number | Name | Date | Kind |
---|---|---|---|
6625797 | Edwards | Sep 2003 | B1 |
6732354 | Ebeling | May 2004 | B2 |
6851108 | Syme | Feb 2005 | B1 |
6964029 | Poznanovic | Nov 2005 | B2 |
7020716 | Raval | Mar 2006 | B2 |
7299458 | Hammes | Nov 2007 | B2 |
7350165 | Miyachi | Mar 2008 | B2 |
7565631 | Banerjee | Jul 2009 | B1 |
7805690 | Willis | Sep 2010 | B2 |
7840777 | Mykland | Nov 2010 | B2 |
7904194 | Brown | Mar 2011 | B2 |
7912990 | Schlette | Mar 2011 | B2 |
7941239 | Ikegami | May 2011 | B2 |
8091053 | Aoyama | Jan 2012 | B2 |
8234604 | El-Zein | Jul 2012 | B2 |
8315721 | Horn | Nov 2012 | B2 |
8381173 | Yuan | Feb 2013 | B2 |
8433831 | Ost | Apr 2013 | B2 |
8718064 | Beliveau | May 2014 | B2 |
8813013 | Titley | Aug 2014 | B2 |
8959469 | Chen | Feb 2015 | B2 |
9081928 | Van Eijndhoven | Jul 2015 | B2 |
9111060 | Titley | Aug 2015 | B2 |
9195575 | Kaku | Nov 2015 | B2 |
9218443 | Styles | Dec 2015 | B1 |
9329844 | Lattner | May 2016 | B2 |
9652213 | MacCleery | May 2017 | B2 |
9690894 | Titley | Jun 2017 | B1 |
20020133788 | Waters | Sep 2002 | A1 |
20020199173 | Bowen | Dec 2002 | A1 |
20030200538 | Ebeling | Oct 2003 | A1 |
20100229151 | Yuan | Sep 2010 | A1 |
20120144376 | Van Eijndhoven | Jun 2012 | A1 |
20130144589 | Levi | Jun 2013 | A1 |
20130212365 | Chen | Aug 2013 | A1 |
20130332937 | Gaster | Dec 2013 | A1 |
20140325462 | Titley | Oct 2014 | A1 |
20150088286 | Ruth | Mar 2015 | A1 |
Entry |
---|
Lattner, Chris, “Introduction to the LLVM Complier System”, llvm.org Architect, ACAT '08, Nov. 4, 2008, 55 pages. |
Altera SDK for OpenCL, Best Pratices Guide, 80 pages. |
Altera SDK for OpenCL, Programming Guide, 114 pages. |
Clubb, Stuart, Catapult C® Synthesis, High Level Synthesis Webinar, Mentor Graphics, Apr. 2009, 12 pages. |
Los Alamos National Laboratory, “Float Compiler Reference Manual”, 8 pages. |
Khronos Group, “The OpenCL Specification”, Khronos OpenCL Working Group, Version 1, revised Oct. 6, 2009, 308 pages. |
Ferrandi et al., Politecnico di Milano, “Generating gates from C: a test with PPSi,”, Oct. 6-7, 2014, 22 pages. |
Pilato, et al., “Bambu: A Free Framework for the High-Level Synthesis of Complex Applications”, 1 page. |
Altera SDK for OpenCL Version 15.1 Release Notes, Nov. 2, 2015, 11 pages. |
Rotem, Nadav, “C-to-Verilog.com: High-Level Synthesis Using LLVM”, University of Haifa, 35 pages. |
Altera, Nios®II, Nios II C2H Compiler, User Guide, Version 9.1, Nov. 2009, 138 pages. |
Number | Date | Country | |
---|---|---|---|
20180218094 A1 | Aug 2018 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 15633461 | Jun 2017 | US |
Child | 15940881 | US | |
Parent | 14930407 | Nov 2015 | US |
Child | 15633461 | US |