• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. High-Level Synthesis
  3. Using unmodified C code in HLS tool (CtoS or Stratus)

Stats

  • Locked Locked
  • Replies 0
  • Subscribers 21
  • Views 14961
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Using unmodified C code in HLS tool (CtoS or Stratus)

beevlsi
beevlsi over 10 years ago

Hi,

     I would like to know if is possible to synthesize unmodified C code in CtoS or Stratus.

     Looking at Cadence community and documentation, I found the following statements:

     1 - "The main input language is SystemC, but CtoS also offers the capability to read in C/C++ functions in which you can then choose a built-in TLM lib interface/transactor and CtoS automates the generation of the SystemC wrapper." (by Mark Warren - Forum at Cadence Online Support)

     2 - "The Cadence C-to-Silicon Compiler accepts most built-in and user-defined data types for C, C++, and SystemC... Pointers are fine to use as long as CtoS can determine what they will be pointing to... We have a "Preparing Models for CtoS" Application Note that goes into further details. Please contact your local Sales rep or AE." (by Mark Warren - Forum at Cadence Online Support)

     3 - "CtoS provides a way to use pure C/C++ as input. It is not recommended for complex designs with crucial interface requirements, but it is intended to ease the introduction to SystemC." (Section 5.1.2 in CtoS User Guide)

     Considering the simple array multiplication presented below. Is there a way (documentation or example) to automate HLS flow and use unmodified C code over CtoS/Stratus? Or I should at least make some handcode modifications as illustrated in Section "Example of Design Code Transformation" in Stratus HLS User Guide? ("This section shows the transformation​ of an algorithm written in C to an SC_MODULE that can be synthesized using Stratus HLS.")

     Thanks!

------------------------------------------------------------------------
- Array multiplication
------------------------------------------------------------------------
#include <stdio.h>
#define N 16

void array_mult(int a[N], int b[N], int c[N]){
  int i;
  for (i=0; i<N; i++)
    c[i] = a[i] * b[i];
}

int main(){
  int i, a[N], b[N], c[N];

  for(i=0; i<N; i++){
    a[i] = i;
    b[i] = i;
  }

  array_mult(a, b, c);
  return 0;
}
------------------------------------------------------------------------

  • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information