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

Subversion Repositories ao486

[/] [ao486/] [trunk/] [rtl/] [ao486/] [commands/] [CMD_Shift.txt] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 alfik
 
2
3
`define CMD_Shift       #AUTOGEN_NEXT_CMD
4
 
5
`define CMDEX_Shift_implicit        4'd0
6
`define CMDEX_Shift_modregrm        4'd1
7
`define CMDEX_Shift_modregrm_imm    4'd2
8
9
 
10
11
dec_ready_modregrm_one && { decoder[7:2], 2'b0 } == 8'hD0
12
`CMD_Shift
13
IF(decoder[1]); SET(dec_cmdex, `CMDEX_Shift_implicit); ELSE(); SET(dec_cmdex, `CMDEX_Shift_modregrm); ENDIF();
14
IF(decoder[0] == 1'b0); SET(dec_is_8bit); ENDIF();
15
SET(consume_modregrm_one);
16
17
 
18
19
dec_ready_modregrm_imm && { decoder[7:1], 1'b0 } == 8'hC0
20
`CMD_Shift
21
SET(dec_cmdex, `CMDEX_Shift_modregrm_imm);
22
IF(decoder[0] == 1'b0); SET(dec_is_8bit); ENDIF();
23
SET(consume_modregrm_imm);
24
25
 
26
27
IF(rd_cmd == `CMD_Shift && rd_cmdex != `CMDEX_Shift_implicit);
28
 
29
    SET(rd_src_is_modregrm_imm, rd_cmdex == `CMDEX_Shift_modregrm_imm);
30
    SET(rd_src_is_1,            rd_cmdex == `CMDEX_Shift_modregrm);
31
 
32
    SET(rd_req_eflags);
33
 
34
    // dst: reg, src: imm or 1
35
    IF(rd_modregrm_mod == 2'b11);
36
 
37
        SET(rd_dst_is_rm);
38
 
39
        SET(rd_req_rm);
40
 
41
        IF(rd_mutex_busy_modregrm_rm); SET(rd_waiting); ENDIF();
42
    ENDIF();
43
 
44
    // dst: memory, src: imm or 1
45
    IF(rd_modregrm_mod != 2'b11);
46
 
47
        SET(rd_dst_is_memory);
48
 
49
        SET(rd_req_memory);
50
 
51
        IF(rd_mutex_busy_memory); SET(rd_waiting);
52
        ELSE();
53
            SET(read_rmw_virtual);
54
 
55
            IF(~(read_for_rd_ready)); SET(rd_waiting); ENDIF();
56
        ENDIF();
57
    ENDIF();
58
ENDIF();
59
60
 
61
62
IF(rd_cmd == `CMD_Shift && rd_cmdex == `CMDEX_Shift_implicit);
63
 
64
    SET(rd_src_is_ecx);
65
 
66
    SET(rd_req_eflags);
67
 
68
    // dst: reg, src: CL
69
    IF(rd_modregrm_mod == 2'b11);
70
 
71
        SET(rd_dst_is_rm);
72
 
73
        SET(rd_req_rm);
74
 
75
        IF(rd_mutex_busy_modregrm_rm || rd_mutex_busy_ecx); SET(rd_waiting); ENDIF();
76
    ENDIF();
77
 
78
    // dst: memory, src: imm or 1
79
    IF(rd_modregrm_mod != 2'b11);
80
 
81
        SET(rd_dst_is_memory);
82
 
83
        SET(rd_req_memory);
84
 
85
        IF(rd_mutex_busy_memory || rd_mutex_busy_ecx); SET(rd_waiting);
86
        ELSE();
87
            SET(read_rmw_virtual);
88
 
89
            IF(~(read_for_rd_ready)); SET(rd_waiting); ENDIF();
90
        ENDIF();
91
    ENDIF();
92
ENDIF();
93
94
 
95
96
IF(exe_cmd == `CMD_Shift && exe_decoder[13:12] == 2'b01);
97
 
98
    SET(exe_result, e_shift_result);
99
    SET(exe_result_signals, { e_shift_no_write, e_shift_oszapc_update, e_shift_cf_of_update, e_shift_oflag, e_shift_cflag });
100
 
101
    IF(exe_mutex_current[`MUTEX_EFLAGS_BIT]); SET(exe_waiting); ENDIF();
102
ENDIF();
103
104
 
105
106
IF(exe_cmd == `CMD_Shift && exe_decoder[13:12] != 2'b01);
107
 
108
    SET(exe_result, e_shift_result);
109
    SET(exe_result_signals, { e_shift_no_write, e_shift_oszapc_update, e_shift_cf_of_update, e_shift_oflag, e_shift_cflag });
110
ENDIF();
111
112
 
113
114
IF(wr_cmd == `CMD_Shift);
115
 
116
    // result_signals
117
    // { e_shift_no_write, e_shift_oszapc_update, e_shift_cf_of_update, e_shift_oflag, e_shift_cflag }
118
 
119
    IF(~(result_signals[4])); //e_shift_no_write
120
        IF(wr_dst_is_memory && ~(write_for_wr_ready)); SET(wr_waiting); ENDIF();
121
 
122
        SET(write_regrm,         wr_dst_is_rm);
123
        SET(write_rmw_virtual,   wr_dst_is_memory);
124
    ENDIF();
125
 
126
    IF(result_signals[3]); //e_shift_oszapc_update
127
        SAVE(zflag, zflag_result);
128
        SAVE(sflag, sflag_result);
129
        SAVE(pflag, pflag_result);
130
        SAVE(aflag, aflag_arith);
131
    ENDIF();
132
 
133
    IF(result_signals[2]); //e_shift_cf_of_update
134
        SAVE(cflag, result_signals[0]);
135
        SAVE(oflag, result_signals[1]);
136
    ENDIF();
137
ENDIF();
138

powered by: WebSVN 2.1.0

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