cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
aravindtntitech
Visitor
Visitor
8,720 Views
Registered: ‎05-12-2016

C-simulation fails after 'top' function for synthesis is defined

HI,

 

I am new to HLS and C++. My aim is to synthesize an encoder function.

In order to verify the functionality of the C++ code, I have written a testbench in C++. When the "top function" for synthesis is NOT added in the "project settings", the C-simulation runs fine. But once I define the "top function", the C-simulation fails to run. Please find the error message below.

 

@I [HLS-10] Opening project 'C:/Users/.../.../RSencode_v1p0'.
@I [HLS-10] Opening solution 'C:/Users/.../.../RSencode_v1p0/solution1'.
@I [SYN-201] Setting up clock 'default' with a period of 10ns.
@W [HLS-40] This current release of Vivado HLS is the last one supporting the following device families including any of their associated derivatives: Virtex-6, Virtex-5, Virtex-4, Spartan-6 and Spartan-3. These families will still be supported in the future but will require this current version of Vivado HLS or a previous one.
@I [HLS-10] Setting target device to 'xq6vsx475trf1156-1'
@E [SIM-1] CSim failed with errors.
4
    while executing
"source C:/Users/.../.../RSencode_v1p0/solution1/csim.tcl"
    invoked from within
"hls::main C:/Users/.../.../RSencode_v1p0/solution1/csim.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel 1 hls::main {*}$args"
    (procedure "hls_proc" line 5)
    invoked from within
"hls_proc $argv"

 

Part of the testbench code that I am using is given below:

 

// ENCODE //
num_parity = RS_N - RS_K;
 fpParityDmp=fopen("C:/Users/.../.../RSEncode2p1/log/ParityDmp.dat","w");
 if(fpParityDmp == NULL) {
  printf("Parity Dump Failed !!");
 }
 else {
  rsinst.encodeCcsds(INarray, OUTarray);
  fprintf(fpParityDmp, "Dumping Parity \n--------------------------------------------\n");
  for (j=0; j<num_parity; j++){
   fprintf(fpParityDmp, "Par Bit #%d: %d\n", j, *(OUTarray+j));
   printf("Parity: %d\n", *(OUTarray+j));
//   printf("\n Parity: %d", OUTarray[j]);
  }
 }
 fclose(fpParityDmp);
//  OUTarray[i] = outTEST;
//  printf("PARITY: %d", OUTarray[i]);
// }
 return retval;
 
The function it calls is in the follwing form:
 
uint8 ReedSolomon::encodeCcsds(uint8* data, uint8* parity) {
....
}
 
unfortunately I can not share any more of the function here.
 
Once again I would like to stress the fact that the simulation runs fine when "top function" for synthesis is NOT defined. I read some of the discussions here and it seems that errors similar to the one above occurs when there are segmentation faults or some other errors in the source code. But if there is something wrong with the source code, how come the simulation is running fine when the "top funciton" is not defined.
 
I am not very sure what I am doing wrong. Any help would be greatly appreciated,
 
Thanks in advance.
 
Aravind
 
0 Kudos
3 Replies
u4223374
Advisor
Advisor
8,679 Views
Registered: ‎04-26-2015

Could you give it a shot in an earlier version of HLS? It looks like the warning provided by HLS is incorrect; the release notes for 2016.1 indicate that this version no longer supports ISE-specific devices. That would include the Virtex-6.

 

0 Kudos
aravindtntitech
Visitor
Visitor
8,492 Views
Registered: ‎05-12-2016

Hi  ,

 

Thank you for the reply, sorry I couldn't reply sooner but I have access to the software only twice in a week.

I tried running in 2015.4 as you instructed. The warning message disappears if I choose a different target device. But the error message still remains.

 

Is there something that I am doing wrong?

 

Best Regars,

0 Kudos
aravindtntitech
Visitor
Visitor
7,983 Views
Registered: ‎05-12-2016

I found the problem, the issue was with the function declaration

 

uint8 ReedSolomon::encodeCcsds(uint8* data, uint8* parity) {
....
}

Vivado HLS users guide clearly states that member functions of a class can not be synthesized. After I instantiated the function outside the class as described in the users manual the error disappeared.

It is a bit surprising that the member functions of classes manages to show up in the Top Function selection window. 

 

 

 

hlstop1.PNG

 

Anyway the problem is solved now.

 

Thank you for your help.

 

Arvind

0 Kudos