2019-02-07 22:54:06 +01:00
|
|
|
/******************************************************************************
|
|
|
|
* 8Dzyxwv GOVLNG vwxyz
|
|
|
|
* 8Fzyxwv GOSBVL vwxyz
|
|
|
|
* two for the price of one...
|
|
|
|
*/
|
|
|
|
|
|
|
|
`include "decstates.v"
|
|
|
|
|
|
|
|
`DEC_GOVLNG, `DEC_GOSBVL: begin
|
|
|
|
jump_base <= 0;
|
|
|
|
t_cnt <= 4;
|
|
|
|
t_ctr <= 1;
|
2019-02-09 19:18:58 +01:00
|
|
|
jump_base[3:0] <= nb_in;
|
2019-02-07 22:54:06 +01:00
|
|
|
if (decstate == `DEC_GOSBVL) begin
|
|
|
|
rstk_ptr <= rstk_ptr + 1;
|
|
|
|
decstate <= `DEC_GOSBVL_LOOP;
|
|
|
|
end else decstate <= `DEC_GOVLNG_LOOP;
|
|
|
|
end
|
|
|
|
`DEC_GOVLNG_LOOP, `DEC_GOSBVL_LOOP: begin
|
2019-02-09 19:18:58 +01:00
|
|
|
jump_base[t_ctr*4+:4] <= nb_in;
|
2019-02-07 22:54:06 +01:00
|
|
|
if (t_ctr == t_cnt) begin
|
|
|
|
if (decstate == `DEC_GOVLNG_LOOP) decstate <= `DEC_GOVLNG_EXEC;
|
|
|
|
else decstate <= `DEC_GOSBVL_EXEC;
|
|
|
|
execute_cycle <= 1;
|
2019-02-08 19:09:13 +01:00
|
|
|
next_cycle <= `BUSCMD_NOP;
|
2019-02-07 22:54:06 +01:00
|
|
|
end else t_ctr <= t_ctr + 1;
|
|
|
|
end
|
|
|
|
`DEC_GOVLNG_EXEC, `DEC_GOSBVL_EXEC: begin
|
2019-02-08 11:15:16 +01:00
|
|
|
// $display("GOSBVL new_PC %5h", new_PC);
|
|
|
|
// $display("GOSBVL PC %5h", PC);
|
2019-02-08 11:47:06 +01:00
|
|
|
if (decstate == `DEC_GOSBVL_EXEC) RSTK[rstk_ptr] <= PC + 1;
|
2019-02-08 11:06:19 +01:00
|
|
|
new_PC <= jump_base;
|
2019-02-07 22:54:06 +01:00
|
|
|
bus_load_pc <= 1;
|
|
|
|
execute_cycle <= 0;
|
2019-02-08 19:09:13 +01:00
|
|
|
next_cycle <= `BUSCMD_LOAD_PC;
|
2019-02-07 22:54:06 +01:00
|
|
|
decstate <= `DEC_START;
|
|
|
|
`ifdef SIM
|
2019-02-08 11:15:16 +01:00
|
|
|
$write("%5h GO", inst_start_PC);
|
2019-02-07 22:54:06 +01:00
|
|
|
case (decstate)
|
|
|
|
`DEC_GOVLNG_EXEC: $write("VLNG");
|
|
|
|
`DEC_GOSBVL_EXEC: $write("SBVL");
|
|
|
|
endcase
|
|
|
|
$display("\t%5h", jump_base);
|
|
|
|
`endif
|
|
|
|
end
|