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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_65/] [or1ksim/] [cuc/] [verilog.c] - Diff between revs 996 and 997

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

Rev 996 Rev 997
Line 22... Line 22...
#include <stdarg.h>
#include <stdarg.h>
#include <assert.h>
#include <assert.h>
#include "cuc.h"
#include "cuc.h"
#include "insn.h"
#include "insn.h"
#include "profiler.h"
#include "profiler.h"
 
#include "sim-config.h"
 
 
/* Shortcut */
/* Shortcut */
#define GEN(x...) fprintf (fo, x)
#define GEN(x...) fprintf (fo, x)
 
 
/* Find index of load/store/call */
/* Find index of load/store/call */
Line 62... Line 63...
                  II_IS_LOAD (f->INSN(t->ref).index) ? 'l' : 's', find_lsc_index (f, t->ref));
                  II_IS_LOAD (f->INSN(t->ref).index) ? 'l' : 's', find_lsc_index (f, t->ref));
      } else if (f->INSN(t->ref).index == II_CALL) {
      } else if (f->INSN(t->ref).index == II_CALL) {
        int x;
        int x;
        GEN ("%sf_end[%i]", first ? " && " : "", find_lsc_index (f, t->ref));
        GEN ("%sf_end[%i]", first ? " && " : "", find_lsc_index (f, t->ref));
      } else {
      } else {
        printf ("print_deps: err %x\n", t->ref);
        PRINTF ("print_deps: err %x\n", t->ref);
        assert (0);
        assert (0);
      }
      }
      first = 1;
      first = 1;
      t = t->next;
      t = t->next;
    }
    }
Line 214... Line 215...
  cuc_bb *end_bb = NULL;
  cuc_bb *end_bb = NULL;
  int end_bb_no = -1;
  int end_bb_no = -1;
  sprintf (tmp, "%s.v", filename);
  sprintf (tmp, "%s.v", filename);
 
 
  log ("Generating verilog file \"%s\"\n", tmp);
  log ("Generating verilog file \"%s\"\n", tmp);
  printf ("Generating verilog file \"%s\"\n", tmp);
  PRINTF ("Generating verilog file \"%s\"\n", tmp);
  if ((fo = fopen (tmp, "wt+")) == NULL) {
  if ((fo = fopen (tmp, "wt+")) == NULL) {
    fprintf (stderr, "Cannot open '%s'\n", tmp);
    fprintf (stderr, "Cannot open '%s'\n", tmp);
    exit (1);
    exit (1);
  }
  }
 
 
Line 540... Line 541...
    for (i = 0; i < f->nmsched; i++)
    for (i = 0; i < f->nmsched; i++)
      if (f->mtype[i] & MT_STORE) {
      if (f->mtype[i] & MT_STORE) {
        char t[30];
        char t[30];
        GEN ("  %sif (s_stb[%i]) swb_dat_o = %s;\n", i ? "else " : "", cur_store++,
        GEN ("  %sif (s_stb[%i]) swb_dat_o = %s;\n", i ? "else " : "", cur_store++,
                        print_op_v (f, t, f->msched[i], 0));
                        print_op_v (f, t, f->msched[i], 0));
        //printf ("msched[%i] = %x (mtype %x) %x\n", i, f->msched[i], f->mtype[i], f->INSN(f->msched[i]).op[0]);
        //PRINTF ("msched[%i] = %x (mtype %x) %x\n", i, f->msched[i], f->mtype[i], f->INSN(f->msched[i]).op[0]);
      }
      }
    GEN ("end\n");
    GEN ("end\n");
  }
  }
 
 
  /* Generate load and store state machine */
  /* Generate load and store state machine */
Line 700... Line 701...
 
 
  for (i = 0; i < nrf; i++)
  for (i = 0; i < nrf; i++)
    if (maxncallees < ncallees[i]) maxncallees = ncallees[i];
    if (maxncallees < ncallees[i]) maxncallees = ncallees[i];
 
 
  log ("Generating verilog file \"%s\"\n", tmp);
  log ("Generating verilog file \"%s\"\n", tmp);
  printf ("Generating verilog file \"%s\"\n", tmp);
  PRINTF ("Generating verilog file \"%s\"\n", tmp);
  if ((fo = fopen (tmp, "wt+")) == NULL) {
  if ((fo = fopen (tmp, "wt+")) == NULL) {
    fprintf (stderr, "Cannot open '%s'\n", tmp);
    fprintf (stderr, "Cannot open '%s'\n", tmp);
    exit (1);
    exit (1);
  }
  }
 
 

powered by: WebSVN 2.1.0

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