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

Subversion Repositories ao486

[/] [ao486/] [trunk/] [rtl/] [ao486/] [commands/] [CMD_IN.txt] - Blame information for rev 6

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

Line No. Rev Author Line
1 2 alfik
 
2
 
3
4
`define CMD_IN          #AUTOGEN_NEXT_CMD
5
 
6
`define CMDEX_IN_imm            4'd0
7
`define CMDEX_IN_dx             4'd1
8
 
9
`define CMDEX_IN_protected      4'd2
10
 
11
`define CMDEX_IN_idle           4'd3
12
13
 
14
15
(dec_ready_one && { decoder[7:1], 1'b0 } == 8'hEC) || (dec_ready_one_one && { decoder[7:1], 1'b0 } == 8'hE4)
16
`CMD_IN
17
IF(decoder[3]); SET(dec_cmdex, `CMDEX_IN_dx); ELSE(); SET(dec_cmdex, `CMDEX_IN_imm); ENDIF();
18
IF(decoder[0] == 1'b0); SET(dec_is_8bit); ENDIF();
19
IF(decoder[3] == 1'b1); SET(consume_one); ELSE(); SET(consume_one_one); ENDIF();
20
SET(dec_is_complex);
21
22
 
23
24
IF(mc_cmd == `CMD_IN && (mc_cmdex_last == `CMDEX_IN_imm || mc_cmdex_last == `CMDEX_IN_dx) && ~(io_allow_check_needed));
25
    LOOP(`CMDEX_IN_idle);
26
ENDIF();
27
 
28
IF(mc_cmd == `CMD_IN && (mc_cmdex_last == `CMDEX_IN_imm || mc_cmdex_last == `CMDEX_IN_dx) && io_allow_check_needed);
29
    CALL(`CMDEX_io_allow_1);
30
    `CMDEX_IN_protected
31
    LOOP(`CMDEX_IN_idle);
32
ENDIF();
33
34
 
35
36
wire rd_in_condition;
37
 
38
assign rd_in_condition =
39
    (rd_mutex_busy_active && (rd_cmdex == `CMDEX_IN_imm || rd_cmdex == `CMDEX_IN_dx) && ~(io_allow_check_needed)) ||
40
    (rd_cmdex == `CMDEX_IN_dx && rd_mutex_busy_edx);
41
42
 
43
44
IF(rd_cmd == `CMD_IN && rd_cmdex != `CMDEX_IN_idle);
45
 
46
    SET(io_read_address, (rd_cmdex == `CMDEX_IN_imm)? { 8'd0, rd_decoder[15:8] } : (rd_cmdex == `CMDEX_IN_protected)? glob_param_1[15:0] : edx[15:0]);
47
 
48
    IF(rd_in_condition); SET(rd_waiting);
49
    ELSE();
50
 
51
        IF(~(io_allow_check_needed) || rd_cmdex == `CMDEX_IN_protected);
52
            SET(rd_src_is_io);
53
 
54
            SET(io_read);
55
 
56
            //not required: SET(rd_req_eax);
57
 
58
            IF(~(rd_io_ready)); SET(rd_waiting); ENDIF();
59
        ENDIF();
60
    ENDIF();
61
ENDIF();
62
63
 
64
65
IF(exe_cmd == `CMD_IN && exe_cmdex == `CMDEX_IN_protected);
66
    SET(exe_result2, src);
67
ENDIF();
68
69
 
70
71
IF(exe_cmd == `CMD_IN && (exe_cmdex == `CMDEX_IN_dx || exe_cmdex == `CMDEX_IN_imm));
72
    SET(exe_result2, src);
73
 
74
    IF(exe_cmdex == `CMDEX_IN_dx && exe_mutex_current[`MUTEX_EDX_BIT]); SET(exe_waiting);
75
    ELSE();
76
        SET(exe_glob_param_1_set);
77
        SET(exe_glob_param_1_value, (exe_cmdex == `CMDEX_IN_dx)? { 16'd0, edx[15:0] } : { 24'd0, exe_decoder[15:8] });
78
    ENDIF();
79
ENDIF();
80
81
 
82
83
IF(wr_cmd == `CMD_IN); // all CMDEX
84
 
85
    IF(~(io_allow_check_needed) || wr_cmdex == `CMDEX_IN_protected);
86
 
87
        SAVE(eax, (wr_is_8bit)? { eax[31:8], result2[7:0] } : (wr_operand_16bit)? { eax[31:16], result2[15:0] } : result2);
88
 
89
        // reset pipeline
90
        SET(wr_req_reset_micro);
91
        SET(wr_req_reset_rd);
92
        SET(wr_req_reset_exe);
93
    ELSE();
94
        SET(wr_not_finished);
95
    ENDIF();
96
ENDIF();
97
98
 

powered by: WebSVN 2.1.0

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