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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_52/] [or1ksim/] [cuc/] [memory.c] - Diff between revs 973 and 997

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

Rev 973 Rev 997
Line 100... Line 100...
    cuc_insn *insn = f->bb[b].insn;
    cuc_insn *insn = f->bb[b].insn;
    for (i = 0; i < f->bb[b].ninsn; i++)
    for (i = 0; i < f->bb[b].ninsn; i++)
      if (insn[i].type & IT_MEMORY) {
      if (insn[i].type & IT_MEMORY) {
        dep_list *tmp = all_mem;
        dep_list *tmp = all_mem;
        while (tmp) {
        while (tmp) {
          //printf ("%x %x\n", REF (b,i), tmp->ref);
          //PRINTF ("%x %x\n", REF (b,i), tmp->ref);
          if (check_memory_conflict (f, &insn[i], &f->INSN(tmp->ref), otype))
          if (check_memory_conflict (f, &insn[i], &f->INSN(tmp->ref), otype))
            add_dep (&insn[i].dep, tmp->ref);
            add_dep (&insn[i].dep, tmp->ref);
          tmp = tmp->next;
          tmp = tmp->next;
        }
        }
        add_dep (&all_mem, REF (b, i));
        add_dep (&all_mem, REF (b, i));
Line 130... Line 130...
          b = &f->INSN(b->op[1]);
          b = &f->INSN(b->op[1]);
          /* Not in usual form? */
          /* Not in usual form? */
          if (a->opt[1] != b->opt[1] || a->op[1] != b->op[1]
          if (a->opt[1] != b->opt[1] || a->op[1] != b->op[1]
           || a->opt[2] != OPT_CONST || b->opt[2] != OPT_CONST) goto keep;
           || a->opt[2] != OPT_CONST || b->opt[2] != OPT_CONST) goto keep;
 
 
          //printf ("%i %i, ", a->op[2], b->op[2]);
          //PRINTF ("%i %i, ", a->op[2], b->op[2]);
 
 
          /* Check if they are the same => do not copy */
          /* Check if they are the same => do not copy */
          if (a->op[2] == b->op[2]
          if (a->op[2] == b->op[2]
            && REF_BB(f->msched[i - 1]) == REF_BB(f->msched[i])) {
            && REF_BB(f->msched[i - 1]) == REF_BB(f->msched[i])) {
            /* yes => remove actual instruction */
            /* yes => remove actual instruction */
Line 411... Line 411...
    cucdebug (2, "[%x]%x%c ", f->msched[i], f->mtype[i] & MT_WIDTH, (f->mtype[i] & MT_BURST) ? (f->mtype[i] & MT_BURSTE) ? 'E' : 'B' : ' ');
    cucdebug (2, "[%x]%x%c ", f->msched[i], f->mtype[i] & MT_WIDTH, (f->mtype[i] & MT_BURST) ? (f->mtype[i] & MT_BURSTE) ? 'E' : 'B' : ' ');
  cucdebug (2, "\n");
  cucdebug (2, "\n");
  if (cuc_debug > 5) print_cuc_bb (f, "AFTER_MEM_REMOVAL");
  if (cuc_debug > 5) print_cuc_bb (f, "AFTER_MEM_REMOVAL");
 
 
  if (config.cuc.enable_bursts) {
  if (config.cuc.enable_bursts) {
    //printf ("\n");
    //PRINTF ("\n");
    for (i = 1; i < f->nmsched; i++) {
    for (i = 1; i < f->nmsched; i++) {
      cuc_insn *a = &f->INSN(f->msched[i - 1]);
      cuc_insn *a = &f->INSN(f->msched[i - 1]);
      cuc_insn *b = &f->INSN(f->msched[i]);
      cuc_insn *b = &f->INSN(f->msched[i]);
      int aw = f->mtype[i - 1] & MT_WIDTH;
      int aw = f->mtype[i - 1] & MT_WIDTH;
 
 
Line 428... Line 428...
        b = &f->INSN(b->op[1]);
        b = &f->INSN(b->op[1]);
        /* Not in usual form? */
        /* Not in usual form? */
        if (a->opt[1] != b->opt[1] || a->op[1] != b->op[1]
        if (a->opt[1] != b->opt[1] || a->op[1] != b->op[1]
         || a->opt[2] != OPT_CONST || b->opt[2] != OPT_CONST) continue;
         || a->opt[2] != OPT_CONST || b->opt[2] != OPT_CONST) continue;
 
 
        //printf ("%i %i, ", a->op[2], b->op[2]);
        //PRINTF ("%i %i, ", a->op[2], b->op[2]);
 
 
        /* Check if they touch together */
        /* Check if they touch together */
        if (a->op[2] + aw == b->op[2]
        if (a->op[2] + aw == b->op[2]
          && REF_BB(f->msched[i - 1]) == REF_BB(f->msched[i])) {
          && REF_BB(f->msched[i - 1]) == REF_BB(f->msched[i])) {
          /* yes => do burst */
          /* yes => do burst */
Line 507... Line 507...
      }
      }
      if (maxc > lastc[t]) {
      if (maxc > lastc[t]) {
        add_dep (&f->INSN(f->msched[i]).dep, f->msched[maxc]);
        add_dep (&f->INSN(f->msched[i]).dep, f->msched[maxc]);
        lastc[t] = maxc;
        lastc[t] = maxc;
      }
      }
      //printf ("%i(%i)> ml %i(%i) ms %i(%i) lastl %i %i lasts %i %i last_load %i last_store %i\n", i, f->msched[i], maxl, f->msched[maxl], maxs, f->msched[maxs], lastl[0], lastl[1], lasts[0], lasts[1], last_load, last_store);
      //PRINTF ("%i(%i)> ml %i(%i) ms %i(%i) lastl %i %i lasts %i %i last_load %i last_store %i\n", i, f->msched[i], maxl, f->msched[maxl], maxs, f->msched[maxs], lastl[0], lastl[1], lasts[0], lasts[1], last_load, last_store);
 
 
      /* What we have to wait to finish this BB? */
      /* What we have to wait to finish this BB? */
      if (i + 1 >= f->nmsched || REF_BB(f->msched[i + 1]) != REF_BB(f->msched[i])) {
      if (i + 1 >= f->nmsched || REF_BB(f->msched[i + 1]) != REF_BB(f->msched[i])) {
        if (last_load > lastl[t]) {
        if (last_load > lastl[t]) {
          add_dep (&f->bb[REF_BB(f->msched[i])].mdep, f->msched[last_load]);
          add_dep (&f->bb[REF_BB(f->msched[i])].mdep, f->msched[last_load]);

powered by: WebSVN 2.1.0

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