# US 2017/0286079 A1 · LLVM-Based System C Compiler for Architecture Synthesis

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2017/0286079 A1
- Document ID: US20170286079A1
- Status: Published application
- Kind: A1
- Application number: 15/091,093
- Filed: 2016-04-05
- Published: 2017-10-05
- Earliest claimed: 2016-04-05
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Minsik Cho; Brian R. Konigsburg; Indira Nair; Haoxing Ren; Jeonghee Shin
- Web page: https://patentgrep.com/patent/US20170286079A1

## CPC

- G06F 8/44: {Encoding}
- G06F 8/40: Transformation of program code
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A low level virtual machine (LLVM)-based system C compiler for architecture synthesis is provided. In one aspect, a method for translating a system C model to hardware description language (HDL) is provided. The method includes the steps of: generating a hardware connection model (HCM) from the system C model, wherein the HCM defines modules and interconnects in a hardware system; parsing the system C model into a LLVM intermediate representation (IR); converting the LLVM IR to a system LLVM IR which records correspondence information between the LLVM IR and the HCM; and generating the HDL based on direct mapping of processes from the system LLVM IR and the HCM.

## Claims

### Claim 1

A method for translating a system C model to hardware description language (HDL), comprising:
generating a hardware connection model (HCM) from the system C model, wherein the HCM defines modules and interconnects in a hardware system;
parsing the system C model into a low level virtual machine (LLVM) intermediate representation (IR);
converting the LLVM IR to a system LLVM IR which records correspondence information between the LLVM IR and the HCM; and
generating the HDL based on direct mapping of processes from the system LLVM IR and the HCM.

### Claim 2 (depends on 1)

The method of claim 1, wherein generating the HCM from the system C model comprises:
overwriting the classes in the system C model to create objects for the HCM.

### Claim 3 (depends on 2)

The method of claim 2, wherein the classes comprise one or more of modules, ports, and signals.

### Claim 4 (depends on 2)

The method of claim 2, wherein the classes are overwritten by a wrapper class that creates the objects for the HCM.

### Claim 5 (depends on 1)

The method of claim 1, wherein the system C model is parsed into the LLVM IR using a front end compiler.

### Claim 6 (depends on 1)

The method of claim 1, wherein converting the LLVM IR to the system LLVM IR comprises:
converting system C ports and signals into global pointer variables.

### Claim 7 (depends on 6)

The method of claim 6, further comprising:
replacing read methods in system C with load commands; and
replacing write methods in system C with store commands.

### Claim 8 (depends on 1)

The method of claim 1, wherein converting the LLVM IR to the system LLVM IR comprises:
converting system C datatype variables into LLVM native datatypes.

### Claim 9 (depends on 1)

The method of claim 1, wherein converting the LLVM IR to the system LLVM IR comprises:
converting function calls on system C datatype variables into LLVM native instructions.

### Claim 10 (depends on 1)

The method of claim 1, wherein converting the LLVM IR to the system LLVM IR comprises:
converting system C member functions to custom functions for register transfer level (RTL) compiler generation.

### Claim 11 (depends on 1)

The method of claim 1, wherein generating the HDL comprises:
generating finite state machines (FSMs) mapped to HDL processes.

### Claim 12 (depends on 11)

The method of claim 11, further comprising:
creating FSM functions for each of the processes mapped from the system LLVM IR and the HCM.

### Claim 13 (depends on 11)

The method of claim 11, further comprising:
converting each of the FSMs to HDL procedures.

### Claim 14 (depends on 13)

The method of claim 13, further comprising:
generating HDL code for each of FSM functions that are created.

### Claim 15 (depends on 11)

The method of claim 11, further comprising:
instantiating library elements.

### Claim 16 (depends on 15)

The method of claim 15, further comprising:
mapping one or more modules in the HCM as predefined modules in HDL.

### Claim 17

A computer program product for translating a system C model to HDL, the computer program product comprising a computer readable storage medium having program instructions embodied therewith, the program instructions executable by a computer to cause the computer to:
generate an HCM from the system C model, wherein the HCM defines modules and interconnects in a hardware system;
parse the system C model into a LLVM IR;
convert the LLVM IR to a system LLVM IR which records correspondence information between the LLVM IR and the HCM;
generate the HDL based on direct mapping of processes from the system LLVM IR and the HCM.

### Claim 18 (depends on 17)

The computer program product of claim 17, wherein the program instructions when converting the LLVM IR code to the system LLVM IR further cause the computer to:
convert system C ports and signals into global pointer variables;
convert system C datatype variables into LLVM native datatypes; and
convert system C member functions to custom functions for RTL compiler generation.

### Claim 19 (depends on 17)

The computer program product of claim 17, wherein the program instructions when generating the HDL further cause the computer to:
generate FSMs mapped to HDL processes; and
convert each of the FSMs to HDL procedures.

### Claim 20 (depends on 17)

The computer program product of claim 17, wherein the program instructions when generating the HDL further cause the computer to:
instantiate library elements.
