A
ashwini012
Guest
Hi,
i am working on the following code but i have error as:
"Bad condition in wait statement, or only one clock per process."
Code:
Sensor_fusion_1_output : PROCESS
VARIABLE z : vector_of_real(0 TO 11);
VARIABLE xapriori : vector_of_real(0 TO 11);
VARIABLE residual : vector_of_real(0 TO 11);
VARIABLE papriori : vector_of_real(0 TO 11);
VARIABLE K : vector_of_real(0 TO 11);
VARIABLE paposteriori : vector_of_real(0 TO 11);
VARIABLE xaposteriori1 : vector_of_real(0 TO 11);
VARIABLE add_temp : real;
VARIABLE div_temp : real;
VARIABLE add_temp_0 : vector_of_real(0 TO 10);
VARIABLE div_temp_0 : vector_of_real(0 TO 10);
BEGIN
z := temp;
xapriori := (OTHERS => 0.0);
residual := (OTHERS => 0.0);
papriori := (OTHERS => 0.0);
K := (OTHERS => 0.0);
paposteriori := (OTHERS => 0.0);
xaposteriori1 := (OTHERS => 0.0);
xapriori(0) := 0.0;
residual(0) := z(0);
papriori(0) := 4.3;
add_temp := 4.3 + 0.1;
IF add_temp = 0.0 THEN
div_temp := C_divbyzero_p;
ELSE
div_temp := One / add_temp;
END IF;
K(0) := div_temp;
paposteriori(0) := 4.3 * (1.0 - K(0));
xaposteriori1(0) := K(0) * z(0);
FOR k_0 IN 0 TO 10 LOOP
xapriori(1 + k_0) := xaposteriori1(k_0);
residual(1 + k_0) := z(1 + k_0) - xapriori(1 + k_0);
papriori(1 + k_0) := paposteriori(k_0) + 2.8;
add_temp_0(k_0) := papriori(1 + k_0) + 0.1;
IF add_temp_0(k_0) = 0.0 THEN
IF (papriori(1 + k_0) < 0.0) XOR (add_temp_0(k_0) < 0.0) THEN
div_temp_0(k_0) := C_divbyzero_n;
ELSE
div_temp_0(k_0) := C_divbyzero_p;
END IF;
ELSE
div_temp_0(k_0) := papriori(1 + k_0) / add_temp_0(k_0);
END IF;
K(1 + k_0) := div_temp_0(k_0);
paposteriori(1 + k_0) := papriori(1 + k_0) * (1.0 - K(1 + k_0));
xaposteriori1(1 + k_0) := xapriori(1 + k_0) + (K(1 + k_0) * residual(1 + k_0));
END LOOP;
xaposteriori <= xaposteriori1;
WAIT;
END PROCESS Sensor_fusion_1_output;
Can anyone help me.Please....
Thank you.
i am working on the following code but i have error as:
"Bad condition in wait statement, or only one clock per process."
Code:
Sensor_fusion_1_output : PROCESS
VARIABLE z : vector_of_real(0 TO 11);
VARIABLE xapriori : vector_of_real(0 TO 11);
VARIABLE residual : vector_of_real(0 TO 11);
VARIABLE papriori : vector_of_real(0 TO 11);
VARIABLE K : vector_of_real(0 TO 11);
VARIABLE paposteriori : vector_of_real(0 TO 11);
VARIABLE xaposteriori1 : vector_of_real(0 TO 11);
VARIABLE add_temp : real;
VARIABLE div_temp : real;
VARIABLE add_temp_0 : vector_of_real(0 TO 10);
VARIABLE div_temp_0 : vector_of_real(0 TO 10);
BEGIN
z := temp;
xapriori := (OTHERS => 0.0);
residual := (OTHERS => 0.0);
papriori := (OTHERS => 0.0);
K := (OTHERS => 0.0);
paposteriori := (OTHERS => 0.0);
xaposteriori1 := (OTHERS => 0.0);
xapriori(0) := 0.0;
residual(0) := z(0);
papriori(0) := 4.3;
add_temp := 4.3 + 0.1;
IF add_temp = 0.0 THEN
div_temp := C_divbyzero_p;
ELSE
div_temp := One / add_temp;
END IF;
K(0) := div_temp;
paposteriori(0) := 4.3 * (1.0 - K(0));
xaposteriori1(0) := K(0) * z(0);
FOR k_0 IN 0 TO 10 LOOP
xapriori(1 + k_0) := xaposteriori1(k_0);
residual(1 + k_0) := z(1 + k_0) - xapriori(1 + k_0);
papriori(1 + k_0) := paposteriori(k_0) + 2.8;
add_temp_0(k_0) := papriori(1 + k_0) + 0.1;
IF add_temp_0(k_0) = 0.0 THEN
IF (papriori(1 + k_0) < 0.0) XOR (add_temp_0(k_0) < 0.0) THEN
div_temp_0(k_0) := C_divbyzero_n;
ELSE
div_temp_0(k_0) := C_divbyzero_p;
END IF;
ELSE
div_temp_0(k_0) := papriori(1 + k_0) / add_temp_0(k_0);
END IF;
K(1 + k_0) := div_temp_0(k_0);
paposteriori(1 + k_0) := papriori(1 + k_0) * (1.0 - K(1 + k_0));
xaposteriori1(1 + k_0) := xapriori(1 + k_0) + (K(1 + k_0) * residual(1 + k_0));
END LOOP;
xaposteriori <= xaposteriori1;
WAIT;
END PROCESS Sensor_fusion_1_output;
Can anyone help me.Please....
Thank you.