OpenCores
URL https://opencores.org/ocsvn/ao486/ao486/trunk

Subversion Repositories ao486

[/] [ao486/] [trunk/] [rtl/] [ao486/] [commands/] [CMD_POP.txt] - Rev 8

Go to most recent revision | Compare with Previous | Blame | View Log


<defines>
`define CMD_POP         #AUTOGEN_NEXT_CMD

`define CMDEX_POP_implicit          4'd0
`define CMDEX_POP_modregrm_STEP_0   4'd1
`define CMDEX_POP_modregrm_STEP_1   4'd2
</defines>

<decode>
dec_ready_one && { decoder[7:3], 3'b0 } == 8'h58
`CMD_POP
SET(dec_cmdex, `CMDEX_POP_implicit);
SET(consume_one);
</decode>

<decode>
dec_ready_modregrm_one && decoder[7:0] == 8'h8F && decoder[13:11] == 3'd0
`CMD_POP
SET(dec_cmdex, `CMDEX_POP_modregrm_STEP_0);
SET(consume_modregrm_one);
SET(dec_is_complex);
</decode>

<microcode>
`CMDEX_POP_modregrm_STEP_0
LAST(`CMDEX_POP_modregrm_STEP_1);
</microcode>

<read>
IF(rd_cmd == `CMD_POP && rd_cmdex == `CMDEX_POP_implicit);
            
    SET(address_stack_pop);

    SET(rd_src_is_memory);
    SET(rd_dst_is_implicit_reg);
        
    SET(rd_req_esp);
    SET(rd_req_implicit_reg);
    
    IF(rd_mutex_busy_memory || rd_mutex_busy_esp); SET(rd_waiting);
    ELSE();
        SET(read_virtual);

        IF(~(read_for_rd_ready)); SET(rd_waiting); ENDIF();
    ENDIF();
ENDIF();
</read>

<read>
IF(rd_cmd == `CMD_POP && rd_cmdex == `CMDEX_POP_modregrm_STEP_0);
            
    SET(address_stack_pop);
    
    SET(rd_src_is_memory);
    
    SET(rd_req_esp);
    
    IF(rd_mutex_busy_memory || rd_mutex_busy_esp); SET(rd_waiting);
    ELSE();
        SET(read_virtual);

        IF(~(read_for_rd_ready)); SET(rd_waiting); ENDIF();
    ENDIF();
ENDIF();
</read>

<read>
IF(rd_cmd == `CMD_POP && rd_cmdex == `CMDEX_POP_modregrm_STEP_1);
            
    // dst: reg
    IF(rd_modregrm_mod == 2'b11);
        // no need to wait
        SET(rd_dst_is_rm);
            
        SET(rd_req_rm);
    ENDIF();

    // dst: memory
    IF(rd_modregrm_mod != 2'b11);
        SET(rd_dst_is_memory);
    
        SET(rd_req_memory);
        
        SET(write_virtual_check);
        
        IF(~(write_virtual_check_ready)); SET(rd_waiting); ENDIF();
    ENDIF();
ENDIF();
</read>

<execute>
IF(exe_cmd == `CMD_POP && exe_cmdex == `CMDEX_POP_implicit);
    
    SET(offset_pop);

    SET(exe_result, src);

ENDIF();
</execute>

<execute>
IF(exe_cmd == `CMD_POP && exe_cmdex == `CMDEX_POP_modregrm_STEP_0);
    
    SET(offset_pop);
    
    SAVE(exe_buffer, src);
ENDIF();
</execute>

<execute>
IF(exe_cmd == `CMD_POP && exe_cmdex == `CMDEX_POP_modregrm_STEP_1);
    
    SET(offset_pop);

    SET(exe_result, exe_buffer);
ENDIF();
</execute>

<write>
IF(wr_cmd == `CMD_POP && wr_cmdex == `CMDEX_POP_implicit);
    SET(write_regrm);
    
    SAVE(esp, wr_stack_esp);
ENDIF();
</write>

<write>
IF(wr_cmd == `CMD_POP && wr_cmdex == `CMDEX_POP_modregrm_STEP_0);
    SET(wr_not_finished);

    SAVE(esp, wr_stack_esp);
    
    SET(wr_make_esp_speculative);
ENDIF();
</write>

<write>
IF(wr_cmd == `CMD_POP && wr_cmdex == `CMDEX_POP_modregrm_STEP_1);
    IF(wr_dst_is_memory && ~(write_for_wr_ready)); SET(wr_waiting); ENDIF();
    
    SET(write_regrm,     wr_dst_is_rm);
    SET(write_virtual,   wr_dst_is_memory);
    
    IF(~(wr_dst_is_memory) || write_for_wr_ready);
        SET(wr_make_esp_commit);
    ENDIF();
ENDIF();  
</write>

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.