T
Tricky
Im having trouble getting the syntax correct for defining this
constant in modelsim. basically Ive got a 3x3 2-D array of sfixed.I
get the feeling Im not indexing the 2d array correctly. The errors I
get are:
# ** Warning: ./Testbenches/AWEP_filter_TB.vhd(48): (vcom-1172)
Aggregate element expression (function call "to_sfixed") is not of
type sub-array #2 of work.awep_setup_package.coeff_array_t.
# ** Error: ./Testbenches/AWEP_filter_TB.vhd(48): No feasible entries
for subprogram "to_sfixed".
# ** Error: ./Testbenches/AWEP_filter_TB.vhd(48): Aggregate expression
cannot be scalar type std.standard.integer.
Could I get some help?
subtype coeff_t is sfixed(1 downto -16);
type coeff_array_t is array(-1 to 1, -1 to 1) of coeff_t;
-- x y --top row
FILTER_COEFFS : coeff_array_t := ( (-1,-1) =>
to_sfixed(0.0, coeff_t'high+1, abs(coeff_t'low) ) ,
( 0,-1) =>
to_sfixed(0.0, coeff_t'high+1, abs(coeff_t'low) ) ,
( 1,-1) =>
to_sfixed(0.0, coeff_t'high+1, abs(coeff_t'low) ) ,
--middle
row
(-1, 0) =>
to_sfixed(0.0, coeff_t'high+1, abs(coeff_t'low) ) ,
( 0, 0) =>
to_sfixed(1.0, coeff_t'high+1, abs(coeff_t'low) ) ,
( 1, 0) =>
to_sfixed(0.0, coeff_t'high+1, abs(coeff_t'low) ) ,
--bottom
row
(-1, 1) =>
to_sfixed(0.0, coeff_t'high+1, abs(coeff_t'low) ) ,
( 0, 1) =>
to_sfixed(0.0, coeff_t'high+1, abs(coeff_t'low) ) ,
( 1, 1) =>
to_sfixed(0.0, coeff_t'high+1, abs(coeff_t'low) )
);
constant in modelsim. basically Ive got a 3x3 2-D array of sfixed.I
get the feeling Im not indexing the 2d array correctly. The errors I
get are:
# ** Warning: ./Testbenches/AWEP_filter_TB.vhd(48): (vcom-1172)
Aggregate element expression (function call "to_sfixed") is not of
type sub-array #2 of work.awep_setup_package.coeff_array_t.
# ** Error: ./Testbenches/AWEP_filter_TB.vhd(48): No feasible entries
for subprogram "to_sfixed".
# ** Error: ./Testbenches/AWEP_filter_TB.vhd(48): Aggregate expression
cannot be scalar type std.standard.integer.
Could I get some help?
subtype coeff_t is sfixed(1 downto -16);
type coeff_array_t is array(-1 to 1, -1 to 1) of coeff_t;
-- x y --top row
FILTER_COEFFS : coeff_array_t := ( (-1,-1) =>
to_sfixed(0.0, coeff_t'high+1, abs(coeff_t'low) ) ,
( 0,-1) =>
to_sfixed(0.0, coeff_t'high+1, abs(coeff_t'low) ) ,
( 1,-1) =>
to_sfixed(0.0, coeff_t'high+1, abs(coeff_t'low) ) ,
--middle
row
(-1, 0) =>
to_sfixed(0.0, coeff_t'high+1, abs(coeff_t'low) ) ,
( 0, 0) =>
to_sfixed(1.0, coeff_t'high+1, abs(coeff_t'low) ) ,
( 1, 0) =>
to_sfixed(0.0, coeff_t'high+1, abs(coeff_t'low) ) ,
--bottom
row
(-1, 1) =>
to_sfixed(0.0, coeff_t'high+1, abs(coeff_t'low) ) ,
( 0, 1) =>
to_sfixed(0.0, coeff_t'high+1, abs(coeff_t'low) ) ,
( 1, 1) =>
to_sfixed(0.0, coeff_t'high+1, abs(coeff_t'low) )
);