aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2023-01-10 19:23:49 +0100
committerTristan Gingold <tgingold@free.fr>2023-01-10 21:46:59 +0100
commit308f761d76becbb71ac4d71ddcc992b809cafd83 (patch)
treef4297e9a0500bae06eaf98ed10d47fece09956b6 /testsuite/synth
parent4ded79ccbbafe357dcb21ddb7cdaf12f831e967c (diff)
downloadghdl-308f761d76becbb71ac4d71ddcc992b809cafd83.tar.gz
ghdl-308f761d76becbb71ac4d71ddcc992b809cafd83.tar.bz2
ghdl-308f761d76becbb71ac4d71ddcc992b809cafd83.zip
testsuite/synth: adjust code for #1926
Diffstat (limited to 'testsuite/synth')
-rw-r--r--testsuite/synth/issue1926/ecp5pll.vhdl16
1 files changed, 8 insertions, 8 deletions
diff --git a/testsuite/synth/issue1926/ecp5pll.vhdl b/testsuite/synth/issue1926/ecp5pll.vhdl
index 9fc305449..f5d0c2ab2 100644
--- a/testsuite/synth/issue1926/ecp5pll.vhdl
+++ b/testsuite/synth/issue1926/ecp5pll.vhdl
@@ -59,7 +59,7 @@ architecture mix of ecp5pll is
type T_secondary is record
div : natural;
- freq_string : string(0 to 9);
+ freq_string : string(1 to 10);
freq : natural;
phase : natural;
cphase : natural;
@@ -74,8 +74,8 @@ architecture mix of ecp5pll is
refclk_div : natural;
feedback_div : natural;
output_div : natural;
- fin_string : string(0 to 9);
- fout_string : string(0 to 9);
+ fin_string : string(1 to 10);
+ fout_string : string(1 to 10);
fout : natural;
fvco : natural;
primary_cphase : natural;
@@ -96,17 +96,17 @@ architecture mix of ecp5pll is
function Hz2MHz_str(int: integer)
return string is
constant base : natural := 10;
- constant digit : string(0 to 9) := "0123456789";
- variable temp : string(0 to 8) := (others => '0');
+ constant digit : string(1 to 10) := "0123456789";
+ variable temp : string(1 to 9) := (others => '0');
variable power : natural := 1;
begin
-- convert integer to string
- for i in temp'high downto 0 loop
- temp(i) := digit(int/power mod base);
+ for i in temp'high downto 1 loop
+ temp(i) := digit((int/power mod base) + 1);
power := power * base;
end loop;
-- insert decimal point "123.456789"
- return temp(0 to 2) & "." & temp(3 to temp'high);
+ return temp(1 to 3) & "." & temp(4 to temp'high);
end Hz2MHz_str;
function F_ecp5pll(request: T_clocks)