Microprocessor cores are components of microprocessor units that may read and execute program instructions to perform specific tasks. Conversion of C or C++ to RTL (Register Transfer Level description) may be desirable to integrate systems. Configurability may add value to the microprocessor core by allowing a user to choose the best performance/area trade-offs that meet the requirements of the typical applications to run.
As can be seen, there is a need for a method and apparatus fur the automatic generation of RTL from C or C++.
In one aspect of the invention, a system for configuring a register transfer level description comprises a configurable microprocessor core; a compiler stored on a development computer system intended to compile an input program expressed on an input high-level programming language; a register transfer level description template processor stored on the development computer system and configured to translate the programming language into the register transfer level description using a plurality of register transfer level templates; and a hardware description language synthesizer stored on the development computer system, wherein the system is generated from a human written template with multiple parameters that are configured semi-automatically or with user control, wherein the system is configured to receive a programming language and output a register transfer level description, wherein the system utilizes data sets with performance statistics, wherein the system utilizes template files that include the register transfer level templates, and wherein the system utilizes timing and area constraints.
In another aspect of the invention, A system for configuring a register transfer level description comprises a one-time configurable, non-reprogrammable microprocessor core; a compiler stored on a development computer system and configured to compile an input program on expressed on a high-level input programming language; a register transfer level description template processor stored on the development computer system and configured to translate the programming language into the register transfer level description using a plurality of register transfer level templates; and a hardware description language synthesizer stored on the development computer system, wherein the register transfer description is generated from a human written template with multiple parameters that are configured semi-automatically or with user control, wherein the system is configured to receive a programming language and output a register transfer level description, wherein the system utilizes data sets with performance statistics, wherein the system utilizes user constraints, wherein the system utilizes template files that include the register transfer level templates, wherein the system utilizes timing and area constraints, and wherein the following are “definition time” configurable: presence or absence of an interrupt controller on the microprocessor core; whether the microprocessor core has a big-endian or little-endian configuration; width of a data path in the microprocessor core; whether a plurality of restricted predication instructions are included in a plurality of slots of the microprocessor core; whether the microprocessor core has a top down and application driven configuration; whether binary translation post processing into an instruction set architecture from a different processor instruction set architecture is performed; whether the compiler automatically detects a combination of instructions; whether a human-written template description written in hardware description language may be utilized for description of the microprocessor core; whether user defined extension instructions are provided in different languages as different views of the extension instructions, and are provided as an interface to other instructions; whether instruction encoding for one of the slots in the microprocessor core includes a set of supported instructions and a number of registers supported for the one of the slots; whether a plurality of vector processing units is included; whether a plurality of floating point units with configurable precision is included and whether data is statistically spread across multiple banks of memory in the microprocessor core.
In a further aspect of the invention, a system for configuring register transfer values comprises a value constraint block, including a value limiter configured to determine the relevance of register transfer values on a bus; a decoder configured to decompose one of the register transfer values on the bus into a vector; and a value stopper configured to allow only relevant ones of the register transfer values on the bus to proceed; and an encoder configured to re-encode the register transfer values on the bus using the relevant register transfer values on the bus.
These and other features, aspects and advantages of the present invention will become better understood with reference to the following drawings, description and claims.
The following detailed description is of the best currently contemplated modes of carrying out exemplary embodiments of the invention. The description is not to be taken in a limiting sense, but is made merely for the purpose of illustrating the general principles of the invention, since the scope of the invention is best defined by the appended claims.
Broadly, an embodiment of the present invention generally provides a framework for the conversion of C or C++ to RTL.
The invention may allow entry of C/C++ code for the generation of RTL. Multiple parameters may be entered into a configurable microprocessor core, hereinafter referred to as an EScala-CtoRTL core. The configurable microprocessor core may also be referred to as Escala, but for the purposes of this application, will be referred to as an EScala-CtoRTL core. Constraint blocks may also be added to increase efficiency of RTL generation.
Referring to
A Bus Multiplexer (BUSMUX) and register bypass with flow control 120 may feature register-bypass/forwarding across slots. EScala-CtoRTL generated processor instances may be fully pipelined and may feature register-bypass/forwarding across slots. This feature may allow an instruction in a cycle n to use the results produced in a cycle n-1 even though those results are not yet written back into the register file. An instruction in cycle n may need to consume data from an instruction in cycle n-1 and may be forced to be in a different slot due to slot specialization. The register bypass across slots may avoid unnecessary delays in the processing chain. The number of registers in a register file/set may be configurable and may be virtually limitless. Solutions may range from very few registers to hundreds of them to avoid excessive memory accesses during performance intensive loops.
EScala-CtoRTL cores are statically scheduled microprocessors, such that the compiler decides at compilation time which slots execute which instructions, with a plurality of slots, the number of slots being fully configurable. Each slot may comprise an independent data-path including its own instruction decoding and execution units (e.g., Arithmetic Logic Units or ALU's) independent of the other slots. One of the slots may be specialized for jump instructions and thus only one (common) copy of the program counter may be kept for the whole processor. EScala-CtoRTL may include Harvard architecture processors, where instruction and data space are separate. This may allow for increased execution throughput on cache-less systems.
The program memory 110 also may share data with a decoder associated with a plurality of “Slots” (datapaths configurated for a microprocessor core), from Slot 0 123 to Slot N-1. Each slot, such as slot 1 123, may comprise, in addition to a decoder 150, a custom arithmetic logic unit (ALU) 155 and a load/store unit 160. EScala-CtoRTL may include a configurable number of load/store units ranging from 1 to the number of slots instantiated on a given configuration/instantiation of a microprocessor core. Local memory to the microprocessor may be banked in such a way that the number of banks is decoupled from the number of load/store units. An application may use a number of banks at least equal or greater than the number of load/store units to get a performance advantage.
A data memory controller 145 may output the data to a bus or, for example, a computer monitor. A configurable general purpose register(s) bank 135 may communicate with both the PC 115 and all slots from slot 0 123 through slot N-1 129. The mapping of data into banks may be performed in several ways. Under detailed user control, in which the user may specify which program ‘section’ a data-structure belongs to by inserting appropriate ‘pragma’ or compiler directive information in the source code or alternatively in a plurality of separate control files. Subsequent steps during program linking may map those sections into specific memory banks according the user inputs. Alternatively data may be statistically spread, either automatically or by a user, across multiple banks of memory (e.g., every bit word may be assigned to a bank in sequentially increasing order, wrapping around to the bank once the highest bank is reached). This may be effective when the user has little knowledge on which data structures are used simultaneously during the program.
Each slot from slot 0 123 through slot N-1 129 may interact with a configurable memory-mapped input/output (MMI 0) unit 165,192. Slot 0 121 may include a general purpose arithmetic logic unit 130, and may interact with a data memory controller 145 through a load/store unit 140. EScala-CtoRTL may support high bandwidth (BW) paths to other peripheral or to other EScala-CtoRTL instantiations. These paths may be separate from load/store paths to memory. Communication through these channels may follow a simple first-in first- out (FIFO) like interface and allows the program being executed to be automatically flow-controlled (data-flow architecture) if the requested data is not available or the produced data has not been consumed by a downstream device. This may allow EScala-CtoRTL to generate processor instances to follow a simple programming model where there is no need for the controlling software to check levels of data available/consumed. This may allow the efficient implementation of multi-core microprocessor subsystems with sophisticated high-performance inter core connectivity patterns.
EScala-CtoRTL may allow a microprocessor core to be configured by a user or by an application program. Examples of configurable items in the microprocessor core may be memory, decoder units, arithmetic logic units, register banks, storage units, register bypass units, number of timers, and user interfaces. The storage units may have load and/or store capabilities.
EScala-CtoRTL may be configured in other features as well:
The configuration choices described above provide the user with the capability of trading off area/performance/power as it best fits the application(s) at hand providing a wide range of EScala-CtoRTL options.
Additionally a set of EScala-CtoRTL generated files intended for software consumption (software development kit or SDK) for a given configuration may include a set of C++ classes or C API to handle vectors in a unified fashion so that depending on the HW implementation it takes advantage of extra vector processing unit operations or processes data without hardware vector processing unit support. Similarly it contains configuration/option information to inform the compiler on whether some specific operations need to be emulated or have native hardware support. This may allow EScala-CtoRTL configuration exploration graphical user interface (GUI) to generate configurations with a wide range of performance area power trade-offs without requiring the user to modify its source code in most cases.
An EScala-CtoRTL hardware description may be generated from a hand-written template-based description. This approach may be more reliable and efficient than full dynamic code generation. The template description may be personalized with EScala-CtoRTL generated parameter files to produce a complete and self contained hardware description language (HDL) description of the microprocessor. Microprocessor core generation may be based on a semi-automated configuration (including tool driven configuration and user provided inputs) of a parametric, human-written templates of HDL code for the hardware description of the microprocessor core.
Referring to
Configuration of software 500 may also be performed using a preprocessor, before feeding code into an EScala-CtoRTL cross-compiler 514 such as gcc/g++. Header files /libraries/Instrinsics may be fed into the cross compiler 514. A binary ELF file 516 may result that can be used to generate program memory ROM contents. EScala-CtoRTL software flow also allow the cross-compiler to be a non-native EScala-CtoRTL cross-compiler by performing binary translation post processing into EScala-CtoRTL instruction set architecture (ISA) from a different processor instruction set architecture.
An optimizer/instruction scheduler 518 such as EScala-CtoRTL compiler may be fed a processor configuration 524, and the instruction scheduler 518 may be used to feed instructions into program memory 520, after which a register transfer level (RTL) simulation may be performed. Instruction/register traces and console output/MMI 0 traces may be output to a console 532 for comparison with the traces generated by instruction set simulations and native host simulations.
Instructions may also be fed to an instruction set simulator (ISS) 526, from which instruction/register traces and console/output MMI 0 traces 530 may be output to a console. Configuration files may be frozen when RTL files for hardware generation are integrated into a silicon design. The customized program along with the configuration files may be fed to the instruction set simulator 526 to make sure that functionality matches what is expected (captured by traces on native host simulations), to evaluate cycle count/performance and to ensure that the RTL files generated are also functioning and performing correctly.
A base Instruction Set Architecture (ISA) may be reduced if specific portions of the ISA are not used under automated analysis of the application to achieve area efficiencies typical of RTL fixed function implementations. This is performed at a very low level of granularity for fixed function devices where the functionality or program to be executed by the microprocessor core is fixed.
The base ISA may be expanded in various ways: The user may provide a set of “user defined extension instructions”. These user defined extension instructions may become part of the microprocessor core by providing a standard interface to any number of such a user defined extension instructions. The presence of the extension instructions may be controlled on a per-slot basis. The presence of the extension instructions may increase a number of input/output operands by “ganging” or combining slots in the microprocessor core. The user may provide several views of the extension instruction (functional C/C++ for simulation, RTL for generation) which may be automatically checked for equivalence. This approach provides full flexibility to the user. Alternatively the descriptions may be derived from a common representation (for example but not limited to the RTL version of it, where the simulation view is automatically generated from it with standard simulation flows). Additionally, EScala-CtoRTL framework may automatically detect new instructions that may benefit an overall cost function (typically a function including program performance and overall area/power cost) by combining several instructions that repeat in sequence in performance of critical portions of the program. The application statistics taken by EScala-CtoRTL may allow the toolset to decide which instructions are more interesting to be generated. This ‘combo’ instruction derivation may be automatically performed by a compiler and may be performance-driven but may also be area driven (to economize in register utilization) under user control.
Extension instructions may be instantiated in the program or discovered by the EScala-CtoRTL frame work in the following ways: Instantiation may happen in the way of ‘instrinsics’ or function calls that directly represent low level extension instructions. Additionally, an EScala-CtoRTL framework tool chain may automatically discover graph patterns that match these instructions in the low level representations of the program. Furthermore, C++ operator overloading may be used to map into the extension instructions during program compilation.
Extension instructions may be combined to allow for extra input/output operands. For example, an extension instruction may be defined as occupying two slots. This allows the extension instruction hardware to write to two destination registers and source two times the amount of input operands (or alternatively the same number of input operands two times as wide) without any extra added complexity to the rest of the microprocessor Hardware. The number of slots need not be limited to two. In general, an extension instruction utilizing N slots may receive 2×N operands and generate N outputs, or receive 2 operands N times as wide as the original ones and produce one result N times as wide as the originals or combinations in between.
The instruction encoding may be parameterized and configured automatically to be the most efficient fit for the final ISA selected (base ISA with possible reductions plus possible extensions). The instruction encoding may also be customized per slot to allow for efficient slot specialization. For example if a slot performs only loads or no-operations (NOPs), a single bit may be sufficient to encode its op-code. Instruction encoding may include setting the number of supported instructions for a slot on the microprocessor core, and the number of registers supported or accessible for the slot.
EScala-CtoRTL instructions may have more than two source operands for specific instructions by adding additional ports to the entirety or part of the register file. The source code 502 may be generated by the user in a text editor or by other means and may be debugged with the debugger 508 in a host environment with convenient operating system support. Once the application behaves as desired on a host platform, its input/output traces may be captured in files and declared acceptable for subsequent steps. The same source code 502 may have now pragmas intended for EScala-CtoRTL flow that may be processed by the preprocessor 512. Information on the source/pragmas may be gathered or and the code at source level may be transformed before being fed into the cross compiler 514 for a given microprocessor.
The cross compiler 514 may be optionally customized for the EScala-CtoRTL framework to facilitate additional steps. The binary output may then be processed by the EScala-CtoRTL framework postprocessor/optimizer software to generate the final program for a given microprocessor configuration. During initial phases of this process, the configuration files may be automatically generated by the optimizer software. This auto-generation of configuration files may be performance/area/power driven based on application run statistics and automated analysis of user provided application instances. Post-processing may allow the user to choose from a variety of compiler vendors and versions as long as the produced ISA is compatible with EScala-CtoRTL ‘s software flow inputs. EScala-CtoRTL may utilize an OpenRISC input base ISA but the invention is not limited to OpenRISC as an input. By providing a high level of fine-grained configurability, EScala-CtoRTL may enable fast time to market for the development of complex blocks. The high level of configurability may allow selecting sufficient resources to achieve the right performance and at the same time removing from the solution the resources that are not required. This may allow efficient (in terms of area and power) implementation of complex blocks in short time spans. C to RTL conversion may be implemented as a fine-grained particularization of the microprocessor core expressed as a human written template with many parameters that may be configured semi-automatically or with user control. The conversion may be implemented in hardware description language.
Fine-grained configurability may be intrinsically more complex than coarse grained configurability. EScala-CtoRTL flow may address this issue by allowing automated configuration of many of the relevant parameters, leaving to the user the option to configure parameters as well. EScala-CtoRTL may require the user to provide a lower number of input parameters to drive the configuration to the desired performance/power/area design point. The EScala-CtoRTL automated configuration flow may be based on an automated analysis of an application or applications of interest and performance statistics/traces taken over runs on a plurality of data sets.
Additionally, a post-processing approach for the software flow may have the following benefits:
The present invention therefore provides for automating the customization of a highly configurable microprocessor. Further, the present invention allows for high performing programmable solutions and simple software tool-chain management.
EScala-CtoRTL may be used as a micro-processor generator in a C-to-RTL framework to produce RTL (Register Transfer Level description) out of C/C++ sequential untimed descriptions.
EScala-CtoRTL flow is a variation of this flow in which the final configuration produced by EScala-CtoRTL is deprived of its re-programmability with the intent to gain higher efficiency in area and power. This produces code that may be single function and may produce a result that is equivalent to hand-written fixed-function RTL.
With a constantly increasing level of integration in IC (Integrated Circuit)/SoC (System on a chip) devices, parameters like time to market and cost of verification are becoming more relevant than silicon area for many product families.
The present invention may allow unconstrained C/C++ code to be the input for the automated generation of RTL. A C/C++ description may be simpler, more reliable and easier to verify than a corresponding one in RTL. Given that EScala-CtoRTL flow is based on EScala-CtoRTL micro-processor generator flow, it may feature a high degree of flexibility when it comes to the support of high level programming languages like C/C++ and thus there may be no artificial constraints on what type of constructs are supported on the input source code such as complex data structures, recursivity, and dynamic memory allocation.
EScala-CtoRTL may achieve efficiency in the following ways:
Aspects of the top-level architecture relevant to this invention may be:
The functionality of a value constraint block may be defined by the following pseudo-code:
where ‘constant’ may be, for example, 0 but any other N-bit value may be sufficient.
The functionality of the value constraint block may be as follows: if the input takes an allowed value, the input may pass through unchanged to the output. If the input does not have an allowed value, a constant may be produced on the output
The result of this may be that functionality-wise nothing has changed, as X==1 and X==3 may be the only values ever expected, but from an area point of view a logic synthesizer may have enough information to ascertain the X==0 and X==2 are impossible values and it may remove any downstream logic that was instantiated for those combinations. This may allow the HDL to remain the same while allowing the synthesizer to remove unnecessary logic.
In practice ValueConstraint blocks may be populated with assertions to ensure during simulation that the values that are never expected for X actually never show-up during dynamic simulations so there is no risk of having a mismatch between logic synthesis and logic simulation, but this is not strictly required.
The EScala CtoRTL framework may make extensive use of this block/construct as follows: if a portion of the logic can take only a set of specific inputs based on a static analysis of the program targeted for the fixed function hardware, adding a ValueContraint block prior to it will ensure that the HDL-to-gates synthesizer 618 takes advantage to the limited input set to the function being synthesized, thus materializing the area savings associated to that limited input. Multiple ValueConstraint blocks may be paired together.
It should be understood, of course, that the foregoing relates to exemplary embodiments of the invention and that modifications may be made without departing from the spirit and scope of the invention as set forth in the following claims.
This Application claims the benefit of Provisional Application Ser. No. 61/645,340, filed May 10, 2012 and Non-Provisional application Ser. No. 13/872,414, filed Apr. 29, 2013 which claimed the benefit of Provisional Patent Application No. 61/639,282 filed Apr. 27, 2013.
Number | Date | Country | |
---|---|---|---|
61645340 | May 2012 | US | |
61639282 | Apr 2012 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 13872414 | Apr 2013 | US |
Child | 13891909 | US |