URL
https://opencores.org/ocsvn/ao486/ao486/trunk
Subversion Repositories ao486
[/] [ao486/] [trunk/] [rtl/] [ao486/] [commands/] [CMD_IN.txt] - Rev 6
Go to most recent revision | Compare with Previous | Blame | View Log
<defines>
`define CMD_IN #AUTOGEN_NEXT_CMD
`define CMDEX_IN_imm 4'd0
`define CMDEX_IN_dx 4'd1
`define CMDEX_IN_protected 4'd2
`define CMDEX_IN_idle 4'd3
</defines>
<decode>
(dec_ready_one && { decoder[7:1], 1'b0 } == 8'hEC) || (dec_ready_one_one && { decoder[7:1], 1'b0 } == 8'hE4)
`CMD_IN
IF(decoder[3]); SET(dec_cmdex, `CMDEX_IN_dx); ELSE(); SET(dec_cmdex, `CMDEX_IN_imm); ENDIF();
IF(decoder[0] == 1'b0); SET(dec_is_8bit); ENDIF();
IF(decoder[3] == 1'b1); SET(consume_one); ELSE(); SET(consume_one_one); ENDIF();
SET(dec_is_complex);
</decode>
<microcode>
IF(mc_cmd == `CMD_IN && (mc_cmdex_last == `CMDEX_IN_imm || mc_cmdex_last == `CMDEX_IN_dx) && ~(io_allow_check_needed));
LOOP(`CMDEX_IN_idle);
ENDIF();
IF(mc_cmd == `CMD_IN && (mc_cmdex_last == `CMDEX_IN_imm || mc_cmdex_last == `CMDEX_IN_dx) && io_allow_check_needed);
CALL(`CMDEX_io_allow_1);
`CMDEX_IN_protected
LOOP(`CMDEX_IN_idle);
ENDIF();
</microcode>
<read_local>
wire rd_in_condition;
assign rd_in_condition =
(rd_mutex_busy_active && (rd_cmdex == `CMDEX_IN_imm || rd_cmdex == `CMDEX_IN_dx) && ~(io_allow_check_needed)) ||
(rd_cmdex == `CMDEX_IN_dx && rd_mutex_busy_edx);
</read_local>
<read>
IF(rd_cmd == `CMD_IN && rd_cmdex != `CMDEX_IN_idle);
SET(io_read_address, (rd_cmdex == `CMDEX_IN_imm)? { 8'd0, rd_decoder[15:8] } : (rd_cmdex == `CMDEX_IN_protected)? glob_param_1[15:0] : edx[15:0]);
IF(rd_in_condition); SET(rd_waiting);
ELSE();
IF(~(io_allow_check_needed) || rd_cmdex == `CMDEX_IN_protected);
SET(rd_src_is_io);
SET(io_read);
//not required: SET(rd_req_eax);
IF(~(rd_io_ready)); SET(rd_waiting); ENDIF();
ENDIF();
ENDIF();
ENDIF();
</read>
<execute>
IF(exe_cmd == `CMD_IN && exe_cmdex == `CMDEX_IN_protected);
SET(exe_result2, src);
ENDIF();
</execute>
<execute>
IF(exe_cmd == `CMD_IN && (exe_cmdex == `CMDEX_IN_dx || exe_cmdex == `CMDEX_IN_imm));
SET(exe_result2, src);
IF(exe_cmdex == `CMDEX_IN_dx && exe_mutex_current[`MUTEX_EDX_BIT]); SET(exe_waiting);
ELSE();
SET(exe_glob_param_1_set);
SET(exe_glob_param_1_value, (exe_cmdex == `CMDEX_IN_dx)? { 16'd0, edx[15:0] } : { 24'd0, exe_decoder[15:8] });
ENDIF();
ENDIF();
</execute>
<write>
IF(wr_cmd == `CMD_IN); // all CMDEX
IF(~(io_allow_check_needed) || wr_cmdex == `CMDEX_IN_protected);
SAVE(eax, (wr_is_8bit)? { eax[31:8], result2[7:0] } : (wr_operand_16bit)? { eax[31:16], result2[15:0] } : result2);
// reset pipeline
SET(wr_req_reset_micro);
SET(wr_req_reset_rd);
SET(wr_req_reset_exe);
ELSE();
SET(wr_not_finished);
ENDIF();
ENDIF();
</write>
Go to most recent revision | Compare with Previous | Blame | View Log