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

Subversion Repositories ao486

[/] [ao486/] [trunk/] [rtl/] [ao486/] [commands/] [CMD_LGDT_LIDT.txt] - Rev 2

Compare with Previous | Blame | View Log


<defines>
`define CMD_LGDT        #AUTOGEN_NEXT_CMD

`define CMD_LIDT        #AUTOGEN_NEXT_CMD

`define CMDEX_LGDT_LIDT_STEP_1      4'd8
`define CMDEX_LGDT_LIDT_STEP_2      4'd9
`define CMDEX_LGDT_LIDT_STEP_LAST   4'd10
</defines>

<decode>
dec_ready_2byte_modregrm && decoder[7:0] == 8'h01 && decoder[13:11] == 3'd2
prefix_group_1_lock || `DEC_MODREGRM_IS_MOD_11
`CMD_LGDT
SET(dec_cmdex, `CMDEX_LGDT_LIDT_STEP_1);
SET(consume_modregrm_one);
SET(dec_is_complex);
</decode>

<decode>
dec_ready_2byte_modregrm && decoder[7:0] == 8'h01 && decoder[13:11] == 3'd3
prefix_group_1_lock || `DEC_MODREGRM_IS_MOD_11
`CMD_LIDT
SET(dec_cmdex, `CMDEX_LGDT_LIDT_STEP_1);
SET(consume_modregrm_one);
SET(dec_is_complex);
</decode>

<microcode>
IF((mc_cmd == `CMD_LGDT || mc_cmd == `CMD_LIDT) && mc_cmdex_last == `CMDEX_LGDT_LIDT_STEP_1);
    DIRECT(mc_cmd, `CMDEX_LGDT_LIDT_STEP_2);
ENDIF();

IF((mc_cmd == `CMD_LGDT || mc_cmd == `CMD_LIDT) && mc_cmdex_last == `CMDEX_LGDT_LIDT_STEP_2);
    DIRECT(mc_cmd, `CMDEX_LGDT_LIDT_STEP_LAST);
ENDIF();

IF((mc_cmd == `CMD_LGDT || mc_cmd == `CMD_LIDT) && mc_cmdex_last == `CMDEX_LGDT_LIDT_STEP_LAST);
    DIRECT(mc_cmd, `CMDEX_LGDT_LIDT_STEP_LAST);
ENDIF();
</microcode>

<read>
IF((rd_cmd == `CMD_LGDT || rd_cmd == `CMD_LIDT) && (rd_cmdex == `CMDEX_LGDT_LIDT_STEP_1 || rd_cmdex == `CMDEX_LGDT_LIDT_STEP_2));
    
    IF(rd_cmdex == `CMDEX_LGDT_LIDT_STEP_1);
        SET(read_length_word);
    ENDIF();

    SET(address_ea_buffer_plus_2);

    IF(rd_cmdex == `CMDEX_LGDT_LIDT_STEP_2);
        SET(address_ea_buffer);
        SET(read_length_dword);
    ENDIF();

    IF(cpl == 2'd0);
    
        SET(rd_src_is_memory);
    
        IF(rd_mutex_busy_memory); SET(rd_waiting);
        ELSE();
            SET(read_virtual);

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

<execute>
IF(exe_cmd == `CMD_LGDT || exe_cmd == `CMD_LIDT);

    SET(exe_result2, src);

    IF(cpl != 2'd0);
        SET(exe_waiting);
        SET(exe_trigger_gp_fault); //exception GP(val)
    ENDIF();
ENDIF();
</execute>

<write>
IF((wr_cmd == `CMD_LGDT || wr_cmd == `CMD_LIDT));
    IF(wr_cmdex == `CMDEX_LGDT_LIDT_STEP_1); SET(wr_not_finished); ENDIF();

    IF(wr_cmd == `CMD_LGDT);
        IF(wr_cmdex == `CMDEX_LGDT_LIDT_STEP_1);
            SAVE(gdtr_limit, result2[15:0]);
        ELSE();
            SAVE(gdtr_base, wr_operand_32bit? result2 : { 8'd0, result2[23:0] });
        ENDIF();
    ENDIF();
    
    IF(wr_cmd == `CMD_LIDT);
        IF(wr_cmdex == `CMDEX_LGDT_LIDT_STEP_1);
            SAVE(idtr_limit, result2[15:0]);
        ELSE();
            SAVE(idtr_base, wr_operand_32bit? result2 : { 8'd0, result2[23:0] });
        ENDIF();
    ENDIF();
    
    IF(wr_cmdex == `CMDEX_LGDT_LIDT_STEP_2);
        // clear pipeline
        SET(wr_req_reset_micro);
        SET(wr_req_reset_rd);
        SET(wr_req_reset_exe);
    ELSE();
        SET(wr_not_finished);
    ENDIF();
ENDIF();
</write>

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.