+ -- out
+ process(state_int, p_read, p_write_int, z_int, rbyte_int, p_rget_int,
+ strich_int, aktop_int, opp_int, opcode_int, op1_int, op2_int, op3,
+ do_calc_int)
+ function hbyte2csigned (x : hbyte) return csigned is
+ variable y : csigned;
+ begin
+ case x is
+ when x"30" => y := to_signed(0, CBITS);
+ when x"31" => y := to_signed(1, CBITS);
+ when x"32" => y := to_signed(2, CBITS);
+ when x"33" => y := to_signed(3, CBITS);
+ when x"34" => y := to_signed(4, CBITS);
+ when x"35" => y := to_signed(5, CBITS);
+ when x"36" => y := to_signed(6, CBITS);
+ when x"37" => y := to_signed(7, CBITS);
+ when x"38" => y := to_signed(8, CBITS);
+ when x"39" => y := to_signed(9, CBITS);
+ when others => assert(false) report "hbyte2csigned: shouldn't happen";
+ end case;
+ return y;
+ end function hbyte2csigned;
+
+ function csigned2hbyte (x : csigned) return hbyte is
+ variable y : hbyte;
+ begin
+ case x is
+ when x"00000000" => y := x"30";
+ when x"00000001" => y := x"31";
+ when x"00000002" => y := x"32";
+ when x"00000003" => y := x"33";
+ when x"00000004" => y := x"34";
+ when x"00000005" => y := x"35";
+ when x"00000006" => y := x"36";
+ when x"00000007" => y := x"37";
+ when x"00000008" => y := x"38";
+ when x"00000009" => y := x"39";
+ when others => assert(false) report "csigned2hbyte: shouldn't happen";
+ end case;
+ return y;
+ end function csigned2hbyte;
+
+ variable multmp : signed(((2*CBITS)-1) downto 0);
+ variable tmp : csigned;