T
Tricky
Just wondering if this is something Ive done wrong, or if its a
modelsim bug.
Here is the problem code:
process
variable uf : ufixed(7 downto -7) := to_ufixed( 1, 7, -7);
variable sf : sfixed(8 downto -7) := to_sfixed(-2, 8, -7);
variable op : sfixed(17 downto -14);
begin
op := sf * sfixed('0' & uf);
wait;
end process;
and here is the error:
# ** Error: :floatfixlib:fixed_pkg: Unbounded number passed, was a
literal used?
# Time: 0 ps Iteration: 0 Instance: /play_tb
# ** Warning: (vsim-WLF-5000) WLF file currently in use: vsim.wlf
# File in use by: 113007238 Hostname: IND-JJYK03JG1
ProcessID: 9164
# Attempting to use alternate WLF file "./wlftrh7wd7".
# ** Warning: (vsim-WLF-5001) Could not open WLF file: vsim.wlf
# Using alternate file: ./wlftrh7wd7
# ** Fatal: (vsim-3420) Array lengths do not match. Left is 30 (15
downto -14). Right is 0 (0 downto 1 (null array)).
# Time: 0 ps Iteration: 0 Process: /play_tb/line__21 File:
play_tb.vhd
# Fatal error in Process line__21 at play_tb.vhd line 26
If I take the type conversion out of the assignment line and have a
temporary variable for just the type conversion, there is no error:
temp := sfixed('0' & uf);
op := sf * temp;
modelsim bug.
Here is the problem code:
process
variable uf : ufixed(7 downto -7) := to_ufixed( 1, 7, -7);
variable sf : sfixed(8 downto -7) := to_sfixed(-2, 8, -7);
variable op : sfixed(17 downto -14);
begin
op := sf * sfixed('0' & uf);
wait;
end process;
and here is the error:
# ** Error: :floatfixlib:fixed_pkg: Unbounded number passed, was a
literal used?
# Time: 0 ps Iteration: 0 Instance: /play_tb
# ** Warning: (vsim-WLF-5000) WLF file currently in use: vsim.wlf
# File in use by: 113007238 Hostname: IND-JJYK03JG1
ProcessID: 9164
# Attempting to use alternate WLF file "./wlftrh7wd7".
# ** Warning: (vsim-WLF-5001) Could not open WLF file: vsim.wlf
# Using alternate file: ./wlftrh7wd7
# ** Fatal: (vsim-3420) Array lengths do not match. Left is 30 (15
downto -14). Right is 0 (0 downto 1 (null array)).
# Time: 0 ps Iteration: 0 Process: /play_tb/line__21 File:
play_tb.vhd
# Fatal error in Process line__21 at play_tb.vhd line 26
If I take the type conversion out of the assignment line and have a
temporary variable for just the type conversion, there is no error:
temp := sfixed('0' & uf);
op := sf * temp;