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 313

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