mirror of
https://github.com/sxpert/hp-saturn
synced 2024-11-16 19:50:19 +01:00
move to using the ALU
This commit is contained in:
parent
9cd9c18381
commit
0eeb018b56
1 changed files with 25 additions and 12 deletions
|
@ -8,20 +8,33 @@
|
|||
`include "decstates.v"
|
||||
|
||||
`DEC_DX: begin
|
||||
case (nb_in)
|
||||
4'hA: begin
|
||||
A[19:0] <= C[19:0];
|
||||
$display("%5h A=C\tA", inst_start_PC);
|
||||
field <= `T_FIELD_A;
|
||||
alu_first <= 0;
|
||||
alu_last <= 4;
|
||||
|
||||
case (nb_in[3:2])
|
||||
2'b00: begin
|
||||
alu_op <= `ALU_OP_ZERO;
|
||||
alu_reg_dest <= {2'b00, nb_in[1:0]};
|
||||
end
|
||||
4'hE: begin
|
||||
A[19:0] <= C[19:0];
|
||||
C[19:0] <= A[19:0];
|
||||
$display("%5h ACEX\tA", inst_start_PC);
|
||||
2'b01: begin
|
||||
alu_op <= `ALU_OP_COPY;
|
||||
alu_reg_dest <= {2'b00, nb_in[1:0]};
|
||||
alu_reg_src1 <= {2'b00, nb_in[0], !(nb_in[1] | nb_in[0])};
|
||||
end
|
||||
default: begin
|
||||
$display("ERROR : DEC_DX");
|
||||
decode_error <= 1;
|
||||
2'b10: begin
|
||||
alu_op <= `ALU_OP_COPY;
|
||||
alu_reg_dest <= {2'b00, nb_in[0], !(nb_in[1] | nb_in[0])};
|
||||
alu_reg_src1 <= {2'b00, nb_in[1:0]};
|
||||
end
|
||||
2'b11: begin
|
||||
alu_op <= `ALU_OP_EXCH;
|
||||
alu_reg_dest <= {2'b00, nb_in[1] & nb_in[0], (!nb_in[1]) & nb_in[0]};
|
||||
alu_reg_src1 <= {2'b00, nb_in[1] | nb_in[0], (!nb_in[1]) ^ nb_in[0]};
|
||||
end
|
||||
endcase
|
||||
decstate <= `DEC_START;
|
||||
alu_debug <= 1;
|
||||
next_cycle <= `BUSCMD_NOP;
|
||||
decstate <= `DEC_ALU_INIT;
|
||||
alu_return <= `DEC_START;
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue