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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_39/] [or1ksim/] [cpu/] [dlx/] [execute.c] - Diff between revs 393 and 997

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

Rev 393 Rev 997
Line 70... Line 70...
        regno = atoi(regstr + 1);
        regno = atoi(regstr + 1);
 
 
        if (regno < MAX_GPRS)
        if (regno < MAX_GPRS)
                return reg[regno];
                return reg[regno];
        else {
        else {
                printf("\nABORT: read out of registers\n");
                PRINTF("\nABORT: read out of registers\n");
                cont_run = 0;
                cont_run = 0;
                return 0;
                return 0;
        }
        }
}
}
 
 
Line 91... Line 91...
                value = 0;
                value = 0;
 
 
        if (regno < MAX_GPRS)
        if (regno < MAX_GPRS)
                reg[regno] = value;
                reg[regno] = value;
        else {
        else {
                printf("\nABORT: write out of registers\n");
                PRINTF("\nABORT: write out of registers\n");
                cont_run = 0;
                cont_run = 0;
        }
        }
 
 
        return;
        return;
}
}
Line 213... Line 213...
        char operand[OPERANDNAME_LEN];
        char operand[OPERANDNAME_LEN];
 
 
        strcpy(operand, dstoperand);
        strcpy(operand, dstoperand);
 
 
        if (*operand == '#')            /* immediate */
        if (*operand == '#')            /* immediate */
                printf("INTERNAL ERROR: Can't set immediate operand.\n");
                PRINTF("INTERNAL ERROR: Can't set immediate operand.\n");
        else
        else
        if (!strstr(operand, "("))      /* not indirect but ...*/
        if (!strstr(operand, "("))      /* not indirect but ...*/
                if (*operand == 'r')    /* ... register direct */
                if (*operand == 'r')    /* ... register direct */
                        set_reg32(operand, value);
                        set_reg32(operand, value);
                else                    /* ... rel. or abs. address */
                else                    /* ... rel. or abs. address */
                        printf("INTERNAL ERROR: Can't set addr operand.\n");
                        PRINTF("INTERNAL ERROR: Can't set addr operand.\n");
        else {                          /* register indirect */
        else {                          /* register indirect */
                int disp;               /* with possible displacement */
                int disp;               /* with possible displacement */
                char *regstr;
                char *regstr;
                unsigned int memaddr;
                unsigned int memaddr;
 
 
Line 638... Line 638...
        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);
                simprintf(stackaddr, 0);
                simprintf(stackaddr, 0);
                /* printf("simprintf %x %x %x\n", stackaddr, fmtaddr, args); */
                /* PRINTF("simprintf %x %x %x\n", stackaddr, fmtaddr, args); */
        } else {
        } else {
                printf("\nABORT: illegal opcode %s ", cur->insn);
                PRINTF("\nABORT: illegal opcode %s ", cur->insn);
                printf("at %.8lx\n", cur->insn_addr);
                PRINTF("at %.8lx\n", cur->insn_addr);
                cont_run = 0;
                cont_run = 0;
        }
        }
 
 
        /* Dynamic, dependency stats. */
        /* Dynamic, dependency stats. */
        adddstats(icomplet[0].insn, iqueue[0].insn, 1, check_depend());
        adddstats(icomplet[0].insn, iqueue[0].insn, 1, check_depend());
Line 737... Line 737...
 
 
void dumpreg()
void dumpreg()
{
{
        int i;
        int i;
 
 
        printf("\n\nIQ[0]:");
        PRINTF("\n\nIQ[0]:");
        dumpmemory(iqueue[0].insn_addr, iqueue[0].insn_addr + 4);
        dumpmemory(iqueue[0].insn_addr, iqueue[0].insn_addr + 4);
        printf(" (just executed)\tCYCLES: %u \nSuperscalar CYCLES: %u\n", cycles, supercycles);
        PRINTF(" (just executed)\tCYCLES: %u \nSuperscalar CYCLES: %u\n", cycles, supercycles);
        printf("Additional LOAD CYCLES: %u  STORE CYCLES: %u\n", loadcycles, storecycles);
        PRINTF("Additional LOAD CYCLES: %u  STORE CYCLES: %u\n", loadcycles, storecycles);
        printf("Additional RESULT FORWARDING CYCLES: %u\nPC:", forwardingcycles);
        PRINTF("Additional RESULT FORWARDING CYCLES: %u\nPC:", forwardingcycles);
        dumpmemory(pc, pc + 4);
        dumpmemory(pc, pc + 4);
        printf(" (next insn)");
        PRINTF(" (next insn)");
        for(i = 0; i < MAX_GPRS; i++) {
        for(i = 0; i < MAX_GPRS; i++) {
                if (i % 4 == 0)
                if (i % 4 == 0)
                        printf("\n");
                        PRINTF("\n");
                printf("GPR%.2u: %.8lx  ", i, reg[i]);
                PRINTF("GPR%.2u: %.8lx  ", i, reg[i]);
        }
        }
}
}
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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