Skip to content
This repository was archived by the owner on Oct 20, 2025. It is now read-only.

Commit bbbf971

Browse files
authored
Merge pull request #24 from olofk/physical_warnings
Silence modelsim warnings for physical.vhdl
2 parents f9e431c + bf59149 commit bbbf971

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/common/physical.vhdl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ package body physical is
382382
else
383383
report "to_baud: Unknown format" severity FAILURE;
384384
end if;
385+
return 0 Bd;
385386
end function;
386387

387388
-- inter-type arithmetic
@@ -795,6 +796,7 @@ package body physical is
795796
elsif (scale = 1 ms) then return div(t, 1 ms);
796797
elsif (scale = 1 sec) then return div(t, 1 sec);
797798
else report "to_real: scale must have a value of '1 <unit>'" severity failure;
799+
return 0.0;
798800
end if;
799801
end;
800802

@@ -807,6 +809,7 @@ package body physical is
807809
-- elsif (scale = 1 THz) then return div(f, 1 THz);
808810
else report "to_real: scale must have a value of '1 <unit>'" severity failure;
809811
end if;
812+
return 0.0;
810813
end;
811814

812815
function to_real(br : BAUD; scale : BAUD) return REAL is
@@ -817,6 +820,7 @@ package body physical is
817820
elsif (scale = 1 GBd) then return div(br, 1 GBd);
818821
else report "to_real: scale must have a value of '1 <unit>'" severity failure;
819822
end if;
823+
return 0.0;
820824
end;
821825

822826
function to_real(mem : MEMORY; scale : MEMORY) return REAL is
@@ -827,6 +831,7 @@ package body physical is
827831
elsif (scale = 1 GiB) then return div(mem, 1 GiB);
828832
else report "to_real: scale must have a value of '1 <unit>'" severity failure;
829833
end if;
834+
return 0.0;
830835
end;
831836

832837
-- convert physical types to standard type (INTEGER)
@@ -840,6 +845,7 @@ package body physical is
840845
when others => null;
841846
end case;
842847
report "to_int: unsupported RoundingStyle: " & T_ROUNDING_STYLE'image(RoundingStyle) severity failure;
848+
return 0;
843849
end;
844850

845851
function to_int(f : FREQ; scale : FREQ; RoundingStyle : T_ROUNDING_STYLE := ROUND_TO_NEAREST) return integer is
@@ -851,6 +857,7 @@ package body physical is
851857
when others => null;
852858
end case;
853859
report "to_int: unsupported RoundingStyle: " & T_ROUNDING_STYLE'image(RoundingStyle) severity failure;
860+
return 0;
854861
end;
855862

856863
function to_int(br : BAUD; scale : BAUD; RoundingStyle : T_ROUNDING_STYLE := ROUND_TO_NEAREST) return integer is
@@ -862,6 +869,7 @@ package body physical is
862869
when others => null;
863870
end case;
864871
report "to_int: unsupported RoundingStyle: " & T_ROUNDING_STYLE'image(RoundingStyle) severity failure;
872+
return 0;
865873
end;
866874

867875
function to_int(mem : MEMORY; scale : MEMORY; RoundingStyle : T_ROUNDING_STYLE := ROUND_UP) return integer is
@@ -873,6 +881,7 @@ package body physical is
873881
when others => null;
874882
end case;
875883
report "to_int: unsupported RoundingStyle: " & T_ROUNDING_STYLE'image(RoundingStyle) severity failure;
884+
return 0;
876885
end;
877886

878887
-- calculate needed counter cycles to achieve a given 1. timing/delay and 2. frequency/period

0 commit comments

Comments
 (0)