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

Subversion Repositories or1k

[/] [or1k/] [tags/] [stable_0_2_0_rc2/] [or1ksim/] [sim-config.h] - Blame information for rev 424

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 424 markom
#define MAX_UARTS        4       /* Max. number of UARTs simulated */   
25
#define MAX_DMAS         4       /* Max. number of DMA controllers */
26
#define MAX_ETHERNETS    4       /* Max. number of Ethernet MACs   */
27
#define MAX_MEMORIES     16      /* Max. number of memory devices attached */
28
 
29 239 markom
#define NONE            0
30
#define VIRTUAL         1
31
#define PHYSICAL        2
32 7 jrydberg
 
33 239 markom
#define STR_SIZE        (256)
34
 
35 7 jrydberg
struct config {
36 239 markom
  struct {
37
    int tagtype;
38
  } dc;
39
 
40
  struct {
41
    int tagtype;
42
  } ic;
43
 
44 332 markom
  struct {
45
    int enabled;                      /* Is tick timer enabled?  */
46
    int irq;                          /* IRQ of this device */
47
  } tick;
48
 
49 310 markom
  int clkcycle_ns;                    /* Clock cycle in nanoseconds */
50 239 markom
 
51 261 markom
  int nuarts;
52
  int uarts_enabled;
53 239 markom
  struct {
54 310 markom
    char rxfile[STR_SIZE];            /* Filename for RX */
55
    char txfile[STR_SIZE];            /* Filename for TX (required) */
56
    int jitter;                       /* CZ 250801 - in msecs...time to block */
57
    unsigned long baseaddr;           /* Naturally aligned base address */
58 332 markom
    int irq;                          /* IRQ of this device */
59 313 markom
    unsigned long vapi_id;            /* VAPI id for this instance */
60 341 markom
    int uart16550;                    /* Whether this device is uart 16450 or 16550 */
61 424 markom
  } uarts[MAX_UARTS];
62 239 markom
 
63 261 markom
  int ndmas;
64
  int dmas_enabled;
65 239 markom
  struct {
66
    unsigned long baseaddr;
67 332 markom
    int irq;                          /* IRQ of this device */
68 313 markom
    unsigned long vapi_id;            /* VAPI id for this instance */
69 424 markom
  } dmas[MAX_DMAS];
70 239 markom
 
71 304 markom
  int nethernets;
72
  int ethernets_enabled;
73 361 markom
  struct {
74
    unsigned long baseaddr;
75
    unsigned dma;                     /* Which controller is this ethernet "connected" to */
76
    unsigned tx_channel;              /* DMA channel used for TX */
77
    unsigned rx_channel;              /* DMA channel used for RX */
78
    char rxfile[STR_SIZE];            /* Filename for RX */
79
    char txfile[STR_SIZE];            /* File for TX */
80
    unsigned long vapi_id;            /* VAPI id for this instance */
81 424 markom
  } ethernets[MAX_ETHERNETS];
82 257 erez
 
83 261 markom
  struct {
84
    int enabled;                      /* is MC enabled? */
85
    unsigned long baseaddr;           /* Naturally aligned base address */
86 239 markom
    unsigned POC;                     /* power on reset configuration register */
87
  } mc;
88 262 markom
 
89
  struct {
90 394 markom
    int pattern;                      /* A user specified memory initialization pattern */
91
    int random_seed;                  /* Initialize the memory with random values, starting with seed */
92 262 markom
    enum {
93 269 markom
      MT_UNKNOWN,
94 262 markom
      MT_PATTERN,
95
      MT_RANDOM
96
    } type;
97 424 markom
    int nmemories;                    /* Number of attached memories */
98
    struct {
99
      int ce;                         /* Which ce this memory is associated with */
100
      unsigned long baseaddr;         /* Start address of the memory */
101
      unsigned long size;             /* Memory size */
102
      char name[STR_SIZE];            /* Memory type string */
103
      char log[STR_SIZE];             /* Memory log filename */
104
      int delayr;                     /* Read cycles */
105
      int delayw;                     /* Write cycles */
106
    } table[MAX_MEMORIES];
107 262 markom
  } memory;
108 424 markom
 
109 263 markom
  struct {
110
    unsigned long upr;      /* Unit present register */
111
    unsigned long ver, rev; /* Version register */
112
    int superscalar;        /* superscalara analysis */
113
    int hazards;            /* dependency hazards analysis */
114 361 markom
    int dependstats;        /* dependency statistics */
115 394 markom
    int slp;                /* subroutine level parallelism */
116
    int btic;               /* branch prediction target insn cache analysis */
117 264 markom
    int bpb;                /* branch prediction buffer analysis */
118 263 markom
  } cpu;
119 264 markom
 
120
  struct {
121
    int debug;              /* Simulator debugging */
122 293 markom
    int verbose;            /* Force verbose output */
123 294 markom
    int iprompt;            /* Interactive prompt */
124 361 markom
 
125 264 markom
    int profile;            /* Is profiler running */
126
    char prof_fn[STR_SIZE]; /* Profiler filename */
127 394 markom
 
128
    int history;            /* instruction stream history analysis */
129 361 markom
    int exe_log;            /* Print out RTL states? */
130 294 markom
    char exe_log_fn[STR_SIZE]; /* RTL state comparison filename */
131 264 markom
  } sim;
132 294 markom
 
133 269 markom
  struct {
134
    int enabled;            /* Whether is debug module enabled */
135
    int gdb_enabled;        /* Whether is debugging with gdb possible */
136
    int server_port;        /* A user specified port number for services */
137
  } debug;
138
 
139 293 markom
  struct {                  /* Verification API, part of Advanced Core Verification */
140 306 markom
    int enabled;            /* Whether is VAPI module enabled */
141
    int server_port;        /* A user specified port number for services */
142 355 markom
    int log_enabled;        /* Whether to log the vapi requests */
143 424 markom
    int log_device_id;      /* Whether to log device ID for each request */
144 355 markom
    char vapi_fn[STR_SIZE]; /* vapi log filename */
145 361 markom
  } vapi;
146
};
147
 
148
struct runtime {
149
  struct {
150
    FILE *fprof;            /* Profiler file */
151
    FILE *fexe_log;         /* RTL state comparison file */
152
    int init;               /* Whether we are still initilizing sim */
153
    int script_file_specified;/* Whether script file was already loaded */
154
    char *filename;  /* Original Command Simulator file (CZ) */
155
  } sim;
156 424 markom
 
157
  struct {
158
    struct {
159
      FILE *log;            /* Log file for this device */
160
    } table[MAX_MEMORIES];
161
  } memory;
162 361 markom
 
163
  struct {                  /* Verification API, part of Advanced Core Verification */
164 355 markom
    FILE *vapi_file;        /* vapi file */
165 293 markom
  } vapi;
166 7 jrydberg
};
167 239 markom
 
168 269 markom
#ifdef DEBUGMOD_OFF
169
#define DEBUG_ENABLED 0
170
#define GDB_ENABLED   0
171
#else
172
#define DEBUG_ENABLED config.debug.enabled
173
#define GDB_ENABLED   config.debug.gdb_enabled
174
#endif
175
 
176 7 jrydberg
extern struct config config;
177 361 markom
extern struct runtime runtime;
178 239 markom
 
179
/* Read environment from a script file. Does not fail - assumes defaukt configuration instead. */
180
void read_script_file (char *filename);
181 361 markom
 
182
/* Executes set sim command.  Returns nonzero if error.  */
183
void set_config_command (char *s);

powered by: WebSVN 2.1.0

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