URL
https://opencores.org/ocsvn/ao486/ao486/trunk
Subversion Repositories ao486
[/] [ao486/] [trunk/] [rtl/] [ao486/] [commands/] [CMD_ENTER.txt] - Rev 2
Compare with Previous | Blame | View Log
<defines>
`define CMD_ENTER #AUTOGEN_NEXT_CMD
`define CMDEX_ENTER_FIRST 4'd0
`define CMDEX_ENTER_LAST 4'd1
`define CMDEX_ENTER_PUSH 4'd2
`define CMDEX_ENTER_LOOP 4'd3
</defines>
<decode>
dec_ready_one_three && decoder[7:0] == 8'hC8
`CMD_ENTER
SET(dec_cmdex, `CMDEX_ENTER_FIRST);
SET(consume_one_three);
SET(dec_is_complex);
</decode>
<microcode>
//last microinstruction
IF(mc_cmd == `CMD_ENTER && ((mc_step == 6'd1 && mc_decoder[28:24] == 5'd0) || (mc_step == 6'd2 && mc_decoder[28:24] == 5'd1) || (mc_step > { 1'b0, mc_decoder[28:24] } && mc_decoder[28:24] > 5'd1)));
LAST(`CMDEX_ENTER_LAST);
ENDIF();
//push saved
IF(mc_cmd == `CMD_ENTER && ((mc_step == 6'd1 && mc_decoder[28:24] == 5'd1) || (mc_step == { 1'b0, mc_decoder[28:24] } && mc_decoder[28:24] > 5'd1)));
`CMDEX_ENTER_PUSH
ENDIF();
//push mem
IF(mc_cmd == `CMD_ENTER && (mc_step < { 1'b0, mc_decoder[28:24] } && mc_decoder[28:24] > 5'd1));
`CMDEX_ENTER_LOOP
ENDIF();
</microcode>
<read>
IF(rd_cmd == `CMD_ENTER && rd_cmdex == `CMDEX_ENTER_FIRST);
SET(address_enter_init);
// waiting for ebp in exe
SET(rd_src_is_cmdex);
SET(rd_req_esp);
SET(rd_req_memory);
IF(rd_mutex_busy_ebp); SET(rd_waiting); ENDIF();
ENDIF();
</read>
<read>
IF(rd_cmd == `CMD_ENTER && rd_cmdex == `CMDEX_ENTER_LAST);
SET(address_enter_last);
// waiting for esp in 'address_waiting'
SET(rd_req_esp);
SET(rd_req_ebp);
SET(read_rmw_virtual);
IF(~(read_for_rd_ready)); SET(rd_waiting); ENDIF();
ENDIF();
</read>
<read>
IF(rd_cmd == `CMD_ENTER && rd_cmdex == `CMDEX_ENTER_PUSH);
// waiting for esp in exe
SET(rd_req_esp);
SET(rd_req_memory);
ENDIF();
</read>
<read>
IF(rd_cmd == `CMD_ENTER && rd_cmdex == `CMDEX_ENTER_LOOP);
SET(address_enter);
// waiting for esp in exe
SET(rd_src_is_memory);
SET(rd_req_esp);
SET(rd_req_memory);
SET(read_virtual);
IF(~(read_for_rd_ready)); SET(rd_waiting); ENDIF();
ENDIF();
</read>
<execute>
IF(exe_cmd == `CMD_ENTER && exe_cmdex == `CMDEX_ENTER_FIRST);
SET(exe_result_push, ebp);
IF(exe_mutex_current[`MUTEX_ESP_BIT]); SET(exe_waiting);
ELSE();
SAVE(exe_buffer, exe_enter_offset);
ENDIF();
ENDIF();
</execute>
<execute>
IF(exe_cmd == `CMD_ENTER && exe_cmdex == `CMDEX_ENTER_LAST);
SET(offset_enter_last);
ENDIF();
</execute>
<execute>
IF(exe_cmd == `CMD_ENTER && (exe_cmdex == `CMDEX_ENTER_PUSH || exe_cmdex == `CMDEX_ENTER_LOOP));
IF(exe_cmdex == `CMDEX_ENTER_PUSH);
SET(exe_result_push, exe_buffer);
ELSE();
SET(exe_result_push, src);
ENDIF();
IF(exe_mutex_current[`MUTEX_ESP_BIT]); SET(exe_waiting); ENDIF();
ENDIF();
</execute>
<write>
IF(wr_cmd == `CMD_ENTER && wr_cmdex == `CMDEX_ENTER_FIRST);
SET(wr_not_finished);
SET(wr_push_ss_fault_check);
SET(wr_one_cycle_wait);
SET(wr_make_esp_speculative);
SAVE(esp, wr_stack_esp);
IF(~(write_for_wr_ready)); SET(wr_waiting); ENDIF();
IF(~(wr_push_ss_fault));
SET(write_stack_virtual);
ENDIF();
ENDIF();
</write>
<write>
IF(wr_cmd == `CMD_ENTER && wr_cmdex == `CMDEX_ENTER_LAST);
//NOTE: exe_buffer can only be used if wr stage does not block (and it does not)
SET(wr_make_esp_commit);
SAVE(ebp, { wr_operand_16bit? ebp[31:16] : exe_buffer[31:16], exe_buffer[15:0] });
SAVE(esp, wr_stack_esp);
ENDIF();
</write>
<write>
IF(wr_cmd == `CMD_ENTER && (wr_cmdex == `CMDEX_ENTER_PUSH || wr_cmdex == `CMDEX_ENTER_LOOP));
SET(wr_not_finished);
SET(wr_push_ss_fault_check);
SET(wr_one_cycle_wait);
IF(~(write_for_wr_ready)); SET(wr_waiting); ENDIF();
IF(~(wr_push_ss_fault));
SET(write_stack_virtual);
SAVE(esp, wr_stack_esp);
ENDIF();
ENDIF();
</write>