- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 ??Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
DPI is for simulation, not for synthesis.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- DPI is for simulation, not for synthesis. --- Quote End --- Thank you for replying I wonder why this is synthesis not simulation Is there a way that I can use sine functions for synthesis in fpga? then how to create a function generator with C languages ? thankyou!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- https://pdfs.semanticscholar.org/f523/c638e72ce7a9b068470510ba54d23bf715fb.pdf --- Quote End --- Thank you so much! this helps me a lot! , :) Can I also ask a question the input/output declaration for a module? for example module slc3( input logic [15:0] S, input logic Clk, Reset, Run, Continue, output logic [11:0] LED, output logic [6:0] HEX0, HEX1, HEX2, HEX3, output logic CE, UB, LB, OE, WE, output logic [19:0] ADDR, inout wire [15:0] Data //tristate buffers need to be of type wire ); i see that all the input output are calculated in a binary form,
However , the input from the article suggestests a fraction number(like 0.45) https://alteraforum.com/forum/attachment.php?attachmentid=13710&stc=1 if the result from sine wave is, for example, -0.52, should i express this in binary for the module 's output? and datatype of the output be like?(logic, real....) thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I see you have a lot to learn about designing digital hardware. Everything in hardware binary. https://sestevenson.wordpress.com/introduction-to-fixed-point-representation/
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page