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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [or1ksim/] [cpu/] [dlx/] [execute.c] - Diff between revs 30 and 123

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 30 Rev 123
Line 171... Line 171...
   #n           - immediate n
   #n           - immediate n
   rXX          - register direct
   rXX          - register direct
   XX           - relative or absolute address (labels)
   XX           - relative or absolute address (labels)
   n(XX)        - register indirect (with displacement) */
   n(XX)        - register indirect (with displacement) */
 
 
machword eval_operand(char *srcoperand)
machword eval_operand(char *srcoperand,int* breakpoint)
{
{
        char operand[OPERANDNAME_LEN];
        char operand[OPERANDNAME_LEN];
 
 
        strcpy(operand, srcoperand);
        strcpy(operand, srcoperand);
 
 
Line 196... Line 196...
                disp = atoi(operand);   /* operand == "nn(rXX)" */
                disp = atoi(operand);   /* operand == "nn(rXX)" */
                regstr = strstr(operand, "(r") + 1;     /* regstr == "rXX)" */
                regstr = strstr(operand, "(r") + 1;     /* regstr == "rXX)" */
                *strstr(regstr, ")") = '\0';            /* regstr == "rXX" */
                *strstr(regstr, ")") = '\0';            /* regstr == "rXX" */
                memaddr = eval_reg(regstr) + disp;
                memaddr = eval_reg(regstr) + disp;
 
 
                return eval_mem32(memaddr);
                return eval_mem32(memaddr,breakpoint);
        }
        }
 
 
        return 0;
        return 0;
}
}
 
 
/* Implementation specific.
/* Implementation specific.
   Set destination operand (register direct, register indirect
   Set destination operand (register direct, register indirect
   (with displacement) with value. */
   (with displacement) with value. */
 
 
void set_operand(char *dstoperand, unsigned long value)
void set_operand(char *dstoperand, unsigned long value,int* breakpoint)
{
{
        char operand[OPERANDNAME_LEN];
        char operand[OPERANDNAME_LEN];
 
 
        strcpy(operand, dstoperand);
        strcpy(operand, dstoperand);
 
 
Line 230... Line 230...
                disp = atoi(operand);   /* operand == "nn(rXX)" */
                disp = atoi(operand);   /* operand == "nn(rXX)" */
                regstr = strstr(operand, "(r") + 1;     /* regstr == "rXX)" */
                regstr = strstr(operand, "(r") + 1;     /* regstr == "rXX)" */
                *strstr(regstr, ")") = '\0';            /* regstr == "rXX" */
                *strstr(regstr, ")") = '\0';            /* regstr == "rXX" */
                memaddr = eval_reg(regstr) + disp;
                memaddr = eval_reg(regstr) + disp;
 
 
                set_mem32(memaddr, value);
                set_mem32(memaddr, value, breakpoint);
        }
        }
 
 
        return;
        return;
}
}
 
 
Line 282... Line 282...
        return;
        return;
}
}
 
 
void decode(struct iqueue_entry *cur)
void decode(struct iqueue_entry *cur)
{
{
 
  int breakpoint = 0;
 
 
        cur->dependdst = cur->op1;
        cur->dependdst = cur->op1;
        cur->dependsrc1 = cur->op2;     /* for calculating register */
        cur->dependsrc1 = cur->op2;     /* for calculating register */
        cur->dependsrc2 = cur->op3;     /* dependency */
        cur->dependsrc2 = cur->op3;     /* dependency */
 
 
        cur->func_unit = unknown;
        cur->func_unit = unknown;
 
 
        if (strcmp(cur->insn, "sw") == 0) {
        if (strcmp(cur->insn, "sw") == 0) {
                cur->func_unit = store;
                cur->func_unit = store;
                set_operand(cur->op1, eval_operand(cur->op2));
                set_operand(cur->op1, eval_operand(cur->op2,&breakpoint),&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "sb") == 0) {
        if (strcmp(cur->insn, "sb") == 0) {
                cur->func_unit = store;
                cur->func_unit = store;
                set_operand(cur->op1, (eval_operand(cur->op2) << 24) + (eval_operand(cur->op1) & 0xffffff));
                set_operand(cur->op1, (eval_operand(cur->op2,&breakpoint) << 24) + (eval_operand(cur->op1,&breakpoint) & 0xffffff),&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "sh") == 0) {
        if (strcmp(cur->insn, "sh") == 0) {
                cur->func_unit = store;
                cur->func_unit = store;
                set_operand(cur->op1, (eval_operand(cur->op2) << 16) + (eval_operand(cur->op1) & 0xffff));
                set_operand(cur->op1, (eval_operand(cur->op2,&breakpoint) << 16) + (eval_operand(cur->op1,&breakpoint) & 0xffff),&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "lw") == 0) {
        if (strcmp(cur->insn, "lw") == 0) {
                cur->func_unit = load;
                cur->func_unit = load;
                set_operand(cur->op1, eval_operand(cur->op2));
                set_operand(cur->op1, eval_operand(cur->op2,&breakpoint),&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "lb") == 0) {
        if (strcmp(cur->insn, "lb") == 0) {
                signed char temp = (eval_operand(cur->op2) >> 24);
                signed char temp = (eval_operand(cur->op2,&breakpoint) >> 24);
                cur->func_unit = load;
                cur->func_unit = load;
                set_operand(cur->op1, temp);
                set_operand(cur->op1, temp,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "lbu") == 0) {
        if (strcmp(cur->insn, "lbu") == 0) {
                unsigned char temp = (eval_operand(cur->op2) >> 24);
                unsigned char temp = (eval_operand(cur->op2,&breakpoint) >> 24);
                cur->func_unit = load;
                cur->func_unit = load;
                set_operand(cur->op1, temp);
                set_operand(cur->op1, temp,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "lh") == 0) {
        if (strcmp(cur->insn, "lh") == 0) {
                signed short temp = (eval_operand(cur->op2) >> 16);
                signed short temp = (eval_operand(cur->op2,&breakpoint) >> 16);
                cur->func_unit = load;
                cur->func_unit = load;
                set_operand(cur->op1, temp);
                set_operand(cur->op1, temp,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "lhu") == 0) {
        if (strcmp(cur->insn, "lhu") == 0) {
                unsigned short temp = (eval_operand(cur->op2) >> 16);
                unsigned short temp = (eval_operand(cur->op2,&breakpoint) >> 16);
                cur->func_unit = load;
                cur->func_unit = load;
                set_operand(cur->op1, temp);
                set_operand(cur->op1, temp,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "lwi") == 0) {
        if (strcmp(cur->insn, "lwi") == 0) {
                cur->func_unit = movimm;
                cur->func_unit = movimm;
                set_operand(cur->op1, eval_operand(cur->op2));
                set_operand(cur->op1, eval_operand(cur->op2,&breakpoint),&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "lhi") == 0) {
        if (strcmp(cur->insn, "lhi") == 0) {
                cur->func_unit = movimm;
                cur->func_unit = movimm;
                set_operand(cur->op1, eval_operand(cur->op2) << 16);
                set_operand(cur->op1, eval_operand(cur->op2,&breakpoint) << 16,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "and") == 0) {
        if (strcmp(cur->insn, "and") == 0) {
                cur->func_unit = arith;
                cur->func_unit = arith;
                set_operand(cur->op1, eval_operand(cur->op2) & eval_operand(cur->op3));
                set_operand(cur->op1, eval_operand(cur->op2,&breakpoint) & eval_operand(cur->op3,&breakpoint),&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "andi") == 0) {
        if (strcmp(cur->insn, "andi") == 0) {
                cur->func_unit = arith;
                cur->func_unit = arith;
                set_operand(cur->op1, eval_operand(cur->op2) & eval_operand(cur->op3));
                set_operand(cur->op1, eval_operand(cur->op2,&breakpoint) & eval_operand(cur->op3,&breakpoint),&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "or") == 0) {
        if (strcmp(cur->insn, "or") == 0) {
                cur->func_unit = arith;
                cur->func_unit = arith;
                set_operand(cur->op1, eval_operand(cur->op2) | eval_operand(cur->op3));
                set_operand(cur->op1, eval_operand(cur->op2,&breakpoint) | eval_operand(cur->op3,&breakpoint),&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "ori") == 0) {
        if (strcmp(cur->insn, "ori") == 0) {
                cur->func_unit = arith;
                cur->func_unit = arith;
                set_operand(cur->op1, eval_operand(cur->op2) | eval_operand(cur->op3));
                set_operand(cur->op1, eval_operand(cur->op2,&breakpoint) | eval_operand(cur->op3,&breakpoint),&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "xor") == 0) {
        if (strcmp(cur->insn, "xor") == 0) {
                cur->func_unit = arith;
                cur->func_unit = arith;
                set_operand(cur->op1, eval_operand(cur->op2) ^ eval_operand(cur->op3));
                set_operand(cur->op1, eval_operand(cur->op2,&breakpoint) ^ eval_operand(cur->op3,&breakpoint),&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "add") == 0) {
        if (strcmp(cur->insn, "add") == 0) {
                signed long temp3, temp2, temp1;
                signed long temp3, temp2, temp1;
                signed char temp4;
                signed char temp4;
 
 
                cur->func_unit = arith;
                cur->func_unit = arith;
                temp3 = eval_operand(cur->op3);
                temp3 = eval_operand(cur->op3,&breakpoint);
                temp2 = eval_operand(cur->op2);
                temp2 = eval_operand(cur->op2,&breakpoint);
                temp1 = temp2 + temp3;
                temp1 = temp2 + temp3;
                set_operand(cur->op1, temp1);
                set_operand(cur->op1, temp1,&breakpoint);
 
 
                temp4 = temp1;
                temp4 = temp1;
                if (temp4 == temp1)
                if (temp4 == temp1)
                        mstats.byteadd++;
                        mstats.byteadd++;
        } else
        } else
        if (strcmp(cur->insn, "addi") == 0) {
        if (strcmp(cur->insn, "addi") == 0) {
                signed long temp3, temp2, temp1;
                signed long temp3, temp2, temp1;
                signed char temp4;
                signed char temp4;
 
 
                cur->func_unit = arith;
                cur->func_unit = arith;
                temp3 = eval_operand(cur->op3);
                temp3 = eval_operand(cur->op3,&breakpoint);
                temp2 = eval_operand(cur->op2);
                temp2 = eval_operand(cur->op2,&breakpoint);
                temp1 = temp2 + temp3;
                temp1 = temp2 + temp3;
                set_operand(cur->op1, temp1);
                set_operand(cur->op1, temp1,&breakpoint);
 
 
                temp4 = temp1;
                temp4 = temp1;
                if (temp4 == temp1)
                if (temp4 == temp1)
                        mstats.byteadd++;
                        mstats.byteadd++;
        } else
        } else
        if (strcmp(cur->insn, "addui") == 0) {
        if (strcmp(cur->insn, "addui") == 0) {
                unsigned long temp3, temp2, temp1;
                unsigned long temp3, temp2, temp1;
                unsigned char temp4;
                unsigned char temp4;
 
 
                cur->func_unit = arith;
                cur->func_unit = arith;
                temp3 = eval_operand(cur->op3);
                temp3 = eval_operand(cur->op3,&breakpoint);
                temp2 = eval_operand(cur->op2);
                temp2 = eval_operand(cur->op2,&breakpoint);
                temp1 = temp2 + temp3;
                temp1 = temp2 + temp3;
                set_operand(cur->op1, temp1);
                set_operand(cur->op1, temp1,&breakpoint);
 
 
                temp4 = temp1;
                temp4 = temp1;
                if (temp4 == temp1)
                if (temp4 == temp1)
                        mstats.byteadd++;
                        mstats.byteadd++;
        } else
        } else
        if (strcmp(cur->insn, "sub") == 0) {
        if (strcmp(cur->insn, "sub") == 0) {
                signed long temp3, temp2, temp1;
                signed long temp3, temp2, temp1;
 
 
                cur->func_unit = arith;
                cur->func_unit = arith;
                temp3 = eval_operand(cur->op3);
                temp3 = eval_operand(cur->op3,&breakpoint);
                temp2 = eval_operand(cur->op2);
                temp2 = eval_operand(cur->op2,&breakpoint);
                temp1 = temp2 - temp3;
                temp1 = temp2 - temp3;
                set_operand(cur->op1, temp1);
                set_operand(cur->op1, temp1,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "subui") == 0) {
        if (strcmp(cur->insn, "subui") == 0) {
                unsigned long temp3, temp2, temp1;
                unsigned long temp3, temp2, temp1;
 
 
                cur->func_unit = arith;
                cur->func_unit = arith;
                temp3 = eval_operand(cur->op3);
                temp3 = eval_operand(cur->op3,&breakpoint);
                temp2 = eval_operand(cur->op2);
                temp2 = eval_operand(cur->op2,&breakpoint);
                temp1 = temp2 - temp3;
                temp1 = temp2 - temp3;
                set_operand(cur->op1, temp1);
                set_operand(cur->op1, temp1,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "subi") == 0) {
        if (strcmp(cur->insn, "subi") == 0) {
                signed long temp3, temp2, temp1;
                signed long temp3, temp2, temp1;
 
 
                cur->func_unit = arith;
                cur->func_unit = arith;
                temp3 = eval_operand(cur->op3);
                temp3 = eval_operand(cur->op3,&breakpoint);
                temp2 = eval_operand(cur->op2);
                temp2 = eval_operand(cur->op2,&breakpoint);
                temp1 = temp2 - temp3;
                temp1 = temp2 - temp3;
                set_operand(cur->op1, temp1);
                set_operand(cur->op1, temp1,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "mul") == 0) {
        if (strcmp(cur->insn, "mul") == 0) {
                signed long temp3, temp2, temp1;
                signed long temp3, temp2, temp1;
 
 
                cur->func_unit = arith;
                cur->func_unit = arith;
                temp3 = eval_operand(cur->op3);
                temp3 = eval_operand(cur->op3,&breakpoint);
                temp2 = eval_operand(cur->op2);
                temp2 = eval_operand(cur->op2,&breakpoint);
                temp1 = temp2 * temp3;
                temp1 = temp2 * temp3;
                set_operand(cur->op1, temp1);
                set_operand(cur->op1, temp1,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "div") == 0) {
        if (strcmp(cur->insn, "div") == 0) {
                signed long temp3, temp2, temp1;
                signed long temp3, temp2, temp1;
 
 
                cur->func_unit = arith;
                cur->func_unit = arith;
                temp3 = eval_operand(cur->op3);
                temp3 = eval_operand(cur->op3,&breakpoint);
                temp2 = eval_operand(cur->op2);
                temp2 = eval_operand(cur->op2,&breakpoint);
                temp1 = temp2 / temp3;
                temp1 = temp2 / temp3;
                set_operand(cur->op1, temp1);
                set_operand(cur->op1, temp1,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "divu") == 0) {
        if (strcmp(cur->insn, "divu") == 0) {
                unsigned long temp3, temp2, temp1;
                unsigned long temp3, temp2, temp1;
 
 
                cur->func_unit = arith;
                cur->func_unit = arith;
                temp3 = eval_operand(cur->op3);
                temp3 = eval_operand(cur->op3,&breakpoint);
                temp2 = eval_operand(cur->op2);
                temp2 = eval_operand(cur->op2,&breakpoint);
                temp1 = temp2 / temp3;
                temp1 = temp2 / temp3;
                set_operand(cur->op1, temp1);
                set_operand(cur->op1, temp1,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "slli") == 0) {
        if (strcmp(cur->insn, "slli") == 0) {
                cur->func_unit = shift;
                cur->func_unit = shift;
                set_operand(cur->op1, eval_operand(cur->op2) << eval_operand(cur->op3));
                set_operand(cur->op1, eval_operand(cur->op2,&breakpoint) << eval_operand(cur->op3,&breakpoint),&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "sll") == 0) {
        if (strcmp(cur->insn, "sll") == 0) {
                cur->func_unit = shift;
                cur->func_unit = shift;
                set_operand(cur->op1, eval_operand(cur->op2) << eval_operand(cur->op3));
                set_operand(cur->op1, eval_operand(cur->op2,&breakpoint) << eval_operand(cur->op3,&breakpoint),&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "srl") == 0) {
        if (strcmp(cur->insn, "srl") == 0) {
                cur->func_unit = shift;
                cur->func_unit = shift;
                set_operand(cur->op1, eval_operand(cur->op2) >> eval_operand(cur->op3));
                set_operand(cur->op1, eval_operand(cur->op2,&breakpoint) >> eval_operand(cur->op3,&breakpoint),&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "srai") == 0) {
        if (strcmp(cur->insn, "srai") == 0) {
                cur->func_unit = shift;
                cur->func_unit = shift;
                set_operand(cur->op1, (signed)eval_operand(cur->op2) / (1 << eval_operand(cur->op3)));
                set_operand(cur->op1, (signed)eval_operand(cur->op2,&breakpoint) / (1 << eval_operand(cur->op3,&breakpoint)),&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "sra") == 0) {
        if (strcmp(cur->insn, "sra") == 0) {
                cur->func_unit = shift;
                cur->func_unit = shift;
                set_operand(cur->op1, (signed)eval_operand(cur->op2) / (1 << eval_operand(cur->op3)));
                set_operand(cur->op1, (signed)eval_operand(cur->op2,&breakpoint) / (1 << eval_operand(cur->op3,&breakpoint)),&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "jal") == 0) {
        if (strcmp(cur->insn, "jal") == 0) {
                cur->func_unit = jump;
                cur->func_unit = jump;
                pctemp = eval_operand(cur->op1);
                pctemp = eval_operand(cur->op1,&breakpoint);
                set_reg32(LINK_REG, pc + 4);
                set_reg32(LINK_REG, pc + 4);
        } else
        } else
        if (strcmp(cur->insn, "jr") == 0) {
        if (strcmp(cur->insn, "jr") == 0) {
                cur->func_unit = jump;
                cur->func_unit = jump;
                cur->dependsrc1 = cur->op1;
                cur->dependsrc1 = cur->op1;
                pctemp = eval_operand(cur->op1);
                pctemp = eval_operand(cur->op1,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "j") == 0) {
        if (strcmp(cur->insn, "j") == 0) {
                cur->func_unit = jump;
                cur->func_unit = jump;
                pctemp = eval_operand(cur->op1);
                pctemp = eval_operand(cur->op1,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "nop") == 0) {
        if (strcmp(cur->insn, "nop") == 0) {
                cur->func_unit = nop;
                cur->func_unit = nop;
        } else
        } else
        if (strcmp(cur->insn, "beqz") == 0) {
        if (strcmp(cur->insn, "beqz") == 0) {
                cur->func_unit = branch;
                cur->func_unit = branch;
                cur->dependsrc1 = cur->op1;
                cur->dependsrc1 = cur->op1;
                if (eval_operand(cur->op1) == 0) {
                if (eval_operand(cur->op1,&breakpoint) == 0) {
                        pctemp = eval_operand(cur->op2);
                        pctemp = eval_operand(cur->op2,&breakpoint);
                        mstats.beqz.taken++;
                        mstats.beqz.taken++;
                        bpb_update(cur->insn_addr, 1);
                        bpb_update(cur->insn_addr, 1);
                        btic_update(pctemp);
                        btic_update(pctemp);
                } else {
                } else {
                        mstats.beqz.nottaken++;
                        mstats.beqz.nottaken++;
Line 503... Line 504...
                }
                }
        } else
        } else
        if (strcmp(cur->insn, "bnez") == 0) {
        if (strcmp(cur->insn, "bnez") == 0) {
                cur->func_unit = branch;
                cur->func_unit = branch;
                cur->dependsrc1 = cur->op1;
                cur->dependsrc1 = cur->op1;
                if (eval_operand(cur->op1) != 0) {
                if (eval_operand(cur->op1,&breakpoint) != 0) {
                        pctemp = eval_operand(cur->op2);
                        pctemp = eval_operand(cur->op2,&breakpoint);
                        mstats.bnez.taken++;
                        mstats.bnez.taken++;
                        bpb_update(cur->insn_addr, 1);
                        bpb_update(cur->insn_addr, 1);
                        btic_update(pctemp);
                        btic_update(pctemp);
                } else {
                } else {
                        mstats.bnez.nottaken++;
                        mstats.bnez.nottaken++;
Line 516... Line 517...
                        btic_update(pc);
                        btic_update(pc);
                }
                }
        } else
        } else
        if (strcmp(cur->insn, "seq") == 0) {
        if (strcmp(cur->insn, "seq") == 0) {
                cur->func_unit = compare;
                cur->func_unit = compare;
                if (eval_operand(cur->op2) == eval_operand(cur->op3))
                if (eval_operand(cur->op2,&breakpoint) == eval_operand(cur->op3,&breakpoint))
                        set_operand(cur->op1, 1);
                        set_operand(cur->op1, 1,&breakpoint);
                else
                else
                        set_operand(cur->op1, 0);
                        set_operand(cur->op1, 0,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "snei") == 0) {
        if (strcmp(cur->insn, "snei") == 0) {
                cur->func_unit = compare;
                cur->func_unit = compare;
                if (eval_operand(cur->op2) != eval_operand(cur->op3))
                if (eval_operand(cur->op2,&breakpoint) != eval_operand(cur->op3,&breakpoint))
                        set_operand(cur->op1, 1);
                        set_operand(cur->op1, 1,&breakpoint);
                else
                else
                        set_operand(cur->op1, 0);
                        set_operand(cur->op1, 0,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "sne") == 0) {
        if (strcmp(cur->insn, "sne") == 0) {
                cur->func_unit = compare;
                cur->func_unit = compare;
                if (eval_operand(cur->op2) != eval_operand(cur->op3))
                if (eval_operand(cur->op2,&breakpoint) != eval_operand(cur->op3,&breakpoint))
                        set_operand(cur->op1, 1);
                        set_operand(cur->op1, 1,&breakpoint);
                else
                else
                        set_operand(cur->op1, 0);
                        set_operand(cur->op1, 0,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "seqi") == 0) {
        if (strcmp(cur->insn, "seqi") == 0) {
                cur->func_unit = compare;
                cur->func_unit = compare;
                if (eval_operand(cur->op2) == eval_operand(cur->op3))
                if (eval_operand(cur->op2,&breakpoint) == eval_operand(cur->op3,&breakpoint))
                        set_operand(cur->op1, 1);
                        set_operand(cur->op1, 1,&breakpoint);
                else
                else
                        set_operand(cur->op1, 0);
                        set_operand(cur->op1, 0,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "sgt") == 0) {
        if (strcmp(cur->insn, "sgt") == 0) {
                cur->func_unit = compare;
                cur->func_unit = compare;
                if ((signed)eval_operand(cur->op2) >
                if ((signed)eval_operand(cur->op2,&breakpoint) >
                    (signed)eval_operand(cur->op3))
                    (signed)eval_operand(cur->op3,&breakpoint))
                        set_operand(cur->op1, 1);
                        set_operand(cur->op1, 1,&breakpoint);
                else
                else
                        set_operand(cur->op1, 0);
                        set_operand(cur->op1, 0,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "sgtui") == 0) {
        if (strcmp(cur->insn, "sgtui") == 0) {
                cur->func_unit = compare;
                cur->func_unit = compare;
                if ((unsigned)eval_operand(cur->op2) >
                if ((unsigned)eval_operand(cur->op2,&breakpoint) >
                    (unsigned)eval_operand(cur->op3))
                    (unsigned)eval_operand(cur->op3,&breakpoint))
                        set_operand(cur->op1, 1);
                        set_operand(cur->op1, 1,&breakpoint);
                else
                else
                        set_operand(cur->op1, 0);
                        set_operand(cur->op1, 0,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "sgeui") == 0) {
        if (strcmp(cur->insn, "sgeui") == 0) {
                cur->func_unit = compare;
                cur->func_unit = compare;
                if ((unsigned)eval_operand(cur->op2) >=
                if ((unsigned)eval_operand(cur->op2,&breakpoint) >=
                    (unsigned)eval_operand(cur->op3))
                    (unsigned)eval_operand(cur->op3,&breakpoint))
                        set_operand(cur->op1, 1);
                        set_operand(cur->op1, 1,&breakpoint);
                else
                else
                        set_operand(cur->op1, 0);
                        set_operand(cur->op1, 0,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "sgei") == 0) {
        if (strcmp(cur->insn, "sgei") == 0) {
                cur->func_unit = compare;
                cur->func_unit = compare;
                if ((signed)eval_operand(cur->op2) >= (signed)eval_operand(cur->op3))
                if ((signed)eval_operand(cur->op2,&breakpoint) >= (signed)eval_operand(cur->op3,&breakpoint))
                        set_operand(cur->op1, 1);
                        set_operand(cur->op1, 1,&breakpoint);
                else
                else
                        set_operand(cur->op1, 0);
                        set_operand(cur->op1, 0,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "sgti") == 0) {
        if (strcmp(cur->insn, "sgti") == 0) {
                cur->func_unit = compare;
                cur->func_unit = compare;
                if ((signed)eval_operand(cur->op2) >
                if ((signed)eval_operand(cur->op2,&breakpoint) >
                    (signed)eval_operand(cur->op3))
                    (signed)eval_operand(cur->op3,&breakpoint))
                        set_operand(cur->op1, 1);
                        set_operand(cur->op1, 1,&breakpoint);
                else
                else
                        set_operand(cur->op1, 0);
                        set_operand(cur->op1, 0,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "slt") == 0) {
        if (strcmp(cur->insn, "slt") == 0) {
                cur->func_unit = compare;
                cur->func_unit = compare;
                if ((signed)eval_operand(cur->op2) <
                if ((signed)eval_operand(cur->op2,&breakpoint) <
                    (signed)eval_operand(cur->op3))
                    (signed)eval_operand(cur->op3,&breakpoint))
                        set_operand(cur->op1, 1);
                        set_operand(cur->op1, 1,&breakpoint);
                else
                else
                        set_operand(cur->op1, 0);
                        set_operand(cur->op1, 0,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "slti") == 0) {
        if (strcmp(cur->insn, "slti") == 0) {
                cur->func_unit = compare;
                cur->func_unit = compare;
                if ((signed)eval_operand(cur->op2) <
                if ((signed)eval_operand(cur->op2,&breakpoint) <
                    (signed)eval_operand(cur->op3))
                    (signed)eval_operand(cur->op3,&breakpoint))
                        set_operand(cur->op1, 1);
                        set_operand(cur->op1, 1,&breakpoint);
                else
                else
                        set_operand(cur->op1, 0);
                        set_operand(cur->op1, 0,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "sle") == 0) {
        if (strcmp(cur->insn, "sle") == 0) {
                cur->func_unit = compare;
                cur->func_unit = compare;
                if ((signed)eval_operand(cur->op2) <=
                if ((signed)eval_operand(cur->op2,&breakpoint) <=
                    (signed)eval_operand(cur->op3))
                    (signed)eval_operand(cur->op3,&breakpoint))
                        set_operand(cur->op1, 1);
                        set_operand(cur->op1, 1,&breakpoint);
                else
                else
                        set_operand(cur->op1, 0);
                        set_operand(cur->op1, 0,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "slei") == 0) {
        if (strcmp(cur->insn, "slei") == 0) {
                cur->func_unit = compare;
                cur->func_unit = compare;
                if ((signed)eval_operand(cur->op2) <=
                if ((signed)eval_operand(cur->op2,&breakpoint) <=
                    (signed)eval_operand(cur->op3))
                    (signed)eval_operand(cur->op3,&breakpoint))
                        set_operand(cur->op1, 1);
                        set_operand(cur->op1, 1,&breakpoint);
                else
                else
                        set_operand(cur->op1, 0);
                        set_operand(cur->op1, 0,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "sleui") == 0) {
        if (strcmp(cur->insn, "sleui") == 0) {
                cur->func_unit = compare;
                cur->func_unit = compare;
                if ((unsigned)eval_operand(cur->op2) <=
                if ((unsigned)eval_operand(cur->op2,&breakpoint) <=
                    (unsigned)eval_operand(cur->op3))
                    (unsigned)eval_operand(cur->op3,&breakpoint))
                        set_operand(cur->op1, 1);
                        set_operand(cur->op1, 1,&breakpoint);
                else
                else
                        set_operand(cur->op1, 0);
                        set_operand(cur->op1, 0,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "sleu") == 0) {
        if (strcmp(cur->insn, "sleu") == 0) {
                cur->func_unit = compare;
                cur->func_unit = compare;
                if ((unsigned)eval_operand(cur->op2) <=
                if ((unsigned)eval_operand(cur->op2,&breakpoint) <=
                    (unsigned)eval_operand(cur->op3))
                    (unsigned)eval_operand(cur->op3,&breakpoint))
                        set_operand(cur->op1, 1);
                        set_operand(cur->op1, 1,&breakpoint);
                else
                else
                        set_operand(cur->op1, 0);
                        set_operand(cur->op1, 0,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "simrdtsc") == 0) {
        if (strcmp(cur->insn, "simrdtsc") == 0) {
                set_operand(cur->op1, cycles+loadcycles+storecycles+forwardingcycles);
                set_operand(cur->op1, cycles+loadcycles+storecycles+forwardingcycles,&breakpoint);
        } else
        } else
        if (strcmp(cur->insn, "simprintf") == 0) {
        if (strcmp(cur->insn, "simprintf") == 0) {
                unsigned long stackaddr;
                unsigned long stackaddr;
 
 
                stackaddr = eval_reg(FRAME_REG);
                stackaddr = eval_reg(FRAME_REG);

powered by: WebSVN 2.1.0

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