cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Participant
Participant
380 Views
Registered: ‎02-20-2020

ERROR: [HLS 214-194] in function 'main': Undefined function strncmp

I am trying to convert a C program into verilog through VITIS HLS software. I am not able to include the Linux functions such as strncmp (string compare). Can you please guide me how to solve this problem? There are other functions as well such as creating a socket and binding it etc. I am looking for a way to synthesize my code.

 

 

Thank you.

0 Kudos
4 Replies
Highlighted
Contributor
Contributor
357 Views
Registered: ‎07-22-2020

This article should help with the conversion:

https://www.chipverify.com/systemverilog/systemverilog-strings

Looks like here in verilog strncmp becomes str.icompare(s)

0 Kudos
Highlighted
Advisor
Advisor
344 Views
Registered: ‎04-26-2015

@sunndesai3333 The short answer is that to get access to all the Linux functions in HLS, first you need to implement Linux in HLS. This is a big project.

 

strncmp alone is not too challenging, anyone can write a string compare function. But to use something like sockets, first you have to explain to HLS what a socket is and how it works. This may or may not even be possible, since HLS has a number of limitations on what it can support (in particular, it doesn't do explicit multithreading and dynamic memory allocation).

 

I would strongly suggest moving this back to a processor, either the Zynq PS or a MicroBlaze core (both will run Linux). Then pick out the specific parts that are burning a lot of processor time, and figure out how to move those to the FPGA.

Highlighted
Participant
Participant
289 Views
Registered: ‎02-20-2020

Thank you for the reply.

I will try to do that.

0 Kudos
Highlighted
Participant
Participant
286 Views
Registered: ‎02-20-2020

@u4223374 Can you help me in solving pointer to pointer is not supported error for the following example?

void mod2dense_clear
( mod2dense *r
)
{
int k, j;

for (j = 0; j<mod2dense_cols(r); j++)
{ for (k = 0; k<r->n_words; k++)
{ r->col[j][k] = 0;
}
}

}

and I am calling this function in the main file as

int main()

{

mod2dense *m1;

mod2dense_clear(m1);

}

Thank you.

0 Kudos