when SREAD_CALCNUMBER1 =>
state_next <= SREAD_CALCNUMBER2;
when SREAD_CALCNUMBER2 =>
- if aktop_int /= ALU_NOP then
- state_next <= SCALC_1;
- else
- state_next <= SREAD_NEXTBYTE;
+ if p_rdone = '0' then
+ if aktop_int /= ALU_NOP then
+ state_next <= SCALC_1;
+ else
+ state_next <= SREAD_NEXTBYTE;
+ end if;
end if;
when SCALC_1 =>
if calc_done = '1' then
case opp_int is
+ -- spezialfall: eine zwischenberechnung wird fuer diese
+ -- kombination benoetigt
when ALU_MUL | ALU_DIV =>
case aktop_int is
when ALU_ADD | ALU_SUB | ALU_DONE => state_next <= SCALC_14;
when ALU_MUL | ALU_DIV =>
case aktop_int is
- when ALU_ADD | ALU_SUB | ALU_DONE =>
- op2_next <= z_int;
- opcode_next <= opp_int;
+ when ALU_ADD | ALU_SUB | ALU_DONE | ALU_MUL | ALU_DIV =>
op1_next <= punkt_int;
- when ALU_MUL | ALU_DIV =>
- op2_next <= z_int;
opcode_next <= opp_int;
- op1_next <= punkt_int;
+ op2_next <= z_int;
when others => assert(false) report "SCALC_1/2: shouldn't happen!";
end case;
when others => assert(false) report "SCALC_1/3: shouldn't happen!";
do_calc_next <= '1';
when SCALC_14 =>
- case opp_int is
- when ALU_MUL | ALU_DIV =>
- case aktop_int is
- when ALU_ADD | ALU_SUB | ALU_DONE =>
- op1_next <= op3;
- do_calc_next <= '0';
- when others => assert(false) report("SCALC_14/1: bla!");
- end case;
- when others => assert(false) report("SCALC_14/2: bla!");
- end case;
+ -- ueberpruefung kann man sich sparen, da diese ohnehin in
+ -- nextstate gemacht wird.
+ op1_next <= op3;
+ do_calc_next <= '0';
when SCALC_15 =>
- case opp_int is
- when ALU_MUL | ALU_DIV =>
- case aktop_int is
- when ALU_ADD | ALU_SUB | ALU_DONE =>
- opcode_next <= ALU_ADD;
- op2_next <= strich_int;
- punkt_next <= (0 => '1', others => '0');
- do_calc_next <= '1';
- when others => assert(false) report("SCALC_15/1: bla!");
- end case;
- when others => assert(false) report("SCALC_15/2: bla!");
- end case;
+ -- ueberpruefung kann man sich sparen, da diese ohnehin in
+ -- nextstate gemacht wird.
+ opcode_next <= ALU_ADD;
+ op2_next <= strich_int;
+ punkt_next <= (0 => '1', others => '0');
+ do_calc_next <= '1';
when SCALC_2 =>
case opp_int is
- when ALU_NOP | ALU_ADD | ALU_SUB =>
+ when ALU_NOP | ALU_ADD | ALU_SUB | ALU_MUL | ALU_DIV =>
case aktop_int is
when ALU_ADD | ALU_SUB | ALU_DONE =>
strich_next <= op3;
punkt_next <= op3;
when others => assert (false) report "SCALC_2/1: shouldn't happen!";
end case;
- when ALU_MUL | ALU_DIV =>
- case aktop_int is
- when ALU_ADD | ALU_SUB | ALU_DONE =>
- strich_next <= op3;
- when ALU_MUL | ALU_DIV =>
- punkt_next <= op3;
- when others => assert(false) report "SCALC_2/2: shouldn't happen!";
- end case;
- when others => assert (false) report "SCALC_2/3: shouldn't happen!";
+ when others => assert (false) report "SCALC_2/2: shouldn't happen!";
end case;
-
+ -- aktuelle rechenoperation fuer naechste 'runde' uebernehmen
opp_next <= aktop_int;
when SWRITE_CHAR1 =>