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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_61/] [or1ksim/] [sim-config.h] - Blame information for rev 264

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 7 jrydberg
/* config.h -- Simulator configuration header file
2
   Copyright (C) 1999 Damjan Lampret, lampret@opencores.org
3
 
4
   This file is part of OpenRISC 1000 Architectural Simulator.
5
 
6
   This program is free software; you can redistribute it and/or modify
7
   it under the terms of the GNU General Public License as published by
8
   the Free Software Foundation; either version 2 of the License, or
9
   (at your option) any later version.
10
 
11
   This program is distributed in the hope that it will be useful,
12
   but WITHOUT ANY WARRANTY; without even the implied warranty of
13
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
   GNU General Public License for more details.
15
 
16
   You should have received a copy of the GNU General Public License
17
   along with this program; if not, write to the Free Software
18
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
19
 
20 173 markom
#include <stdio.h>
21
 
22 7 jrydberg
/* Simulator configuration macros. Eventually this one will be a lot bigger. */
23 30 lampret
 
24 221 markom
#define NR_UARTS        4       /* Number of UARTs simulated */   
25 212 erez
#define NR_DMAS         1       /* Number of DMA controllers */
26 257 erez
#define NR_ETHERNETS    2       /* Number of Ethernet MACs   */
27 239 markom
#define NONE            0
28
#define VIRTUAL         1
29
#define PHYSICAL        2
30 7 jrydberg
 
31 239 markom
#define STR_SIZE        (256)
32
 
33 7 jrydberg
struct config {
34 239 markom
  struct {
35
    int tagtype;
36
  } dc;
37
 
38
  struct {
39
    int tagtype;
40
  } ic;
41
 
42
  int clkcycle_ns;  /* Clock cycle in nanoseconds */
43
 
44 261 markom
  int nuarts;
45
  int uarts_enabled;
46 239 markom
  struct {
47 261 markom
    char rxfile[STR_SIZE]; /* File for RX */
48
    char txfile[STR_SIZE]; /* File for TX (required) */
49
    int jitter;     /* CZ 250801 - in msecs...time to block */
50 239 markom
    unsigned long baseaddr; /* Naturally aligned base address */
51
  } uarts[NR_UARTS];
52
 
53 261 markom
  int ndmas;
54
  int dmas_enabled;
55 239 markom
  struct {
56
    unsigned long baseaddr;
57
    unsigned irq;
58
  } dmas[NR_DMAS];
59
 
60 257 erez
        struct {
61
                unsigned long baseaddr;
62
                unsigned dma; /* Which controller is this ethernet "connected" to */
63
                unsigned tx_channel; /* DMA channel used for TX */
64
                unsigned rx_channel; /* DMA channel used for RX */
65
                char *rxfile;
66
                char *txfile;
67
        } ethernets[NR_ETHERNETS];
68
 
69 261 markom
  struct {
70
    int enabled;                      /* is MC enabled? */
71
    unsigned long baseaddr;           /* Naturally aligned base address */
72 239 markom
    unsigned POC;                     /* power on reset configuration register */
73
  } mc;
74 262 markom
 
75
  struct {
76
    char memory_table_file[STR_SIZE]; /* Memory table filename */
77
    int pattern;            /* A user specified memory initialization pattern */
78
    int random_seed;        /* Initialize the memory with random values, starting with seed */
79
    enum {
80
      MT_PATTERN,
81
      MT_RANDOM
82
    } type;
83
  } memory;
84 263 markom
 
85
  struct {
86
    unsigned long upr;      /* Unit present register */
87
    unsigned long ver, rev; /* Version register */
88
    int superscalar;        /* superscalara analysis */
89
    int hazards;            /* dependency hazards analysis */
90
                int history;            /* instruction stream history analysis */
91
                int dependstats;        /* dependency statistics */
92
    int dependency;         /* not sure: same as dependency statistics?  */
93
    int slp;                /* not sure: stack analisys? */
94 264 markom
    int btic_sim;                       /* branch prediction target insn cache analysis */
95
    int bpb;                /* branch prediction buffer analysis */
96 263 markom
  } cpu;
97 264 markom
 
98
  struct {
99
    int debug;              /* Simulator debugging */
100
    int profile;            /* Is profiler running */
101
    char prof_fn[STR_SIZE]; /* Profiler filename */
102
    FILE *fprof;            /* Profiler file */
103
    int iprompt;            /* Interactive prompt */
104
  } sim;
105
 
106 239 markom
  int inhibit_server; /* Don't start up the JTAG proxy server */
107
  int server_port; /* A user specified port number for services */
108
 
109 263 markom
  char *script_file;        /* Script file that should be used */
110
  char *filename;  /* Original Command Simulator file (CZ) */
111 7 jrydberg
};
112 239 markom
 
113 7 jrydberg
extern struct config config;
114 239 markom
 
115
/* Read environment from a script file. Does not fail - assumes defaukt configuration instead. */
116
void read_script_file (char *filename);

powered by: WebSVN 2.1.0

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