implemented jump register instructions
Stefan Schuermans

Stefan Schuermans commited on 2012-02-10 22:56:14
Showing 1 changed files, with 4 additions and 2 deletions.

... ...
@@ -396,16 +396,18 @@ BEGIN
396 396
         END IF;
397 397
     END PROCESS p_reg_wr;
398 398
 
399
-    p_next_pc: PROCESS(r_pc, r_op, r_imm, s_cmp_res, r_imm_16, r_imm_26)
399
+    p_next_pc: PROCESS(r_pc, r_op, r_imm, s_cmp_res, r_imm_16, r_imm_26, s_val_s)
400 400
         VARIABLE v_pc:  signed(31 DOWNTO 0);
401 401
         VARIABLE v_rel: signed(17 DOWNTO 0);
402 402
     BEGIN
403 403
         IF r_op = op_j AND s_cmp_res = '1' THEN
404 404
             IF r_imm = imm_26 THEN
405 405
                 n_pc <= r_pc(31 DOWNTO 28) & r_imm_26 & "00";
406
-            ELSE
406
+            ELSIF r_imm = imm_16se THEN
407 407
                 n_pc <= std_logic_vector(signed(r_pc) +
408 408
                                          signed(r_imm_16 & "00"));
409
+            ELSE
410
+                n_pc <= s_val_s;
409 411
             END IF;
410 412
         ELSE
411 413
             n_pc <= std_logic_vector(signed(r_pc) + to_signed(4, 32));
412 414