Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8.2 ms not equal to 8200 us #899

Closed
avelure opened this issue Jun 19, 2024 · 0 comments
Closed

8.2 ms not equal to 8200 us #899

avelure opened this issue Jun 19, 2024 · 0 comments

Comments

@avelure
Copy link

avelure commented Jun 19, 2024

I noticed there is an issue with converting decimal time values to fullscale. The value in this case ends up being 1 fs too low, eg. 8199999999999 fs.
I checked GHDL and Modelsim where the result was correct.

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

entity test is
end entity test;
architecture beh of test is
constant C_TIME_1 : time := 8.2 ms;
constant C_TIME_2 : time := 8200 us;
begin
  
  process
  begin
    assert C_TIME_1 = C_TIME_2 report "Not same " & to_string(C_TIME_1) & " /= " &  to_string(C_TIME_2) severity error;
    wait;
  end process;

end architecture beh;
$ nvc --std=08 -a test_time.vhd
$ nvc -e test -r
** Error: 0ms+0: Not same 8199999999999 fs /= 8200000000000 fs
   Process :test:_p0 at C:\proj\public\minimal\test_time.vhd:14
@nickg nickg closed this as completed in 4978acf Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant