normantg
Newbie level 1

I am trying to do a fixed point multiplication and I always get the same error in the simulation stage.
I have a histogram values saved in a memory and at some point I want to compute a threshold for that histogram which I will use to classify the bins in two groups. I have these 3 variables, where 'maxim' is the highest value of the histogram, 'thresh_low' is a percentage value to apply, let's say 0.2, and 'thvar' is where I am planning to save the absolute threshold value:
variable maxim : ufixed(18 downto 0);
variable thresh_low : ufixed(0 downto -8);
variable thvar : ufixed(18 downto -8);
At some point I assign values for the variables 'maxim' and 'thresh_low', and proceed to make a multiplication
My intention later is to discard all the decimal values from 'thvar' and keep the integer part as a threshold.
I am simulating all my code with Modelsim for now, so I compile the code without any errors and proceed to simulate. I have some other code that is executed before this part is, and it is simulated correctly. But, when the simulation arrives to the multiplication code, it stops and generates the following error:
# Fatal error in Process line__289 at pixelclassification_wrapper.vhd line 320
#
# HDL call sequence:
# Stopped at pixelclassification_wrapper.vhd 320 Process line__289
The line 320 of this code is the line I have the multiplication presented previously. If instead of having a multiplication I assign a value to 'thvar' everything will work correctly, so there is some problem when I am multiplying both ufixed values, but I really don't know what is it. Could anyone have an idea of what is happening?
Thank you in advance.
I have a histogram values saved in a memory and at some point I want to compute a threshold for that histogram which I will use to classify the bins in two groups. I have these 3 variables, where 'maxim' is the highest value of the histogram, 'thresh_low' is a percentage value to apply, let's say 0.2, and 'thvar' is where I am planning to save the absolute threshold value:
variable maxim : ufixed(18 downto 0);
variable thresh_low : ufixed(0 downto -8);
variable thvar : ufixed(18 downto -8);
At some point I assign values for the variables 'maxim' and 'thresh_low', and proceed to make a multiplication
thvar := maxim*thresh_low;
My intention later is to discard all the decimal values from 'thvar' and keep the integer part as a threshold.
I am simulating all my code with Modelsim for now, so I compile the code without any errors and proceed to simulate. I have some other code that is executed before this part is, and it is simulated correctly. But, when the simulation arrives to the multiplication code, it stops and generates the following error:
# Fatal error in Process line__289 at pixelclassification_wrapper.vhd line 320
#
# HDL call sequence:
# Stopped at pixelclassification_wrapper.vhd 320 Process line__289
The line 320 of this code is the line I have the multiplication presented previously. If instead of having a multiplication I assign a value to 'thvar' everything will work correctly, so there is some problem when I am multiplying both ufixed values, but I really don't know what is it. Could anyone have an idea of what is happening?
Thank you in advance.