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

Subversion Repositories ao486

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 alfik
 
2
3
`define CMD_io_allow    #AUTOGEN_NEXT_CMD
4
// glob_param_1[15:0] - IO address
5
 
6
//NOTE: CMDEX_IO_ALLOW_1 does not use port number in exe_buffer
7
 
8
`define CMDEX_io_allow_1        4'd0
9
`define CMDEX_io_allow_2        4'd1
10
11
 
12
13
`CMDEX_io_allow_1
14
`CMDEX_io_allow_2
15
RETURN();
16
17
 
18
19
wire rd_io_allow_1_fault;
20
wire rd_io_allow_2_fault;
21
 
22
assign rd_io_allow_1_fault =
23
    rd_cmd == `CMD_io_allow && rd_cmdex == `CMDEX_io_allow_1 &&
24
    (   ~(tr_cache_valid) ||
25
        (tr_cache[`DESC_BITS_TYPE] != `DESC_TSS_AVAIL_386 && tr_cache[`DESC_BITS_TYPE] != `DESC_TSS_BUSY_386) ||
26
        tr_limit < 32'd103
27
    );
28
 
29
assign rd_io_allow_2_fault =
30
    rd_cmd == `CMD_io_allow && rd_cmdex == `CMDEX_io_allow_2 &&
31
    ({ 16'd0, rd_memory_last[15:0] } + { 16'd0, 3'd0, glob_param_1[15:3] }) >= tr_limit;
32
 
33
assign rd_io_allow_fault = rd_io_allow_1_fault || rd_io_allow_2_fault;
34
35
 
36
37
IF(rd_cmd == `CMD_io_allow && rd_cmdex == `CMDEX_io_allow_1);
38
 
39
    SET(rd_system_linear, tr_base + 32'd102);
40
 
41
    IF(rd_io_allow_1_fault || rd_mutex_busy_active); SET(rd_waiting); // read only when last operation finished
42
    ELSE();
43
        // memory read saved to rd_memory_last
44
 
45
        SET(read_system_word);
46
 
47
        IF(~(read_for_rd_ready)); SET(rd_waiting); ENDIF();
48
    ENDIF();
49
ENDIF();
50
51
 
52
53
IF(rd_cmd == `CMD_io_allow && rd_cmdex == `CMDEX_io_allow_2);
54
 
55
    SET(rd_system_linear, tr_base + { 16'd0, rd_memory_last[15:0] } + { 16'd0, 3'd0, glob_param_1[15:3] });
56
 
57
    IF(rd_io_allow_2_fault); SET(rd_waiting);
58
    ELSE();
59
        SET(rd_src_is_memory);
60
 
61
        SET(read_system_word);
62
 
63
        IF(~(read_for_rd_ready)); SET(rd_waiting); ENDIF();
64
    ENDIF();
65
ENDIF();
66
67
 
68
69
wire [3:0] e_io_allow_bits;
70
 
71
assign e_io_allow_bits =
72
    (glob_param_1[2:0] == 3'd0)?  src[3:0] :
73
    (glob_param_1[2:0] == 3'd1)?  src[4:1] :
74
    (glob_param_1[2:0] == 3'd2)?  src[5:2] :
75
    (glob_param_1[2:0] == 3'd3)?  src[6:3] :
76
    (glob_param_1[2:0] == 3'd4)?  src[7:4] :
77
    (glob_param_1[2:0] == 3'd5)?  src[8:5] :
78
    (glob_param_1[2:0] == 3'd6)?  src[9:6] :
79
                                src[10:7];
80
81
 
82
83
IF(exe_cmd == `CMD_io_allow && exe_cmdex == `CMDEX_io_allow_2);
84
 
85
    IF((  exe_is_8bit                       && e_io_allow_bits[0]   != 1'd0) ||
86
       (~(exe_is_8bit) && exe_operand_16bit && e_io_allow_bits[1:0] != 2'd0) ||
87
       (~(exe_is_8bit) && exe_operand_32bit && e_io_allow_bits[3:0] != 4'd0));
88
 
89
        SET(exe_waiting);
90
        SET(exe_trigger_gp_fault); //exception GP(0)
91
    ENDIF();
92
ENDIF();
93
94
 
95
96
IF(wr_cmd == `CMD_io_allow && (wr_cmdex == `CMDEX_io_allow_1 || wr_cmdex == `CMDEX_io_allow_2));
97
    SET(wr_not_finished);
98
ENDIF();
99

powered by: WebSVN 2.1.0

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