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

Subversion Repositories ao486

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 alfik
 
2
3
`define CMD_LOOP        #AUTOGEN_NEXT_CMD
4
 
5
`define CMDEX_LOOP_NE               4'd0
6
`define CMDEX_LOOP_E                4'd1
7
`define CMDEX_LOOP                  4'd2
8
9
 
10
11
dec_ready_one_one && (decoder[7:0] == 8'hE0 || decoder[7:0] == 8'hE1 || decoder[7:0] == 8'hE2)
12
`CMD_LOOP
13
SET(dec_cmdex,
14
    (decoder[1:0] == 2'b00)? `CMDEX_LOOP_NE :
15
    (decoder[1:0] == 2'b01)? `CMDEX_LOOP_E :
16
                             `CMDEX_LOOP);
17
SET(dec_is_8bit);
18
SET(consume_one_one);
19
20
 
21
22
wire exe_cmd_loop_ecx;
23
wire exe_cmd_loop_condition;
24
 
25
assign exe_cmd_loop_ecx = (exe_address_16bit)? ecx[15:0] != 16'd1 : ecx != 32'd1;
26
 
27
assign exe_cmd_loop_condition =
28
    (exe_cmdex == `CMDEX_LOOP_NE)?  exe_cmd_loop_ecx && zflag == `FALSE :
29
    (exe_cmdex == `CMDEX_LOOP_E)?   exe_cmd_loop_ecx && zflag == `TRUE :
30
                                    exe_cmd_loop_ecx;
31
32
 
33
34
IF(rd_cmd == `CMD_LOOP);
35
    SET(rd_req_ecx);
36
ENDIF();
37
38
 
39
40
IF(exe_cmd == `CMD_LOOP);
41
    IF(exe_mutex_current[`MUTEX_ECX_BIT] || (exe_mutex_current[`MUTEX_EFLAGS_BIT] && (exe_cmdex == `CMDEX_LOOP_NE || exe_cmdex == `CMDEX_LOOP_E))); SET(exe_waiting);
42
    ELSE();
43
        IF(exe_cmd_loop_condition && exe_branch_eip > cs_limit);
44
            SET(exe_waiting);
45
            SET(exe_trigger_gp_fault); //exception GP(0)
46
        ENDIF();
47
 
48
        SET(exe_branch,         exe_cmd_loop_condition);
49
        SET(exe_result_signals, { 4'd0, exe_cmd_loop_condition });
50
    ENDIF();
51
ENDIF();
52
53
 
54
55
wire [31:0] wr_ecx_minus_1;
56
 
57
assign wr_ecx_minus_1 = ecx - 32'd1;
58
59
 
60
61
IF(wr_cmd == `CMD_LOOP);
62
    IF(wr_address_16bit);   SAVE(ecx, { ecx[31:16], wr_ecx_minus_1[15:0] });
63
    ELSE();                 SAVE(ecx, wr_ecx_minus_1);
64
    ENDIF();
65
 
66
    IF(result_signals[0]);
67
        // clear pipeline
68
        SET(wr_req_reset_pr);
69
        SET(wr_req_reset_dec);
70
        SET(wr_req_reset_micro);
71
        SET(wr_req_reset_rd);
72
        SET(wr_req_reset_exe);
73
    ENDIF();
74
ENDIF();
75

powered by: WebSVN 2.1.0

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