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

Subversion Repositories ao486

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

Compare with Previous | Blame | View Log


<defines>
`define CMD_CMPS        #AUTOGEN_NEXT_CMD

`define CMDEX_CMPS_FIRST    4'd0
`define CMDEX_CMPS_LAST     4'd1
</defines>

<decode>
dec_ready_one && { decoder[7:1], 1'b0 } == 8'hA6
`CMD_CMPS
SET(dec_cmdex,`CMDEX_CMPS_FIRST);
IF(decoder[0] == 1'b0); SET(dec_is_8bit); ENDIF();
SET(consume_one);
SET(dec_is_complex);
</decode>

<microcode>
IF(`CMDEX_CMPS_FIRST);
    `CMDEX_CMPS_LAST
ENDIF();

IF(`CMDEX_CMPS_LAST);
    `CMDEX_CMPS_FIRST
ENDIF();
</microcode>

<read>
IF(rd_cmd == `CMD_CMPS && rd_cmdex == `CMDEX_CMPS_FIRST);
            
    SET(address_esi);

    //waiting for esi in 'address_waiting'
    
    IF(rd_mutex_busy_memory || (rd_mutex_busy_ecx && rd_prefix_group_1_rep != 2'd0)); SET(rd_waiting); //waiting for ecx for rd_ignore_string
    ELSE();
        
        IF(~(rd_string_ignore)); 
            SET(rd_src_is_memory);
            
            SET(rd_req_eflags);
            SET(rd_req_esi);
            SET(rd_req_edi);
            //not needed -- reset after finish //IF(rd_prefix_group_1_rep != 2'd0); SET(rd_req_ecx); ENDIF();
        
            SET(read_virtual);

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

<read>
IF(rd_cmd == `CMD_CMPS && rd_cmdex == `CMDEX_CMPS_LAST);
            
    SET(address_edi);

    //waiting for edi in 'address_waiting'
    
    IF(~(rd_string_ignore));
        SET(rd_src_is_memory);
        SET(rd_dst_is_memory_last);
        
        SET(rd_req_eflags);
        SET(rd_req_esi);
        SET(rd_req_edi);
        //not needed -- reset after finish //IF(rd_prefix_group_1_rep != 2'd0); SET(rd_req_ecx); ENDIF();
        
        SET(read_virtual);

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

<execute>
IF(exe_cmd == `CMD_CMPS);
    
    SET(exe_result, exe_arith_sub[31:0]);
    SET(exe_arith_index, (`ARITH_VALID | `ARITH_SUB));
ENDIF();
</execute>

<write>
IF(wr_cmd == `CMD_CMPS && wr_cmdex == `CMDEX_CMPS_FIRST);
    SET(wr_not_finished);
ENDIF();
</write>

<write>
IF(wr_cmd == `CMD_CMPS && wr_cmdex == `CMDEX_CMPS_LAST);
    
    IF(~(wr_string_ignore));
        SAVE(esi, wr_esi_final);
        SAVE(edi, wr_edi_final);
        IF(wr_prefix_group_1_rep != 2'd0); SAVE(ecx, wr_ecx_final); ENDIF();

        SAVE(zflag, zflag_result);
        SAVE(sflag, sflag_result);
        SAVE(pflag, pflag_result);

        SAVE(aflag, aflag_arith);
        SAVE(cflag, cflag_arith);
        SAVE(oflag, oflag_arith);
    ENDIF();
    
    IF(wr_string_ignore || wr_string_zf_finish || wr_prefix_group_1_rep == 2'd0);
        SET(wr_req_reset_micro);
        SET(wr_req_reset_rd);
        SET(wr_req_reset_exe);
    ENDIF();
    
    IF(~(wr_string_ignore) && ~(wr_string_zf_finish) && wr_prefix_group_1_rep != 2'd0);
        SET(wr_not_finished);
        
        SET(wr_string_in_progress);
    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.