Altera_Forum
Honored Contributor
12 years agoAmazing problem with a variable
Hello,
I have a problem in my software program. My goal is to put the following signal s_nb_deph to X"FF" Here is an ectract of the software: ELSIF RISING_EDGE(clk) then IF (En_enteteRX ='1' AND v_tempo_En_enteteRX ='0')AND v_en_finmesurereflecto ='0' THEN v_attente_nbdeph :='1'; ELSIF v_attente_nbdeph = '1' THEN v_cptdeph := "000001"; ELSIF v_cptdeph = "000001" AND v_cptdeph <= En_enteteRX_nbdeph THEN v_nb_deph <= X"01"; v_attente_nbdeph := '0'; v_flag_nbdeph :='1'; ELSE v_flag_nbdeph := '0'; v_en_finmesurereflecto :='0'; v_attente_nbdeph := '0'; v_en_actmoyennage:= '0'; v_nb_deph <= X"FF"; --HERE MY PROBLEM, this value doesnt' change to FF.....only X"03" END IF; --temporisations v_tempo_flag_moyennagetermine := flag_moyennagetermine; v_tempo_En_enteteRX := En_enteteRX ; ELSIF FALLING_EDGE(clk) then cpt_deph <= v_cptdeph; nb_deph <= v_nb_deph; -- So this output is not updated to the right value flag_nbdeph <= v_flag_nbdeph ; en_finmesurereflecto <= v_en_finmesurereflecto; en_actmoyennage <= v_en_actmoyennage; END IF; END PROCESS; I declared in entity all the input and output, in the begining of the process all the variables. I have tried to change variable by signal (as you can see in the sreenshot attached...) But when I do the simulation on ModelSim Altera,the signal v_nb_deph (or s_nb_deph) goes to x"00" to X"03 and then to X"01". It seems like if the 2 bits on 8 are activated. I don't know what is the problem. In my project I use Quartus 2 Can somebody tell what's the problem.