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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_67/] [or1ksim/] [sim-config.h] - Blame information for rev 394

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