Altera_Forum
Honored Contributor
8 years agoQuartus Prime complete lack of real data type support?
Hi,
I have a function (basicaly implements a LUT) something like the following:function integer gen_lut;
input integer addr;
localparam SOME_CONSTANT = 418.39; // Gets calculated at runtime.
localparam D0 = 0.785398163 * SOME_CONSTANT;
localparam D1 = 0.463647609 * SOME_CONSTANT;
...
begin
case (addr)
0: gen_lut = D0;
1: gen_lut = D1;
...
endcase
end
endfunction The thing is I need to convert d0, d1, ... from real type to integer at elaboration time to use it later in design. I've tried using system function $rtoi, $floor but Quartus complains: error (10174): verilog hdl unsupported feature error at top.v(54): system function "$floor" is not supported for synthesis Then I've tried implementing a constant function, since I already have log2 function implemented and it works, floor that would take real number and output a integer like so: function integer floor;
input real x;
integer int_part;
begin
int_part = x;
if (int_part > x) begin floor = int_part - 1; end
else begin floor = int_part; end
end
endfunction And the tool complains again: error (10172): verilog hdl unsupported feature error at const_functions.sv(21): real variable data type values are not supported. IMHO, this is just ridiculous. I am not even trying to synthesise real values I just want to convert them to integer at elaboration time. Does Quartus even have any kind of support for real data types? I mean even Xillinx ISE and Icarus Verilog have these features supported and have no problem synthesizing. Is there a workaround this problem? I would still like to keep real numbers in the code for easier parametrization. P.S. I saw a similar thread that was posted in 2008, so these features havent been implemented for almost 10 years??? Come on, its not like the whole IDE needs to be re-implemented...