Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
8 years ago

HELLLP about DPI coding

Try to make a function generator by using DPI sin functions from C, however, error occurred

this is my whole sv code

package math_pkg;

//import dpi task C Name = SV function name

import "DPI-C" pure function real cos (input real rTheta);

import "DPI-C" pure function real sin (input real rTheta);

import "DPI-C" pure function real log (input real rVal);

import "DPI-C" pure function real log10 (input real rVal);

endpackage : math_pkg

Error (10170): Verilog HDL syntax error at math_pkg.sv(3) near text ""DPI-C"; expecting an identifier

what the heck is going on dude ??

5 Replies