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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or1ksim/] [doc/] [or1ksim.info] - Blame information for rev 90

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

Line No. Rev Author Line
1 82 jeremybenn
This is ../../doc/or1ksim.info, produced by makeinfo version 4.13 from
2 19 jeremybenn
../../doc/or1ksim.texi.
3
 
4
INFO-DIR-SECTION Embedded development
5
START-INFO-DIR-ENTRY
6
* Or1ksim: (or32-uclinux-or1ksim).      The OpenRISC 1000 Architectural
7
                                        Simulator
8
END-INFO-DIR-ENTRY
9
 
10
This file documents the OpenRISC Architectural Simulator, Or1ksim.
11
 
12
Copyright (C) 2008, 2009 Embecosm Limited.
13
 
14
     Permission is granted to copy, distribute and/or modify this
15
     document under the terms of the GNU Free Documentation License,
16
     Version 1.2 or any later version published by the Free Software
17
     Foundation; with no Invariant Sections, with no Front-Cover Texts,
18
     and with no Back-Cover Texts.  A copy of the license is included
19
     in the section entitled "GNU Free Documentation License".
20
 
21

22
File: or1ksim.info,  Node: Top,  Next: Installation,  Up: (dir)
23
 
24
Scope of this Document
25
**********************
26
 
27
This document is the user guide for Or1ksim, the OpenRISC 1000
28
Architectural Simulator.
29
 
30
* Menu:
31
 
32
* Installation::
33
* Usage::
34
* Configuration::
35
* Interactive Command Line::
36
* Verification API::
37
 
38
* Code Internals::
39
 
40
* GNU Free Documentation License::  The license for this documentation
41
* Index::
42
 
43

44
File: or1ksim.info,  Node: Installation,  Next: Usage,  Prev: Top,  Up: Top
45
 
46
1 Installation
47
**************
48
 
49
Installation follows standard GNU protocols.
50
 
51
* Menu:
52
 
53
* Preparation::
54
* Configuring the Build::
55
* Build and Install::
56
* Known Issues::
57
 
58

59
File: or1ksim.info,  Node: Preparation,  Next: Configuring the Build,  Up: Installation
60
 
61
1.1 Preparation
62
===============
63
 
64
Unpack the software and create a _separate_ directory in which to build
65
it:
66
 
67 90 jeremybenn
     tar jxf or1ksim-2010-04-21.tar.bz2
68 19 jeremybenn
     mkdir builddir_or1ksim
69
     cd builddir_or1ksim
70
 
71

72
File: or1ksim.info,  Node: Configuring the Build,  Next: Build and Install,  Prev: Preparation,  Up: Installation
73
 
74
1.2 Configuring the Build
75
=========================
76
 
77
Configure the software using the `configure' script in the main
78
directory.
79
 
80
The most significant argument is `--target', which should specify the
81 82 jeremybenn
OpenRISC 1000 32-bit architecture.  If this argument is omitted, it will
82 19 jeremybenn
default to OpenRISC 1000 32-bit with a warning
83
 
84 90 jeremybenn
     ../or1ksim-2010-04-21/configure --target=or32-uclinux ...
85 19 jeremybenn
 
86
There are several other options available, many of which are standard
87 82 jeremybenn
to GNU `configure' scripts.  Use `configure --help' to see all the
88
options.  The most useful is `--prefix' to specify a directory for
89 19 jeremybenn
installation of the tools.
90
 
91
A number of Or1ksim features in the simulator do require enabling at
92 82 jeremybenn
configuration.  These include
93 19 jeremybenn
 
94
`--enable-profiling'
95
`--disable-profiling'
96 82 jeremybenn
     If enabled, Or1ksim is compiled for profiling with `gprof'.  This
97
     is disabled by default.  Only really of value for developers of
98 19 jeremybenn
     Or1ksim.
99
 
100
`--enable-execution=simple'
101
`--enable-execution=complex'
102
`--enable-execution=dynamic'
103
     Or1ksim has developed to improve functionality and performance.
104
     This feature allows three versions of Or1ksim to be built
105
 
106
    `--enable-execution=simple'
107
          Build the original simple interpreting simulator
108
 
109
    `--enable-execution=complex'
110 82 jeremybenn
          Build a more complex interpreting simulator.  Experiments
111
          suggest this is 50% faster than the simple simulator.  This
112
          is the default.
113 19 jeremybenn
 
114
    `--enable-execution=dynamic'
115 82 jeremybenn
          Build a dynamically compiling simulator.  This is the way
116
          many modern ISS are built.  This represents a work in
117
          progress.  Currently Or1ksim will compile, but segfaults if
118
          configured with this option.
119 19 jeremybenn
 
120
 
121
     The default is `--enable-execution=complex'.
122
 
123
`--enable-ethphy'
124
`--disable-ethphy'
125
     If enabled, this option allows the Ethernet to be simulated by
126
     connecting via a socket (the alternative reads and writes, from
127 82 jeremybenn
     and to files).  This must then be configured using the relevant
128
     fields in the `ethernet' section of the configuration file.  *Note
129 19 jeremybenn
     Ethernet Configuration: Ethernet Configuration.
130
 
131
     The default is for this to be disabled.
132
 
133
`--enable-range-stats'
134
`--disable-range-stats'
135
     If enabled, this option allows statistics to be collected to
136 82 jeremybenn
     analyse register access over time.  The default is for this to be
137 19 jeremybenn
     disabled.
138
 
139
`--enable-ov-flag'
140
`--disable-ov-flag'
141
     If enabled, this option causes instructions to set the overflow
142 82 jeremybenn
     flag.  The instructions affected by this are `l.add', `l.addc',
143 19 jeremybenn
     `l.addi', `l.and', `l.andi', `l.div', `l.divu', `l.mul', `l.muli',
144
     `l.or', `l.ori', `l.sll', `l.slli', `l.srl', `l.srli', `l.sra',
145
     `l.srai', `l.sub', `l.xor' and `l.xori'.
146
 
147
     The default is for this to be disabled.
148
 
149
          Caution: This appears a very dangerous option, to the extent
150 82 jeremybenn
          of arguably being a bug.  Whether or not flags are set is
151
          part of the OpenRISC 1000 architectural specification.
152
          Within the above list, the arithmetic instructions (`l.add',
153
          `l.addc', `l.addi', `l.div', `l.divu', `l.mul', `l.muli' and
154
          `l.sub'), together with `l.addic' which is missed out, set
155
          the overflow flag.  All the others (`l.and', `l.andi',
156
          `l.or', `l.ori', `l.sll', `l.slli', `l.srl', `l.srli',
157
          `l.sra', `l.srai', `l.xor' and `l.xori') do not.
158 19 jeremybenn
 
159
          Thus it is impossible to get correct behavior whichever way
160
          this option is set.
161
 
162
`--enable-arith-flag'
163
`--disable-arith-flag'
164
     If enabled, this option causes instructions to set the flag (`F'
165 82 jeremybenn
     bit) in the supervision register.  The instructions affected by
166 19 jeremybenn
     this are `l.add', `l.addc', `l.addi', `l.and' and `l.andi'.
167
 
168
     The default is for this to be disabled.
169
 
170
          Caution: As with `--enable-ov-flag', this appears another
171
          very dangerous option, to the extent of arguably being a bug.
172
          It also appears to be only partially implemented--why only
173
          the instructions early in the alphabet?
174
 
175
          Whether or not flags are set is part of the OpenRISC 1000
176 82 jeremybenn
          architectural specification.  The only flags which should set
177 19 jeremybenn
          this are the "set flag" instructions: `l.sfeq', `l.sfeqi',
178
          `l.sfges', `l.sfgesi', `l.sfgeu', `l.sfgeui', `l.sfgts',
179
          `l.sfgtsi', `l.sfgtu', `l.sfgtui', `l.sfles', `l.sflesi',
180
          `l.sfleu', `l.sfleui', `l.sflts', `l.sfltsi', `l.sfltu',
181
          `l.sfltui', `l.sfne' and `l.sfnei'.
182
 
183
          The flags are correctly set (irrespective of
184
          `--enable-arith_flag').
185
 
186
          Correct behavior is thus achieved if this flag is not set.
187
          `--enable-arith-flag' should never be used.
188
 
189
 
190
`--enable-debug'
191
`--disable-debug'
192
     This is a feature of the Argtable2 package used to process
193 82 jeremybenn
     arguments.  If enabled, some debugging features are turned on in
194
     Argtable2.  It is provided for completeness, but there is no
195
     reason why this feature should ever be needed by any Or1ksim user.
196 19 jeremybenn
 
197 82 jeremybenn
`--enable-all-tests'
198
`--disable-all-tests'
199
     Some of the tests (at the time of writing just one) will not
200
     compile without error.  If enabled with this flag, all test
201
     programs will be compiled with `make check'.
202 19 jeremybenn
 
203 82 jeremybenn
     This flag is intended for those working on the test package, who
204
     wish to get the missing test(s) working.
205
 
206
 
207 19 jeremybenn

208
File: or1ksim.info,  Node: Build and Install,  Next: Known Issues,  Prev: Configuring the Build,  Up: Installation
209
 
210
1.3 Building and Installing
211
===========================
212
 
213 82 jeremybenn
Build the tool with:
214 19 jeremybenn
 
215
     make all
216 82 jeremybenn
 
217
If you have the OpenRISC tool chain and DejaGNU installed, you can
218
verify the tool as follows (otherwise omit this step):
219
 
220
     make check
221
 
222
Install the tool with:
223
 
224 19 jeremybenn
     make install
225
 
226
This will install the three variations of the Or1ksim tool,
227
`or32-uclinux-sim', `or32-uclinux-psim' and `or32-uclinux-mpsim', the
228
Or1ksim library, `libsim', the header file, `or1ksim.h' and this
229
documentation in `info' format.
230
 
231
     Note: Testing Or1ksim with `make check' is not yet supported.
232
 
233
The documentation may be created and installed in alternative formats
234
(PDF, Postscript, DVI, HTML) with for example:
235
 
236
     make pdf
237
     make install-pdf
238
 
239

240
File: or1ksim.info,  Node: Known Issues,  Prev: Build and Install,  Up: Installation
241
 
242
1.4 Known Problems and Issues
243
=============================
244
 
245 82 jeremybenn
The following problems and issues are known about with Or1ksim
246 90 jeremybenn
2010-04-21.  The OpenRISC tracker may be used to see the current state
247
of these issues and to raise new problems and feature requests.  It may
248
be found at `http://www.opencores.org/ptracker.cgi/view/or1k/398'.
249 19 jeremybenn
 
250
   * The Supervision Register Little Endian Enable (LEE) bit is
251 82 jeremybenn
     ignored.  Or1ksim can be built for either little endian or big
252 19 jeremybenn
     endian use, but that behavior cannot be changed dynamically.
253
 
254
   * The NPC is a read/write register, but after being written it
255 82 jeremybenn
     clears the pipeline.  This means that if the processor is stalled,
256 19 jeremybenn
     the value should subsequently read back as 0, until the processor
257 82 jeremybenn
     is unstalled and able to refill its pipeline.  By default Or1ksim
258 19 jeremybenn
     always reports back the value of NPC, even when it has been
259
     written while stalled.
260
 
261
     There is now an option, `--strict-npc', which will enforce this
262 82 jeremybenn
     behavior.  At some stage in the future it will become the default
263 19 jeremybenn
     behavior, but for now it is an option, since its use will break
264
     GDB.
265
 
266
   * The memory components are given names in the configuration file.
267
     However there is currently no way for Or1ksim to report that name
268
     back to the user (for example to identify which memory block
269
     corresponds to a particular access).
270
 
271
   * Or1ksim allows the processor to be stalled (from the command
272 82 jeremybenn
     line), even if there is no debugger present.  This seems to be a
273 19 jeremybenn
     meaningless operation.
274
 
275
   * Or1ksim is not reentrant, so a program cannot instantiate multiple
276 82 jeremybenn
     instances using the library.  This is clearly a problem when
277
     considering multi-core applications.  However it stems from the
278
     original design, and can only be fixed by a complete rewrite.  The
279 19 jeremybenn
     entire source code uses static global constants liberally!
280
 
281
   * There is no support for floating point instructions currently in
282 82 jeremybenn
     Or1ksim.  However this is a work in progress and should be
283
     available in the future.
284 19 jeremybenn
 
285
 
286

287
File: or1ksim.info,  Node: Usage,  Next: Configuration,  Prev: Installation,  Up: Top
288
 
289
2 Usage
290
*******
291
 
292
* Menu:
293
 
294
* Standalone Simulator::
295
* Profiling Utility::
296
* Memory Profiling Utility::
297
* Simulator Library::
298
 
299

300
File: or1ksim.info,  Node: Standalone Simulator,  Next: Profiling Utility,  Up: Usage
301
 
302
2.1 Standalone Simulator
303
========================
304
 
305
The general form the standalone command is:
306
 
307
     or32-uclinux-sim [-vhi] [-f FILE] [--nosrv] [--srv=[N]] [-d STR]
308
                      [--enable-profile] [--enable-mprofile] [FILE]
309
 
310 82 jeremybenn
Many of the options have both a short and a long form.  For example
311
`-h' or `--help'.
312 19 jeremybenn
 
313
`-v'
314
`--version'
315
     Print out the version and copyright notice for Or1ksim and exit.
316
 
317
`-h'
318
`--help'
319
     Print out help about the command line options and what they mean.
320
 
321
`-f FILE'
322
`--file FILE'
323
     Read configuration commands from the specified file, looking first
324
     in the current directory, and otherwise in the `$HOME/.or1k'
325 82 jeremybenn
     directory.  If this argument is not specified, the file `sim.cfg'
326
     in those two locations is used.  Failure to find the file is a
327
     fatal error.  *Note Configuration: Configuration, for detailed
328
     information on configuring Or1ksim.
329 19 jeremybenn
 
330
`--nosrv'
331 82 jeremybenn
     Do not start up the debug server.  This overrides any setting
332
     specified in the configuration file.  This option may not be
333
     specified with `--srv'.  If it is, a rude message is printed and
334
     the `--nosrv' option is ignored.
335 19 jeremybenn
 
336
`--srv'
337
 
338
`--srv=N'
339 82 jeremybenn
     Start up the debug server.  If the parameter, N, is specified, use
340 19 jeremybenn
     that as the TCP/IP port for the server, otherwise a random value
341 82 jeremybenn
     from the private port range (41920-65535) will be used.  This
342
     option may not be specified with `--nosrv'.  If it is, a rude
343
     message is printed and the `--nosrv' option is ignored.
344 19 jeremybenn
 
345
`-d=CONFIG_STRING'
346
`--debug-config=CONFIG_STRING'
347 82 jeremybenn
     Enable selected debug messages in Or1ksim.  This parameter is for
348
     use by developers only, and is not covered further here.  See the
349 19 jeremybenn
     source code for more details.
350
 
351
`-i'
352
`--interactive'
353
     After starting, drop into the Or1ksim interactive command shell.
354
 
355
`--strict-npc'
356
     In real hardware, setting the next program counter (NPC, SPR 16),
357 82 jeremybenn
     flushes the processor pipeline.  The consequence of this is that
358
     until the pipeline refills, reading the NPC will return zero.
359
     This is typically the case when debugging, since the processor is
360 19 jeremybenn
     stalled.
361
 
362
     Historically, Or1ksim has always returned the value of the NPC,
363 82 jeremybenn
     irrespective of when it is changed.  If the `--strict-npc' option
364
     is used, then Or1ksim will mirror real hardware more accurately.
365
     If the NPC is changed while the processor is stalled, subsequent
366 19 jeremybenn
     reads of its value will return 0 until the processor is unstalled.
367
 
368
     This is not currently the default behavior, since tools such as
369
     GDB have been implemented assuming the historic Or1ksim behavior.
370
     However at some time in the future it will become the default.
371
 
372
`--enable-profile'
373
     Enable instruction profiling.
374
 
375
`--enable-mprofile'
376
     Enable memory profiling.
377
 
378
 
379

380
File: or1ksim.info,  Node: Profiling Utility,  Next: Memory Profiling Utility,  Prev: Standalone Simulator,  Up: Usage
381
 
382
2.2 Profiling Utility
383
=====================
384
 
385 82 jeremybenn
This utility analyses instruction profile data generated by Or1ksim.
386
It may be invoked as a standalone command, or from the Or1ksim CLI.
387
The general form the standalone command is:
388 19 jeremybenn
 
389
     or32-uclinux-profile [-vhcq] [-g=FILE]
390
 
391 82 jeremybenn
Many of the options have both a short and a long form.  For example
392
`-h' or `--help'.
393 19 jeremybenn
 
394
`-v'
395
`--version'
396
     Print out the version and copyright notice for the Or1ksim
397
     profiling utility and exit.
398
 
399
`-h'
400
`--help'
401
     Print out help about the command line options and what they mean.
402
 
403
`-c'
404
`--cumulative'
405
     Show cumulative sum of cycles in functions
406
 
407
`-q'
408
`--quiet'
409
     Suppress messages
410
 
411
`-g=FILE'
412
`--generate=FILE'
413 82 jeremybenn
     The data file to analyse.  If omitted, the default file,
414 19 jeremybenn
     `sim.profile' is used.
415
 
416
 
417

418
File: or1ksim.info,  Node: Memory Profiling Utility,  Next: Simulator Library,  Prev: Profiling Utility,  Up: Usage
419
 
420
2.3 Memory Profiling Utility
421
============================
422
 
423 82 jeremybenn
This utility analyses memory profile data generated by Or1ksim.  It may
424
be invoked as a standalone command, or from the Or1ksim CLI.  The
425 19 jeremybenn
general form the standalone command is:
426
 
427
     or32-uclinux-mprofile  [-vh] [-m=M] [-g=N] [-f=FILE] FROM TO
428
 
429 82 jeremybenn
Many of the options have both a short and a long form.  For example
430
`-h' or `--help'.
431 19 jeremybenn
 
432
`-v'
433
`--version'
434
     Print out the version and copyright notice for the Or1ksim memory
435
     profiling utility and exit.
436
 
437
`-h'
438
`--help'
439
     Print out help about the command line options and what they mean.
440
 
441
`-m=M'
442
`--mode=M'
443 82 jeremybenn
     Specify the mode out output.  Permitted options are
444 19 jeremybenn
 
445
    `detailed'
446
    `d'
447 82 jeremybenn
          Detailed output.  This is the default if no mode is specified.
448 19 jeremybenn
 
449
    `pretty'
450
    `p'
451
          Pretty printed output.
452
 
453
    `access'
454
    `a'
455
          Memory accesses only.
456
 
457
    `width'
458
    `w'
459
          Access width only.
460
 
461
 
462
`-g=N'
463
`--group=N'
464
     Group 2^n bits of successive addresses together.
465
 
466
`-f=FILE'
467
`--filename=FILE'
468 82 jeremybenn
     The data file to analyse.  If not specified, the default,
469 19 jeremybenn
     `sim.profile' is used.
470
 
471
`FROM'
472
`TO'
473
     FROM and TO are respectively the start and end address of the
474
     region of memory to be analysed.
475
 
476
 
477

478
File: or1ksim.info,  Node: Simulator Library,  Prev: Memory Profiling Utility,  Up: Usage
479
 
480
2.4 Simulator Library
481
=====================
482
 
483
Or1ksim may be used as a static of dynamic library, `libsim.a' or
484 82 jeremybenn
`libsim.so'.  When compiling with the static library, the flag, `-lsim'
485 19 jeremybenn
should be added to the link command.
486
 
487
The header file `or1ksim.h' contains appropriate declarations of the
488 82 jeremybenn
functions exported by the Or1ksim library.  These are:
489 19 jeremybenn
 
490
 -- `or1ksim.h': int or1ksim_init (const char *CONFIG_FILE, const char
491
          *IMAGE_FILE, void *CLASS_PTR, unsigned long int (*UPR)(void
492
          *CLASS_PTR, unsigned long int ADDR, unsigned long int MASK),
493
          void (*UPW)(void *CLASS_PTR, unsigned long int ADDR, unsigned
494
          long int MASK, unsigned long int WDATA))
495
     The initialization function is supplied with the name of a
496
     configuration file, CONFIG_FILE, an executable image, IMAGE_FILE,
497
     a pointer to the calling class, CLASS_PTR (since the library may
498
     be used from C++) and two up-call functions, one for reads, UPR,
499
     and one for writes, UPW.
500
 
501
     *Note Configuration: Configuration, for detailed information on
502
     configuring Or1ksim and the format of the configuration file.
503
 
504
     UPW is called for any write to an address external to the model
505 82 jeremybenn
     (determined by a `generic' section in the configuration file).
506
     UPR is called for any reads to an external address.  The CLASS_PTR
507
     is passed back with these upcalls, allowing the function to
508
     associate the call with the class which originally initialized the
509
     library.
510 19 jeremybenn
 
511
     MASK indicates which bytes in the word are to be written or read.
512 82 jeremybenn
     Bytes to be read/written should have 0xff set in MASK.  Otherwise
513 19 jeremybenn
     the byte should be zero.
514
 
515
     ADDR, MASK, WDATA and the result from UPR all use host-endianess,
516 82 jeremybenn
     _not_ model-endianess.  The internal Or1ksim routines manage all
517 19 jeremybenn
     the conversion.
518
 
519
 
520
 -- `or1ksim.h': int or1ksim_run (double DURATION)
521
     Run the simulator for the simulated duration specified (in
522
     seconds).
523
 
524
 
525
 -- `or1ksim.h': void or1ksim_reset_duration (double DURATION)
526
     Change the duration of a run specified in an earlier call to
527 82 jeremybenn
     `or1ksim_run'.  Typically this is called from an upcall, which
528 19 jeremybenn
     realizes it needs to change the duration of the run specified in
529
     the call to `or1ksim_run' that has been interrupted by the upcall.
530
 
531
     The time specified is the amount of time that the run must continue
532
     for (i.e the duration from _now_, not the duration from the
533
     original call to `or1ksim_run').
534
 
535
 
536
 -- `or1ksim.h': void or1ksim_set_time_point ()
537 82 jeremybenn
     Set a timing point.  For use with `or1ksim_get_time_period'.
538 19 jeremybenn
 
539
 
540
 -- `or1ksim.h': double or1ksim_get_time_period ()
541
     Return the simulated time (in seconds) that has elapsed since the
542
     last call to `or1ksim_set_time_point'.
543
 
544
 
545
 -- `or1ksim.h': int or1ksim_is_le ()
546
     Return 1 (logical true) if the Or1ksim simulation is
547
     little-endian, 0 otherwise.
548
 
549
 
550
 -- `or1ksim.h': unsigned long int or1ksim_clock_rate ()
551 82 jeremybenn
     Return the Or1ksim clock rate (in Hz).  This is the value
552
     specified in the configuration file.
553 19 jeremybenn
 
554
 
555
 -- `or1ksim.h': void or1ksim_interrupt (int I)
556 82 jeremybenn
     Generate an edge-triggered interrupt on interrupt line I.  The
557
     interrupt is then immediately cleared automatically.  A warning
558 19 jeremybenn
     will be generated and the interrupt request ignored if level
559
     sensitive interrupts have been configured with the programmable
560
     interrupt controller (*note Interrupt Configuration: Interrupt
561
     Configuration.).
562
 
563
 
564
 -- `or1ksim.h': void or1ksim_interrupt_set (int I)
565 82 jeremybenn
     Assert a level-triggered interrupt on interrupt line I.  The
566 19 jeremybenn
     interrupt must be cleared separately by an explicit call to
567 82 jeremybenn
     `or1ksim_interrupt_clear'.  A warning will be generated, and the
568 19 jeremybenn
     interrupt request ignored if edge sensitive interrupts have been
569
     configured with the programmable interrupt controller (*note
570
     Interrupt Configuration: Interrupt Configuration.).
571
 
572
 
573
 -- `or1ksim.h': void or1ksim_interrupt_clear (int I)
574
     Clear a level-triggered interrupt on interrupt line I, which was
575 82 jeremybenn
     previously asserted by a call to `or1ksim_interrupt_set'.  A
576 19 jeremybenn
     warning will be generated, and the interrupt request ignored if
577
     edge sensitive interrupts have been configured with the
578
     programmable interrupt controller (*note Interrupt Configuration:
579
     Interrupt Configuration.).
580
 
581
 
582
The libraries will be installed in the `lib' sub-directory of the main
583
installation directory (as specified with the `--prefix' option to the
584
`configure' script).
585
 
586
For example if the main installation directory is `/opt/or1ksim', the
587 82 jeremybenn
library will be found in the `/opt/or1ksim/lib' directory.  It is
588 19 jeremybenn
available as both a static library (`libsim.a') and a shared object
589
(`libsim.so').
590
 
591
To link against the library add the `-lsim' flag when linking and do
592
one of the following:
593
 
594
   * Add the library directory to the `LD_LIBRARY_PATH' environment
595 82 jeremybenn
     variable during execution.  For example:
596 19 jeremybenn
 
597
          export LD_LIBRARY_PATH=/opt/or1ksim/lib:$LD_LIBRARY_PATH
598
 
599
   * Add the library directory to the `LD_RUN_PATH' environment
600 82 jeremybenn
     variable during linking.  For example:
601 19 jeremybenn
 
602
          export LD_RUN_PATH=/opt/or1ksim/lib:$LD_RUN_PATH
603
 
604
   * Use the linker `--rpath' option and specify the library directory
605 82 jeremybenn
     when linking your program.  For example
606 19 jeremybenn
 
607 82 jeremybenn
          gcc ...  -Wl,--rpath -Wl,/opt/or1ksim/lib ...
608 19 jeremybenn
 
609
   * Add the library directory to `/etc/ld.so.conf'
610
 
611
 
612

613
File: or1ksim.info,  Node: Configuration,  Next: Interactive Command Line,  Prev: Usage,  Up: Top
614
 
615
3 Configuration
616
***************
617
 
618 82 jeremybenn
Or1ksim is configured through a configuration file.  This is specified
619 19 jeremybenn
through the `-f' parameter to the Or1ksim command, or passed as a
620 82 jeremybenn
string when initializing the Or1ksim library.  If no file is specified,
621
the default `sim.cfg' is used.  The file is looked for first in the
622 19 jeremybenn
current directory, then in the `$HOME/.or1k' directory of the user.
623
 
624
* Menu:
625
 
626
* Configuration File Format::
627
* Simulator Configuration::
628
* Core OpenRISC Configuration::
629
* Peripheral Configuration::
630
 
631

632
File: or1ksim.info,  Node: Configuration File Format,  Next: Simulator Configuration,  Up: Configuration
633
 
634
3.1 Configuration File Format
635
=============================
636
 
637
The configuration file is a plain text file.
638
 
639
* Menu:
640
 
641
* Configuration File Preprocessing::
642
* Configuration File Syntax::
643
 
644

645
File: or1ksim.info,  Node: Configuration File Preprocessing,  Next: Configuration File Syntax,  Up: Configuration File Format
646
 
647
3.1.1 Configuration File Preprocessing
648
--------------------------------------
649
 
650 82 jeremybenn
The configuration file may include C style comments (i.e.  delimited by
651 19 jeremybenn
`/*' and `*/').
652
 
653
Configure files may be included, using
654
 
655
     include FILENAME_TO_INCLUDE
656
 
657

658
File: or1ksim.info,  Node: Configuration File Syntax,  Prev: Configuration File Preprocessing,  Up: Configuration File Format
659
 
660
3.1.2 Configuration File Syntax
661
-------------------------------
662
 
663
The configuration file is divided into a series of sections, with the
664
general form:
665
 
666
     section SECTION_NAME
667
 
668
       ...
669
 
670
     end
671
 
672
Sections may also have sub-sections within them (currently only the
673
ATA/ATAPI disc interface uses this).
674
 
675
Within a section, or sub-section are a series of parameter assignments,
676
one per line, withe the general form
677
 
678
       PARAMETER = VALUE
679
 
680
Depending on the parameter, the value may be a named value (an
681
enumeration), an integer (specified in any format acceptable in C) or a
682 82 jeremybenn
string in doubple quotes.  For flag parameters, the value 1 is used to
683
mean "true" or "on" and the value "0" to mean "false" or "off".  An
684 19 jeremybenn
example from a memory section shows each of these
685
 
686
     section memory
687
       type    = random
688
       pattern = 0x00
689
       name    = "FLASH"
690
       ...
691
     end
692
 
693
Many parameters are optional and take reasonable default values if not
694 82 jeremybenn
specified.  However there are some parameters (for example the `ce'
695 19 jeremybenn
parameter in `section memory') _must_ be specified.
696
 
697
Subsections are introduced by a keyword, with a parameter value (no `='
698 82 jeremybenn
sign), and end with the same keyword prefixed by `end'.  Thus the
699 19 jeremybenn
ATA/ATAPI inteface (`section ata') has a `device' subsection, thus:
700
 
701
     section ata
702
       ...
703
       device 0
704
         type    = 1
705
         file = "FILENAME"
706
         ...
707
       enddevice
708
       ...
709
     end
710
 
711
Some sections (for example `section sim') should appear only once.
712
Others (for example `section memory' may appear multiple times.
713
 
714
Sections may be omitted, _unless they contain parameters which are
715 82 jeremybenn
non-optional_.  If the section describes a part of the simulator which
716 19 jeremybenn
is optional (for example whether it has a UART), then that
717 82 jeremybenn
functionality will not be provided.  If the section describes a part of
718 19 jeremybenn
the simulator which is not optional (for example the CPU), then all the
719
parameters of that section will take their default values.
720
 
721
All optional parts of the functionality are always described by
722
sections including a `enabled' parameter, which can be set to 0 to
723
ensure that functionality is explicitly omitted.
724
 
725
Even if a section is disabled, all its parameters will be read and
726 82 jeremybenn
stored.  This is helpful if the section is subsequently enabled from
727
the Or1ksim command line (*note Interactive Command Line: Interactive
728 19 jeremybenn
Command Line.).
729
 
730
     Tip: It generally clearer to have sections describing _all_
731
     components, with omitted functionality explicitly indicated by
732
     setting the `enabled' parameter to 0
733
 
734
The following sections describe the various configuration sections and
735
the parameters which may be set in each.
736
 
737

738
File: or1ksim.info,  Node: Simulator Configuration,  Next: Core OpenRISC Configuration,  Prev: Configuration File Format,  Up: Configuration
739
 
740
3.2 Simulator Configuration
741
===========================
742
 
743
* Menu:
744
 
745
* Simulator Behavior::
746
* Verification API Configuration::
747
* CUC Configuration::
748
 
749

750
File: or1ksim.info,  Node: Simulator Behavior,  Next: Verification API Configuration,  Up: Simulator Configuration
751
 
752
3.2.1 Simulator Behavior
753
------------------------
754
 
755 82 jeremybenn
Simulator behavior is described in `section sim'.  This section should
756
appear only once.  The following parameters may be specified.
757 19 jeremybenn
 
758
`verbose = 0|1'
759 82 jeremybenn
     If 1 (true), print extra messages.  Default 0.
760 19 jeremybenn
 
761
`debug = 0-9'
762 82 jeremybenn
 
763
     higher the value the greater the number of messages.  Default 0.
764
     Negative values will be treated as 0 (with a warning).  Values
765
     that are too large will be treated as 9 (with a warning).
766 19 jeremybenn
 
767
`profile = 0|1'
768
     If 1 (true) generate a profiling file using the file specified in
769 82 jeremybenn
     the `prof_file' parameter or otherwise `sim.profile'.  Default 0.
770 19 jeremybenn
 
771
`prof_file = ``FILENAME'''
772 82 jeremybenn
     Specifies the file to be used with the `profile' parameter.
773
     Default `sim.profile'.  For backwards compatibility, the
774
     alternative name `prof_fn' is supported for this parameter, but
775
     deprecated.
776 19 jeremybenn
 
777
`mprofile = 0|1'
778
     If 1 (true) generate a memory profiling file using the file
779
     specified in the `mprof_file' parameter or otherwise
780 82 jeremybenn
     `sim.mprofile'.  Default 0.
781 19 jeremybenn
 
782
`mprof_fn = ``FILENAME'''
783
     Specifies the file to be used with the `mprofile' parameter.
784 82 jeremybenn
     Default `sim.mprofile'.  For backwards compatibility, the
785 19 jeremybenn
     alternative name `mprof_fn' is supported for this parameter, but
786
     deprecated.
787
 
788
`history = 0|1'
789 82 jeremybenn
     If 1 (true) track execution flow.  Default 0.
790 19 jeremybenn
 
791
          Note: Setting this parameter seriously degrades performance.
792
 
793
          Note: If this execution flow tracking is enabled, then
794
          `dependstats' must be enabled in the CPU configuration
795
          section (*note CPU Configuration: CPU Configuration.).
796
 
797
`exe_log = 0|1'
798 82 jeremybenn
     If 1 (true), generate an execution log.  Log is written to the
799
     file specified in parameter `exe_log_file'.  Default 0.
800 19 jeremybenn
 
801
          Note: Setting this parameter seriously degrades performance.
802
 
803
`exe_log_type = default|hardware|simple|software'
804
     Type of execution log to produce.
805
 
806
    `default'
807 82 jeremybenn
          Produce default output for the execution log.  In the current
808 19 jeremybenn
          implementation this is the equivalent of `hardware'.
809
 
810
    `hardware'
811
          After each instruction execution, log the number of
812
          instructions executed so far, the next instruction to execute
813
          (in hex), the general purpose registers (GPRs), status
814
          register, exception program counter, exception, effective
815
          address register and exception status register.
816
 
817
    `simple'
818
          After each instruction execution, log the number of
819
          instructions executed so far and the next instruction to
820
          execute, symbolically disassembled.
821
 
822
    `software'
823
          After each instruction execution, log the number of
824
          instructions executed so far and the next instruction to
825 82 jeremybenn
          execute, symbolically disassembled.  Also show the value of
826 19 jeremybenn
          each operand to the instruction.
827
 
828
 
829 82 jeremybenn
     Default value `hardware'.  Any unrecognized keyword (case
830 19 jeremybenn
     insensitive) will be treated as the default with a warning.
831
 
832
          Note: Execution logs can be _very_ big.
833
 
834
`exe_log_start = VALUE'
835 82 jeremybenn
     Address of the first instruction to start logging.  Default 0.
836 19 jeremybenn
 
837
`exe_log_end = VALUE'
838 82 jeremybenn
     Address of the last instruction to log.  Default no limit (i.e
839
     once started logging will continue until the simulator exits).
840 19 jeremybenn
 
841
`exe_log_marker = VALUE'
842
     Specifies the number of instructions between printing horizontal
843 82 jeremybenn
     markers.  Default is to produce no markers.
844 19 jeremybenn
 
845
`exe_log_file = FILENAME'
846
     Filename for the execution log filename if `exe_log' is enabled.
847 82 jeremybenn
     Default `executed.log'.  For backwards compatibility, the
848 19 jeremybenn
     alternative name `exe_log_fn' is supported for this parameter, but
849
     deprecated.
850
 
851
`clkcycle = VALUE[ps|ns|us|ms]'
852 82 jeremybenn
     Specify the time taken by one clock cycle.  If no units are
853
     specified, `ps' is assumed.  Default 4000ps (250MHz).
854 19 jeremybenn
 
855
 
856

857
File: or1ksim.info,  Node: Verification API Configuration,  Next: CUC Configuration,  Prev: Simulator Behavior,  Up: Simulator Configuration
858
 
859
3.2.2 Verification API (VAPI) Configuration
860
-------------------------------------------
861
 
862
The Verification API (VAPI) provides a TCP/IP interface to allow
863 82 jeremybenn
components of the simulation to be controlled externally.  *Note
864 19 jeremybenn
Verification API: Verification API, for more details.
865
 
866 82 jeremybenn
Verification API configuration is described in `section vapi'.  This
867
section may appear at most once.  The following parameters may be
868 19 jeremybenn
specified.
869
 
870
`enabled = 0|1'
871
     If 1 (true), verification API is enabled and its server started.
872
     If 0 (the default), it is disabled.
873
 
874
`server_port = VALUE'
875
     When VAPI is enabled, communication will be via TCP/IP on the port
876 82 jeremybenn
     specified by VALUE.  The value must lie in the range 1 to 65535.
877 19 jeremybenn
     The default value is 50000.
878
 
879 82 jeremybenn
          Tip: There is no registered port for Or1ksim VAPI.  Good
880 19 jeremybenn
          practice suggests users should adopt port values in the
881 82 jeremybenn
          "Dynamic" or "Private" port range, i.e.  49152-65535.
882 19 jeremybenn
 
883
`log_enabled = 0|1'
884
     If 1 (true), all VAPI requests and sent commands will be logged.
885 82 jeremybenn
     If 0 (the default), logging is diabled.  Logs are written to the
886 19 jeremybenn
     file specified by the `vapi_log_file' field (see below).
887
 
888
          Caution: This can generate a substantial amount of file I/O
889
          and seriously degrade simulator performance.
890
 
891
`hide_device_id = 0|1'
892 82 jeremybenn
     If 1 (true) don't log the device ID.  If 0 (the default), log the
893
     device ID.  This feature (when set to 1) is provided for backwards
894 19 jeremybenn
     compatibility with an old version of VAPI.
895
 
896
`vapi_log_file = "FILENAME"'
897
     Use `filename' as the file for logged data is logging is enabled
898 82 jeremybenn
     (see `log_enabled' above).  The default is `"vapi.log"'.  For
899 19 jeremybenn
     backwards compatibility, the alternative name `vapi_log_fn' is
900
     supported for this parameter, but deprecated.
901
 
902
 
903

904
File: or1ksim.info,  Node: CUC Configuration,  Prev: Verification API Configuration,  Up: Simulator Configuration
905
 
906
3.2.3 Custom Unit Compiler (CUC) Configuration
907
----------------------------------------------
908
 
909
The Custom Unit Compiler (CUC) was a project by Marko Mlinar to generate
910 82 jeremybenn
Verilog from ANSI C functions.  The project seems to not have progressed
911
beyond the initial prototype phase.  The configuration parameters are
912 19 jeremybenn
described here for the record.
913
 
914 82 jeremybenn
CUC configuration is described in `section cuc'.  This section may
915
appear at most once.  The following parameters may be specified.
916 19 jeremybenn
 
917
`memory_order = none|weak|strong|exact'
918
     This parameter specifies the memory ordering required:
919
 
920
    `memory_order=none'
921
          Different memory ordering, even if there are dependencies.
922
          Bursts can be made, width can change.
923
 
924 82 jeremybenn
          Different memory ordering, even if there are dependencies.  If
925 19 jeremybenn
          dependencies cannot occur, then bursts can be made, width can
926
          change.
927
 
928 82 jeremybenn
          Same memory ordering.  Bursts can be made, width can change.
929 19 jeremybenn
 
930
          Exactly the same memory ordering and widths.
931
 
932
 
933 82 jeremybenn
     The default value is `memory_order=exact'.  Invalid memory
934 19 jeremybenn
     orderings are ignored with a warning.
935
 
936
`calling_convention = 0|1'
937 82 jeremybenn
     If 1 (true), programs follow OpenRISC calling conventions.  If 0
938 19 jeremybenn
     (the default), they may use other convenitions.
939
 
940
`enable_bursts = 0 | 1'
941 82 jeremybenn
     If 1 (true), bursts are detected.  If 0 (the default), bursts are
942 19 jeremybenn
     not detected.
943
 
944
`no_multicycle = 0 | 1'
945 82 jeremybenn
     If 1 (true), no multicycle logic paths will be generated.  If 0
946
     (the default), multicycle logic paths will be generated.
947 19 jeremybenn
 
948
`timings_file = "FILENAME"'
949 82 jeremybenn
     FILENAME specifies a file containing timing information.  The
950
     default value is `"virtex.tim"'.  For backwards compatibility, the
951 19 jeremybenn
     alternative name `timings_fn' is supported for this parameter, but
952
     deprecated.
953
 
954
 
955

956
File: or1ksim.info,  Node: Core OpenRISC Configuration,  Next: Peripheral Configuration,  Prev: Simulator Configuration,  Up: Configuration
957
 
958
3.3 Configuring the OpenRISC Architectural Components
959
=====================================================
960
 
961
* Menu:
962
 
963
* CPU Configuration::
964
* Memory Configuration::
965
* Memory Management Configuration::
966
* Cache Configuration::
967
* Interrupt Configuration::
968
* Power Management Configuration::
969
* Branch Prediction Configuration::
970
* Debug Interface Configuration::
971
 
972

973
File: or1ksim.info,  Node: CPU Configuration,  Next: Memory Configuration,  Up: Core OpenRISC Configuration
974
 
975
3.3.1 CPU Configuration
976
-----------------------
977
 
978 82 jeremybenn
CPU configuration is described in `section cpu'.  This section should
979
appear only once.  At present Or1ksim does not model multi-CPU systems.
980 19 jeremybenn
The following parameters may be specified.
981
 
982
`ver = VALUE'
983
 
984
`cfg = VALUE'
985
 
986
`rev = VALUE'
987
     The values are used to form the corresponding fields in the `VR'
988 82 jeremybenn
     Special Purpose Register (SPR 0).  Default values 0.  A warning is
989 19 jeremybenn
     given and the value truncated if it is too large (8 bits for `ver'
990
     and `cfg', 6 bits for `rev').
991
 
992
`upr = VALUE'
993
     Used as the value of the Unit Present Register (UPR) Special
994 82 jeremybenn
     Purpose Register (SPR 1) to VALUE.  Default value is 0x0000075f,
995 19 jeremybenn
     i.e.
996
        * UPR present (0x00000001)
997
 
998
        * Data cache present (0x00000002)
999
 
1000
        * Instruction cache present (0x00000004)
1001
 
1002
        * Data MMY present (0x00000008)
1003
 
1004
        * Instruction MMU present (0x00000010)
1005
 
1006
        * Debug unit present (0x00000040)
1007
 
1008
        * Power management unit present (0x00000100)
1009
 
1010
        * Programmable interrupt controller present (0x00000200)
1011
 
1012
        * Tick timer present (0x00000400)
1013
 
1014
     However, with the exection of the UPR present (0x00000001) and tick
1015
     timer present, the various fields will be modified with the values
1016
     specified in their corresponding configuration sections.
1017
 
1018
`cfgr = VALUE'
1019
     Sets the CPU configuration register (Special Purpose Register 2) to
1020 82 jeremybenn
     VALUE.  Default value is 0x00000020, i.e.  support for the ORBIS32
1021
     instruction set.  Attempts to set any other value are accepted, but
1022 19 jeremybenn
     issue a warning that there is no support for the instruction set.
1023
 
1024
`sr = VALUE'
1025
     Sets the supervision register Special Purpose Register (SPR 0x11)
1026 82 jeremybenn
     to VALUE.  Default value is 0x00008001, i.e.  start in supervision
1027 19 jeremybenn
     mode (0x00000001) and set the "Fixed One" bit (0x00008000).
1028
 
1029
`superscalar = 0|1'
1030 82 jeremybenn
     If 1, the processor operates in superscalar mode.  Default value is
1031 19 jeremybenn
     0.
1032
 
1033
     In the current simulator, the only functional effect of superscalar
1034
     mode is to affect the calculation of the number of cycles taken to
1035
     execute an instruction.
1036
 
1037
          Caution: The code for this does not appear to be complete or
1038
          well tested, so users are advised not to use this option.
1039
 
1040
`hazards = 0|1'
1041 82 jeremybenn
     If 1, data hazards are tracked in a superscalar CPU.  Default
1042
     value is 0.
1043 19 jeremybenn
 
1044
     In the current simulator, the only functional effect is to cause
1045
     logging of hazard waiting information if the CPU is superscalar.
1046
     However nowhere in the simulator is this data actually computed,
1047
     so the net result is probably to have no effect.
1048
 
1049
     if harzards are tracked, current hazards can be displayed using the
1050
     simulator's `r' command.
1051
 
1052
          Caution: The code for this does not appear to be complete or
1053
          well tested, so users are advised not to use this option.
1054
 
1055
`dependstats = 0|1'
1056 82 jeremybenn
     If 1, inter-instruction dependencies are calculated.  Default
1057
     value 0.
1058 19 jeremybenn
 
1059
     If these values are calculated, the depencies can be displayed
1060
     using the simulator's `stat' command.
1061
 
1062
          Note: This field must be enabled, if execution execution flow
1063
          tracking (field `history') has been requested in the simulator
1064
          configuration section (*note Simulator Behavior: Simulator
1065
          Behavior.).
1066
 
1067
`sbuf_len = VALUE'
1068
     The length of the store buffer is set to VALUE, which must be no
1069 82 jeremybenn
     greater than 256.  Larger values will be truncated to 256 with a
1070
     warning.  Negative values will be treated as 0 with a warning.
1071
     Use 0 to disable the store buffer.
1072 19 jeremybenn
 
1073
     When the store buffer is active, stores are accumulated and
1074
     committed when I/O is idle.
1075
 
1076
 
1077

1078
File: or1ksim.info,  Node: Memory Configuration,  Next: Memory Management Configuration,  Prev: CPU Configuration,  Up: Core OpenRISC Configuration
1079
 
1080
3.3.2 Memory Configuration
1081
--------------------------
1082
 
1083 82 jeremybenn
Memory configuration is described in `section memory'.  This section
1084
may appear multiple times, specifying multiple blocks of memory.  The
1085 19 jeremybenn
following parameters may be specified.
1086
 
1087
`type=random|pattern|unknown|zero'
1088 82 jeremybenn
     Specifies the values to which memory should be initialized.  The
1089 19 jeremybenn
     default value is `unknown'.
1090
 
1091
    `random'
1092 82 jeremybenn
          Set the memory values to be a random value.  A seed for the
1093 19 jeremybenn
          random generator may be set using the `random_seed' field in
1094
          this section (see below), thus ensuring the same "random"
1095
          values are used each time.
1096
 
1097
    `pattern'
1098
          Set the memory values to be a pattern value, which is set
1099
          using the `pattern' field in this section (see below).
1100
 
1101
    `unknown'
1102 82 jeremybenn
          The memory values are not initialized (i.e.  left "unknown").
1103 19 jeremybenn
          This option will yield faster initialization of the simulator.
1104
 
1105
    `zero'
1106 82 jeremybenn
          Set the memory values to be 0.  This is the equivalent of
1107 19 jeremybenn
          `type=pattern' and a `pattern' value of 0, and implemented as
1108
          such.
1109
 
1110
               Note: As a consequence, if the `pattern' field is
1111
               _subsequently_ specified in this section, the value in
1112
               that field will be used instead of zero to initialize
1113
               the memory.
1114
 
1115
 
1116
`random_seed = VALUE'
1117 82 jeremybenn
     Set the seed for the random number generator to VALUE.  This only
1118 19 jeremybenn
     has any effect for memory type `random'.
1119
 
1120
     The default value is -1, which means the seed will be set from a
1121
     call to the `time' function, thus ensuring different random values
1122 82 jeremybenn
     are used on each run.  The simulator prints out the seed used in
1123 19 jeremybenn
     this case, allowing repeat runs to regenerate the same random
1124
     values used in any particular run.
1125
 
1126
`pattern = VALUE'
1127 82 jeremybenn
     Set the pattern to be used when initializing memory to VALUE.  The
1128
     default value is 0.  This only has any effect for memory type
1129
     `pattern'.  The least significant 8 bits of this value is used to
1130
     initialize each byte.  More than 8 bits can be specified, but will
1131 19 jeremybenn
     ignored with a warning.
1132
 
1133
          Tip: The default value, is equivalent to setting the memory
1134 82 jeremybenn
          `type' to be `zero'.  If that is what is intended, then using
1135 19 jeremybenn
          `type=zero' explicitly is better than using `type=pattern'
1136
          and not specifying a value for `pattern'.
1137
 
1138
`baseaddr = VALUE'
1139 82 jeremybenn
     Set the base address of the memory to VALUE.  It should be aligned
1140 19 jeremybenn
     to a multiple of the memory size rounded up to the nearest 2^n.
1141
     The default value is 0.
1142
 
1143
`size = VALUE'
1144 82 jeremybenn
     Set the size of the memory block to be VALUE bytes.  This should
1145
     be a multiple of 4 (i.e.  word aligned).  The default value is
1146
     1024.
1147 19 jeremybenn
 
1148
          Note: When allocating memory, the simulator will allocate the
1149
          nearest 2^n bytes greater than or equal to VALUE, and will not
1150
          notice memory misses in any part of the memory between VALUE
1151
          and the amount allocated.
1152
 
1153
          As a consequence users are strongly recommended to specify
1154 82 jeremybenn
          memory sizes that are an exact power of 2.  If some other
1155 19 jeremybenn
          amount of memory is required, it should be specified as
1156
          separate, contiguous blocks, each of which is a power of 2 in
1157
          size.
1158
 
1159
`name = "TEXT"'
1160 82 jeremybenn
     Name the block.  Typically these describe the type of memory being
1161
     modeled (thus `"SRAM"' or `"Flash"'.  The default is
1162 19 jeremybenn
     `"anonymous memory block"'.
1163
 
1164
          Note: It is not clear that this information is currently ever
1165 82 jeremybenn
          used in normal operation of the simulator.  Even the `info'
1166 19 jeremybenn
          command of the simulator ignores it.
1167
 
1168
`ce = VALUE'
1169 82 jeremybenn
     Set the chip enable index of the memory instance.  Each memory
1170 19 jeremybenn
     instance should have a unique chip enable index, which should be
1171 82 jeremybenn
     greater than or equal to zero.  This is used by the memory
1172 19 jeremybenn
     controller when identifying different memory instances.
1173
 
1174
     The default value is -1 (invalid).
1175
 
1176
`mc = VALUE'
1177 82 jeremybenn
     Specifies the memory controller this memory is connected to.  It
1178 19 jeremybenn
     should correspond to the `index' field specified in a `section mc'
1179
     for a memory controller (*note Memory Controller Configuration:
1180
     Memory Controller Configuration.).
1181
 
1182
     Default value is 0, which is also the default value of a memory
1183 82 jeremybenn
     controller `index' field.  This is suitable therefore for designs
1184 19 jeremybenn
     with just one memory controller.
1185
 
1186
`delayr = VALUE'
1187 82 jeremybenn
     The number of cycles required for a read access.  Set to -1 if the
1188
     memory does not support reading.  Default value 1.  The simulator
1189 19 jeremybenn
     will add this number of cycles to the total instruction cycle
1190
     count when reading from main memory.
1191
 
1192
`delayw = VALUE'
1193 82 jeremybenn
     The number of cycles required for a write access.  Set to -1 if the
1194
     memory does not support writing.  Default value 1.  The simulator
1195 19 jeremybenn
     will add this number of cycles to the total instruction cycle
1196
     count when writing to main memory.
1197
 
1198
`log = "FILE"'
1199
     If specified, `file' names a file for all memory accesses to be
1200 82 jeremybenn
     logged.  If not specified, the default value, NULL is used, meaning
1201 19 jeremybenn
     that the memory is not logged.
1202
 
1203
 
1204

1205
File: or1ksim.info,  Node: Memory Management Configuration,  Next: Cache Configuration,  Prev: Memory Configuration,  Up: Core OpenRISC Configuration
1206
 
1207
3.3.3 Memory Management Configuration
1208
-------------------------------------
1209
 
1210
Memory Management Unit (MMU) configuration is described in `section
1211
dmmu' (for the data MMU) and `section immu' (for the instruction MMU).
1212 82 jeremybenn
Each section should appear at most once.  The following parameters may
1213 19 jeremybenn
be specified.
1214
 
1215
`enabled = 0|1'
1216
     If 1 (true), the data or instruction (as appropriate) MMU is
1217 82 jeremybenn
     enabled.  If 0 (the default), it is disabled.
1218 19 jeremybenn
 
1219
`nsets = VALUE'
1220
     Sets the number of data or instruction (as appropriate) TLB sets to
1221 82 jeremybenn
     VALUE, which must be a power of two, not exceeding 128.  Values
1222
     which do not fit these criteria are ignored with a warning.  The
1223 19 jeremybenn
     default value is 1.
1224
 
1225
`nways = VALUE'
1226
     Sets the number of data or instruction (as appropriate) TLB ways to
1227 82 jeremybenn
     VALUE.  The value must be in the range 1 to 4.  Values outside
1228
     this range are ignored with a warning.  The default value is 1.
1229 19 jeremybenn
 
1230
`pagesize = VALUE'
1231
     The data or instruction (as appropriate) MMU page size is set to
1232 82 jeremybenn
     VALUE, which must be a power of 2.  Values which are not a power
1233
     of 2 are ignored with a warning.  The default is 8192 (0x2000).
1234 19 jeremybenn
 
1235
`entrysize = VALUE'
1236
     The data or instruction (as appropriate) MMU entry size is set to
1237 82 jeremybenn
     VALUE, which must be a power of 2.  Values which are not a power
1238
     of 2 are ignored with a warning.  The default value is 1.
1239 19 jeremybenn
 
1240
          Note: Or1ksim does not appear to use the `entrysize' parameter
1241 82 jeremybenn
          in its simulation of the MMUs.  Thus setting this value does
1242 19 jeremybenn
          not seem to matter.
1243
 
1244
`ustates = VALUE'
1245
     The number of instruction usage states for the data or instruction
1246
     (as appropriate) MMU is set to VALUE, which must be 2, 3 or 4.
1247 82 jeremybenn
     Values outside this range are ignored with a warning.  The default
1248 19 jeremybenn
     value is 2.
1249
 
1250
          Note: Or1ksim does not appear to use the `ustates' parameter
1251 82 jeremybenn
          in its simulation of the MMUs.  Thus setting this value does
1252 19 jeremybenn
          not seem to matter.
1253
 
1254
`hitdelay = VALUE'
1255
     Set the number of cycles a data or instruction (as appropriate) MMU
1256 82 jeremybenn
     hit costs.  Default value 1.
1257 19 jeremybenn
 
1258
`missdelay = VALUE'
1259
     Set the number of cycles a data or instruction (as appropriate) MMU
1260 82 jeremybenn
     miss costs.  Default value 1.
1261 19 jeremybenn
 
1262
 
1263

1264
File: or1ksim.info,  Node: Cache Configuration,  Next: Interrupt Configuration,  Prev: Memory Management Configuration,  Up: Core OpenRISC Configuration
1265
 
1266
3.3.4 Cache Configuration
1267
-------------------------
1268
 
1269
Cache configuration is described in `section dc' (for the data cache)
1270 82 jeremybenn
and `seciton ic' (for the instruction cache).  Each section should
1271
appear at most once.  The following parameters may be specified.
1272 19 jeremybenn
 
1273
`enabled = 0|1'
1274
     If 1 (true), the data or instruction (as appropriate) cache is
1275 82 jeremybenn
     enabled.  If 0 (the default), it is disabled.
1276 19 jeremybenn
 
1277
`nsets = VALUE'
1278
     Sets the number of data or instruction (as appropriate) cache sets
1279
     to VALUE, which must be a power of two, not exceeding
1280
     `MAX_DC_SETS' (for the data cache) or `MAX_IC_SETS' (for the
1281 82 jeremybenn
     instruction cache).  At the time of writing, these constants are
1282
     both defined in the code to be 1024).  The default value is 1.
1283 19 jeremybenn
 
1284
`nways = VALUE'
1285
     Sets the number of data or instruction (as appropriate) cache ways
1286
     to VALUE, which must be a power of two, not exceeding
1287
     `MAX_DC_WAYS' (for the data cache) or `MAX_IC_WAYS' (for the
1288 82 jeremybenn
     instruction cache).  At the time of writing, these constants are
1289
     both defined in the code to be 32).  The default value is 1.
1290 19 jeremybenn
 
1291
`blocksize = VALUE'
1292
     The data or instruction (as appropriate) cache block size is set to
1293 82 jeremybenn
     VALUE bytes, which must be either 16 or 32.  The default is 16.
1294 19 jeremybenn
 
1295
`ustates = VALUE'
1296
     The number of instruction usage states for the data or instruction
1297
     (as appropriate) cache is set to VALUE, which must be 2, 3 or 4.
1298
     The default value is 2.
1299
 
1300
`hitdelay = VALUE'
1301 82 jeremybenn
     _Instruction cache only_.  Set the number of cycles an instruction
1302
     cache hit costs.  Default value 1.
1303 19 jeremybenn
 
1304
`missdelay = VALUE'
1305 82 jeremybenn
     _Instruction cache only_.  Set the number of cycles an instruction
1306
     cache miss costs.  Default value 1.
1307 19 jeremybenn
 
1308
`load_hitdelay = VALUE'
1309 82 jeremybenn
     _Data cache only_.  Set the number of cycles a data load cache hit
1310
     costs.  Default value 2.
1311 19 jeremybenn
 
1312
`load_missdelay = VALUE'
1313 82 jeremybenn
     _Data cache only_.  Set the number of cycles a data load cache
1314
     miss costs.  Default value 2.
1315 19 jeremybenn
 
1316
`store_hitdelay = VALUE'
1317 82 jeremybenn
     _Data cache only_.  Set the number of cycles a data store cache hit
1318
     costs.  Default value 0.
1319 19 jeremybenn
 
1320
`store_missdelay = VALUE'
1321 82 jeremybenn
     _Data cache only_.  Set the number of cycles a data store cache
1322
     miss costs.  Default value 0.
1323 19 jeremybenn
 
1324
 
1325

1326
File: or1ksim.info,  Node: Interrupt Configuration,  Next: Power Management Configuration,  Prev: Cache Configuration,  Up: Core OpenRISC Configuration
1327
 
1328
3.3.5 Interrupt Configuration
1329
-----------------------------
1330
 
1331
Programmable Interrupt Controller (PIC) configuration is described in
1332 82 jeremybenn
`section pic'.  This section may appear at most once--Or1ksim has no
1333
mechanism for handling multiple interrupt controllers.  The following
1334 19 jeremybenn
parameters may be specified.
1335
 
1336
`enabled = 0|1'
1337 82 jeremybenn
     If 1 (true), the programmable interrupt controller is enabled.  If
1338
 
1339 19 jeremybenn
 
1340
`edge_trigger = 0|1'
1341
     If 1 (true, the default), the programmable interrupt controller is
1342 82 jeremybenn
     edge triggered.  If 0 (false), it is level triggered.
1343 19 jeremybenn
 
1344
 
1345

1346
File: or1ksim.info,  Node: Power Management Configuration,  Next: Branch Prediction Configuration,  Prev: Interrupt Configuration,  Up: Core OpenRISC Configuration
1347
 
1348
3.3.6 Power Management Configuration
1349
------------------------------------
1350
 
1351 82 jeremybenn
Power management implementation is incomplete.  At present the effect
1352 19 jeremybenn
(which only happens when the power management unit is enabled) of
1353
setting the different bits in the power management Special Purpose
1354
Register (PMR, SPR 0x4000) is
1355
 
1356
`SDF (bit mask 0x0000000f)'
1357
     No effect - these bits are ignored
1358
 
1359
`DME (bit mask 0x00000010)'
1360
`SME (bit mask 0x00000020)'
1361
     Both these bits cause the processor to stop executing
1362 82 jeremybenn
     instructions.  However all other functions (debug interaction, CLI,
1363 19 jeremybenn
     VAPI etc) carry on as normal.
1364
 
1365
`DCGE (bit mask 0x00000004)'
1366
     No effect - this bit is ignored
1367
 
1368
`SUME (bit mask 0x00000008)'
1369
     Enabling this bit causes a message to be printed, advising that the
1370
     processor is suspending and the simulator exits.
1371
 
1372
 
1373
On reset all bits are cleared.
1374
 
1375 82 jeremybenn
Power management configuration is described in `section pm'.  This
1376
section may appear at most once.  The following parameter may be
1377 19 jeremybenn
specified.
1378
 
1379
`enabled = 0|1'
1380 82 jeremybenn
     If 1 (true), power management is enabled.  If 0 (the default), it
1381
     is disabled.
1382 19 jeremybenn
 
1383
 
1384

1385
File: or1ksim.info,  Node: Branch Prediction Configuration,  Next: Debug Interface Configuration,  Prev: Power Management Configuration,  Up: Core OpenRISC Configuration
1386
 
1387
3.3.7 Branch Prediction Configuration
1388
-------------------------------------
1389
 
1390
From examining the code base, it seems the branch prediction function
1391 82 jeremybenn
is not fully implemented.  At present the functionality seems
1392
restricted to collection of statistics.
1393 19 jeremybenn
 
1394 82 jeremybenn
Branch prediction configuration is described in `section bpb'.  This
1395
section may appear at most once.  The following parameters may be
1396 19 jeremybenn
specified.
1397
 
1398
`enabled = 0|1'
1399 82 jeremybenn
     If 1 (true), branch prediction is enabled.  If 0 (the default), it
1400 19 jeremybenn
     is disabled.
1401
 
1402
`btic = 0|1'
1403
     If 1 (true), the branch target instruction cache model is enabled.
1404
     If 0 (the default), it is disabled.
1405
 
1406
`sbp_bf_fwd = 0|1'
1407 82 jeremybenn
     If 1 (true), use forward prediction for the `l.bf' instruction.  If
1408 19 jeremybenn
 
1409
     instruction.
1410
 
1411
`sbp_bnf_fwd = 0|1'
1412 82 jeremybenn
     If 1 (true), use forward prediction for the `l.bnf' instruction.
1413
     If 0 (the default), do not use forward prediction for this
1414 19 jeremybenn
     instruction.
1415
 
1416
`hitdelay = VALUE'
1417 82 jeremybenn
     Set the number of cycles a branch prediction hit costs.  Default
1418 19 jeremybenn
     value 0.
1419
 
1420
`missdelay = VALUE'
1421 82 jeremybenn
     Set the number of cycles a branch prediction miss costs.  Default
1422 19 jeremybenn
     value 0.
1423
 
1424
 
1425

1426
File: or1ksim.info,  Node: Debug Interface Configuration,  Prev: Branch Prediction Configuration,  Up: Core OpenRISC Configuration
1427
 
1428
3.3.8 Debug Interface Configuration
1429
-----------------------------------
1430
 
1431
The debug unit and debug interface configuration is described in
1432 82 jeremybenn
`section debug'.  This section may appear at most once.  The following
1433 19 jeremybenn
parameters may be specified.
1434
 
1435
`enabled = 0|1'
1436 82 jeremybenn
     If 1 (true), the debug unit is enabled.  If 0 (the default), it is
1437 19 jeremybenn
     disabled.
1438
 
1439
          Note: This enables the functionality of the debug unit (its
1440 82 jeremybenn
          registers etc) within the mode.  It does not provide any
1441
          external interface to the debug unit.  For that, see
1442 19 jeremybenn
          `gdb_enabled' and `rsp_enabled' below.
1443
 
1444
`rsp_enabled = 0|1'
1445
     If 1 (true), the GDB "Remote Serial Protocol" server is started,
1446
     provding an interface to an external GNU debugger, using the port
1447
     specified in the `rsp_port' field (see below), or the
1448 82 jeremybenn
     `or1ksim-rsp' TCP/IP service.  If 0 (the default), the server is
1449 19 jeremybenn
     not started, and no external interface is provided.
1450
 
1451
     For more detailed information on the interface to the GNU Debugger
1452
     see Embecosm Application Note 2, `Howto: Porting the GNU Debugger
1453
     Practical Experience with the OpenRISC 1000 Architecture', by
1454
     Jeremy Bennett, published by Embecosm Limited (`www.embecosm.com').
1455
 
1456 82 jeremybenn
          Note: `rsp_enabled' may not be enabled with `gdb_enabled' (see
1457
          below).  If both are enabled, a warning is issued and only
1458
          the "Remote Serial Protocol" interface is enabled.
1459 19 jeremybenn
 
1460
`rsp_port = VALUE'
1461
     VALUE specifies the port to be used for the GDB "Remote Serial
1462 82 jeremybenn
     Protocol" interface to the GNU Debugger (GDB).  Default value
1463
     51000.  If the value 0 is specified, Or1ksim will instead look for
1464 19 jeremybenn
     a TCP/IP service named `or1ksim-rsp'.
1465
 
1466
          Tip: There is no registered port for Or1ksim "Remote Serial
1467 82 jeremybenn
          Protocol" service `or1ksim-rsp'.  Good practice suggests
1468
          users should adopt port values in the "Dynamic" or "Private"
1469
          port range, i.e.  49152-65535.
1470 19 jeremybenn
 
1471
`gdb_enabled = 0|1'
1472
     If 1 (true), the OpenRISC Remote JTAG protocol server is started,
1473
     provding an interface to an external GNU debugger, using the port
1474
     specified in the `server_port' field (see below), or the `or1ksim'
1475 82 jeremybenn
     TCP/IP service.  If 0 (the default), the server is not started,
1476
     and no external interface is provided.
1477 19 jeremybenn
 
1478
     For more detailed information on the interface to the GNU Debugger
1479
     see Embecosm Application Note 2, `Howto: Porting the GNU Debugger
1480
     Practical Experience with the OpenRISC 1000 Architecture', by
1481
     Jeremy Bennett, published by Embecosm Limited (`www.embecosm.com').
1482
 
1483
          Note: The OpenRISC Remote JTAG protocol is unique to
1484 82 jeremybenn
          OpenRISC, and remains only for backward compatibility.  New
1485 19 jeremybenn
          users should adopt the standard GDB "Remote Serial Protocol"
1486
          interface (see `rsp_enabled' above) providing access to a
1487
          wider range of GDB functionality.
1488
 
1489 82 jeremybenn
          Note: `gdb_enabled' may not be enabled with `rsp_enabled'.
1490
          If both are enabled, a warning is issued and only the "Remote
1491 19 jeremybenn
          Serial Protocol" interface is enabled.
1492
 
1493
`server_port = VALUE'
1494
     VALUE specifies the port to be used for the OpenRISC Rmote JTAG
1495 82 jeremybenn
     protocol interface to the GNU Debugger (GDB).  Default value
1496
     51000.  If the value 0 is specified, Or1ksim will instead look for
1497
     a TCP/IP service named `or1ksim'.
1498 19 jeremybenn
 
1499
          Tip: There is no registered port for Or1ksim Remote JTAG
1500 82 jeremybenn
          Interface or service `or1ksim'.  Good practice suggests users
1501 19 jeremybenn
          should adopt port values in the "Dynamic" or "Private" port
1502 82 jeremybenn
          range, i.e.  49152-65535.
1503 19 jeremybenn
 
1504
`vapi_id = VALUE'
1505
     VALUE specifies the value of the Verification API (VAPI) base
1506 82 jeremybenn
     address to be used with the debug unit.  *Note Verification API:
1507 19 jeremybenn
     Verification API, for more details.
1508
 
1509
     If this is specified and VALUE is non-zero, all OpenRISC Remote
1510
     JTAG protocol transactions will be logged to the VAPI log file, if
1511 82 jeremybenn
     enabled.  This is the only functionality associated with VAPI for
1512
     the debug unit.  No VAPI commands are sent, nor requests handled.
1513 19 jeremybenn
 
1514
 
1515

1516
File: or1ksim.info,  Node: Peripheral Configuration,  Prev: Core OpenRISC Configuration,  Up: Configuration
1517
 
1518
3.4 Configuring Memory Mapped Peripherals
1519
=========================================
1520
 
1521 82 jeremybenn
All peripheral components are optional.  If they are specified, then
1522 19 jeremybenn
(unlike other components) by default they are enabled.
1523
 
1524
* Menu:
1525
 
1526
* Memory Controller Configuration::
1527
* UART Configuration::
1528
* DMA Configuration::
1529
* Ethernet Configuration::
1530
* GPIO Configuration::
1531
* Display Interface Configuration::
1532
* Frame Buffer Configuration::
1533
* Keyboard Configuration::
1534
* Disc Interface Configuration::
1535
* Generic Peripheral Configuration::
1536
 
1537

1538
File: or1ksim.info,  Node: Memory Controller Configuration,  Next: UART Configuration,  Up: Peripheral Configuration
1539
 
1540
3.4.1 Memory Controller Configuration
1541
-------------------------------------
1542
 
1543
The memory controller used in Or1ksim is the component implemented at
1544 82 jeremybenn
OpenCores, and found in the top level CVS directory, `mem_ctrl'.  It is
1545 19 jeremybenn
described in the document `Memory Controller IP Core' by Rudolf
1546 82 jeremybenn
Usselmann, which can be found in the `doc' subdirectory.  It is a
1547
memory mapped component, which resides on the main OpenRISC Wishbone
1548
data bus.
1549 19 jeremybenn
 
1550 82 jeremybenn
The memory controller configuration is described in `section mc'.  This
1551 19 jeremybenn
section may appear multiple times, specifying multiple memory
1552 82 jeremybenn
controllers.  The following parameters may be specified.
1553 19 jeremybenn
 
1554
`enabled = 0|1'
1555 82 jeremybenn
     If 1 (true, the default), this memory controller is enabled.  If
1556
     0, it is disabled.
1557 19 jeremybenn
 
1558
          Note: The memory controller can effectively also be disabled
1559
          by setting an appropriate power on control register value
1560 82 jeremybenn
          (see below).  However this should only be used if it is
1561 19 jeremybenn
          desired to specifically model this behavior of the memory
1562
          controller, not as a way of disabling the memory controller
1563
          in general.
1564
 
1565
`baseaddr = VALUE'
1566
     Set the base address of the memory controller's memory mapped
1567 82 jeremybenn
     registers to VALUE.  The default is 0, which is probably not a
1568 19 jeremybenn
     sensible value.
1569
 
1570
     The memory controller has a 7 bit address bus, with a total of 19
1571
     32-bit registers, at addresses 0x00 through 0x4c (address 0x0c and
1572
     addresses 0x50 through 0x7c are not used).
1573
 
1574
`poc = VALUE'
1575
     Specifies the value of the power on control register, The least
1576
     signficant two bits specify the bus width (use 0 for an 8-bit bus,
1577
     1 for a 16-bit bus and 2 for a 32-bit bus) and the next two bits
1578
     the type of memory connected (use 0 for a disabled interface, 1
1579
     for SSRAM, 2 for asyncrhonous devices and 3 for synchronous
1580
     devices).
1581
 
1582
     If other bits are specified, they are ignored with a warning.
1583
 
1584
          Caution: The default value, 0, corresponds to a disabled
1585
          8-bit bus, and is likely not the most suitable value
1586
 
1587
`index = VALUE'
1588
     Specify the index of this memory controller amongst all the memory
1589 82 jeremybenn
     controllers.  This value should be unique for each memory
1590 19 jeremybenn
     controller, and is used to associate specific memories with the
1591
     controller, through the `mc' field in the `section memory'
1592
     configuration (*note Memory Configuration: Memory Configuration.).
1593
 
1594
     The default value, 0, is suitable when there is only one memory
1595
     controller.
1596
 
1597
 
1598

1599
File: or1ksim.info,  Node: UART Configuration,  Next: DMA Configuration,  Prev: Memory Controller Configuration,  Up: Peripheral Configuration
1600
 
1601
3.4.2 UART Configuration
1602
------------------------
1603
 
1604
The UART implemented in Or1ksim follows the specification of the
1605 82 jeremybenn
National Semiconductor 16450 and 16550 parts.  It is a memory mapped
1606 19 jeremybenn
component, which resides on the main OpenRISC Wishbone data bus.
1607
 
1608
The component provides a number of interfaces to emulate the behavior
1609
of an external terminal connected to the UART.
1610
 
1611 82 jeremybenn
UART configuration is described in `section uart'.  This section may
1612
appear multiple times, specifying multiple UARTs.  The following
1613 19 jeremybenn
parameters may be specified.
1614
 
1615
`enabled = 0|1'
1616 82 jeremybenn
     If 1 (true, the default), this UART is enabled.  If 0, it is
1617 19 jeremybenn
     disabled.
1618
 
1619
`baseaddr = VALUE'
1620
     Set the base address of the UART's memory mapped registers to
1621 82 jeremybenn
     VALUE.  The default is 0, which is probably not a sensible value.
1622 19 jeremybenn
 
1623
     The UART has a 3 bit address bus, with a total of 8 8-bit
1624
     registers, at addresses 0x0 through 0x7.
1625
 
1626
`channel = "TYPE:ARGS"'
1627
     Specify the channel representing the terminal connected to the UART
1628
     Rx & Tx pins.
1629
 
1630
    `channel="file:`rxfile',`txfile'"'
1631
          Read input characters from the file `rxfile' and write output
1632
          characters to the file `txfile' (which will be created if
1633
          required).
1634
 
1635
    `channel="xterm:ARGS"'
1636
          Create an xterm on startup, write UART Tx traffic to the
1637
          xterm and take Rx traffic from the keyboard when the xterm
1638 82 jeremybenn
          window is selected.  Additional arguments to the xterm
1639
          command (for example specifying window size may be specified
1640
          in ARGS, or this may be left blank.
1641 19 jeremybenn
 
1642
    `channel="tcp:VALUE"'
1643
          Open the TCP/IP port specified by VALUE and read and write
1644
          UART traffic from and to it.
1645
 
1646
          Typically a telnet session is connected to the other end of
1647
          this port.
1648
 
1649
               Tip: There is no registered port for Or1ksim telnet UART
1650 82 jeremybenn
               connection.  Priviledged access is required to read
1651 19 jeremybenn
               traffic on the registered "well-known" telnet port (23).
1652
               Instead users should use port values in the "Dynamic" or
1653 82 jeremybenn
               "Private" port range, i.e.  49152-65535.
1654 19 jeremybenn
 
1655
    `channel="fd:`rxfd',`txfd'"'
1656
          Read and write characters from and to the existing open
1657
          numerical file descriptors, file `rxfd' and `txfd'.
1658
 
1659
    `channel="tty:device=/dev/ttyS0,baud=9600"'
1660
          Read and write characters from and to a physical serial port.
1661
          The precise device (shown here as `/dev/ttyS0') may vary from
1662
          machine to machine.
1663
 
1664
 
1665
     The default value for this field is `"xterm:"'.
1666
 
1667
`irq = VALUE'
1668 82 jeremybenn
     Use VALUE as the IRQ number of this UART.  Default value 0.
1669 19 jeremybenn
 
1670
`16550 = 0|1'
1671 82 jeremybenn
     If 1 (true), the UART has the functionality of a 16550.  If 0 (the
1672
     default), it has the functionality of a 16450.  The principal
1673 19 jeremybenn
     difference is that the 16550 can buffer multiple characters.
1674
 
1675
`jitter = VALUE'
1676
     Set the jitter, modeled as a time to block, to VALUE milliseconds.
1677 82 jeremybenn
     Set to -1 to disable jitter modeling.  Default value 0.
1678 19 jeremybenn
 
1679
          Note: This functionality has yet to be implemented, so this
1680
          parameter has no effect.
1681
 
1682
`vapi_id = VALUE'
1683
     VALUE specifies the value of the Verification API (VAPI) base
1684 82 jeremybenn
     address to be used with the UART.  *Note Verification API:
1685 19 jeremybenn
     Verification API, for more details, which details the use of the
1686
     VAPI with the UART.
1687
 
1688
 
1689

1690
File: or1ksim.info,  Node: DMA Configuration,  Next: Ethernet Configuration,  Prev: UART Configuration,  Up: Peripheral Configuration
1691
 
1692
3.4.3 DMA Configuration
1693
-----------------------
1694
 
1695
The DMA controller used in Or1ksim is the component implemented at
1696 82 jeremybenn
OpenCores, and found in the top level CVS directory, `wb_dma'.  It is
1697 19 jeremybenn
described in the document `Wishbone DMA/Bridge IP Core' by Rudolf
1698 82 jeremybenn
Usselmann, which can be found in the `doc' subdirectory.  It is a
1699
memory mapped component, which resides on the main OpenRISC Wishbone
1700
data bus.  The present implementation is incomplete, intended only to
1701
support the Ethernet interface (*note Ethernet Configuration::),
1702
although the Ethernet interface is not yet completed.
1703 19 jeremybenn
 
1704 82 jeremybenn
DMA configuration is described in `section dma'.  This section may
1705
appear multiple times, specifying multiple DMA controllers.  The
1706 19 jeremybenn
following parameters may be specified.
1707
 
1708
`enabled = 0|1'
1709 82 jeremybenn
     If 1 (true, the default), this DMA controller is enabled.  If 0,
1710
     it is disabled.
1711 19 jeremybenn
 
1712
`baseaddr = VALUE'
1713
     Set the base address of the DMA's memory mapped registers to
1714 82 jeremybenn
     VALUE.  The default is 0, which is probably not a sensible value.
1715 19 jeremybenn
 
1716
     The DMA controller has a 10 bit address bus, with a total of 253
1717 82 jeremybenn
     32-bit registers.  The first 5 registers at addresses 0x000 through
1718
     0x010 control the overall behavior of the DMA controller.  There
1719
     are then 31 blocks of 8 registers, controlling each of the 31 DMA
1720
     channels available.  Addresses 0x014 through 0x01c are not used.
1721 19 jeremybenn
 
1722
`irq = VALUE'
1723 82 jeremybenn
     Use VALUE as the IRQ number of this DMA controller.  Default value
1724 19 jeremybenn
     0.
1725
 
1726
`vapi_id = VALUE'
1727
     VALUE specifies the value of the Verification API (VAPI) base
1728 82 jeremybenn
     address to be used with the DMA controller.  *Note Verification
1729 19 jeremybenn
     API: Verification API, for more details, which details the use of
1730
     the VAPI with the DMA controller.
1731
 
1732
 
1733

1734
File: or1ksim.info,  Node: Ethernet Configuration,  Next: GPIO Configuration,  Prev: DMA Configuration,  Up: Peripheral Configuration
1735
 
1736
3.4.4 Ethernet Configuration
1737
----------------------------
1738
 
1739
The Ethernet MAC used in Or1ksim is the component implemented at
1740 82 jeremybenn
OpenCores, and found in the top level CVS directory, `ethernet'.  It
1741
also forms part of the OpenRISC SoC, ORPSoC.  It is described in the
1742 19 jeremybenn
document `Ethernet IP Core Specification' by Igor Mohor, which can be
1743 82 jeremybenn
found in the `doc' subdirectory.  It is a memory mapped component,
1744
which resides on the main OpenRISC Wishbone data bus.
1745 19 jeremybenn
 
1746 82 jeremybenn
Ethernet configuration is described in `section ethernet'.  This
1747
section may appear multiple times, specifying multiple Ethernet
1748
interfaces.  The following parameters may be specified.
1749 19 jeremybenn
 
1750
`enabled = 0|1'
1751 82 jeremybenn
     If 1 (true, the default), this Ethernet MAC is enabled.  If 0, it
1752
     is disabled.
1753 19 jeremybenn
 
1754
`baseaddr = VALUE'
1755
     Set the base address of the MAC's memory mapped registers to
1756 82 jeremybenn
     VALUE.  The default is 0, which is probably not a sensible value.
1757 19 jeremybenn
 
1758
     The Ethernet MAC has a 7-bit address bus, with a total of 21
1759 82 jeremybenn
     32-bit registers.  Addresses 0x54 through 0x7c are not used.
1760 19 jeremybenn
 
1761
          Note: The Ethernet specification describes a Tx control
1762 82 jeremybenn
          register, `TXCTRL', at address 0x50.  However this register
1763
          is not implemented in the Or1ksim model.
1764 19 jeremybenn
 
1765
`dma = VALUE'
1766
     VALUE specifies the DMA controller with which this Ethernet is
1767 82 jeremybenn
     associated.  The default value is 0.
1768 19 jeremybenn
 
1769
          Note: Support for external DMA is not provided in the current
1770 82 jeremybenn
          implementation, and this value is ignored.  In any case there
1771 19 jeremybenn
          is no equivalent field to which this can be matched in the
1772
          current DMA component implementation (*note DMA
1773
          Configuration: DMA Configuration.).
1774
 
1775
`irq = VALUE'
1776 82 jeremybenn
     Use VALUE as the IRQ number of this Ethernet MAC.  Default value 0.
1777 19 jeremybenn
 
1778
`rtx_type = 0|1'
1779
     If 1 (true) use a socket interface to the Ethernet (see parameter
1780 82 jeremybenn
     `sockif' below).  If 0 (the default), use a file interface,
1781
     reading and writing from and to the files specified in the
1782
     `rxfile' and `txfile' parameters (see below).
1783 19 jeremybenn
 
1784
          Note: By default the socket interface is not provided in
1785 82 jeremybenn
          Or1ksim.  If it is required, this must be requested when
1786 19 jeremybenn
          configuring, by use of the `--enable-ethphy' option to
1787
          `configure'.
1788
 
1789
               configure --target=or32-uclinux --enable-ethphy ...
1790
 
1791
`rx_channel = RXVALUE'
1792
`tx_channel = TXVALUE'
1793
     RXVALUE specifies the DMA channel to use for receive and TXVALUE
1794 82 jeremybenn
     the DMA channel to use for transmit.  Both default to 0.
1795 19 jeremybenn
 
1796
          Note: As noted above, support for external DMA is not
1797
          provided in the current implementation, and so these values
1798
          are ignored.
1799
 
1800
`rxfile = "RXFILE"'
1801
`txfile = "TXFILE"'
1802
     When `rtx_type' is 0 (see above), RXFILE specifies the file to use
1803
     as input and TXFILE specifies the fie to use as output.
1804
 
1805 82 jeremybenn
     The file contains a sequence of packets.  Each packet consists of a
1806
     packet length (32 bits), followed by that many bytes of data.
1807
     Once the input file is empty, the Ethernet MAC behaves as though
1808
     there were no data on the Ethernet.  The default values of these
1809 19 jeremybenn
     parameters are `"eth_rx"' and `"eth_tx"' respectively.
1810
 
1811 82 jeremybenn
     The input file must exist and be readable.  The output file must be
1812
     writable and will be created if necessary.  If either of these
1813 19 jeremybenn
     conditions is not met, a warning will be given.
1814
 
1815
`sockif = "SERVICE"'
1816
     When `rtx_type' is 1 (see above), SERVICE specifies the service to
1817 82 jeremybenn
     use for communication.  This may be TCP/IP or UDP/IP.  The default
1818 19 jeremybenn
     value of this parameter is `"or1ksim_eth"'.
1819
 
1820
`vapi_id = VALUE'
1821
     VALUE specifies the value of the Verification API (VAPI) base
1822 82 jeremybenn
     address to be used with the Ethernet PHY.  *Note Verification API:
1823 19 jeremybenn
     Verification API, for more details, which details the use of the
1824
     VAPI with the DMA controller.
1825
 
1826
 
1827

1828
File: or1ksim.info,  Node: GPIO Configuration,  Next: Display Interface Configuration,  Prev: Ethernet Configuration,  Up: Peripheral Configuration
1829
 
1830
3.4.5 GPIO Configuration
1831
------------------------
1832
 
1833
The GPIO used in Or1ksim is the component implemented at OpenCores, and
1834 82 jeremybenn
found in the top level CVS directory, `gpio'.  It is described in the
1835 19 jeremybenn
document `GPIO IP Core Specification' by Damjan Lampret and Goran
1836 82 jeremybenn
Djakovic, which can be found in the `doc' subdirectory.  It is a memory
1837 19 jeremybenn
mapped component, which resides on the main OpenRISC Wishbone data bus.
1838
 
1839 82 jeremybenn
GPIO configuration is described in `section gpio'.  This section may
1840
appear multiple times, specifying multiple GPIO devices.  The following
1841 19 jeremybenn
parameters may be specified.
1842
 
1843
`enabled = 0|1'
1844 82 jeremybenn
     If 1 (true, the default), this GPIO is enabled.  If 0, it is
1845 19 jeremybenn
     disabled.
1846
 
1847
`baseaddr = VALUE'
1848
     Set the base address of the GPIO's memory mapped registers to
1849 82 jeremybenn
     VALUE.  The default is 0, which is probably not a sensible value.
1850 19 jeremybenn
 
1851
     The GPIO has a 6 bit address bus, with a total of 10 32-bit
1852
     registers, although the number of bits that are actively used
1853 82 jeremybenn
     varies.  Addresses 0x28 through 0x3c are not used.
1854 19 jeremybenn
 
1855
`irq = VALUE'
1856 82 jeremybenn
     Use VALUE as the IRQ number of this GPIO.  Default value 0.
1857 19 jeremybenn
 
1858
`vapi_id = VALUE'
1859
     VALUE specifies the value of the Verification API (VAPI) base
1860 82 jeremybenn
     address to be used with the GPIO.  *Note Verification API:
1861 19 jeremybenn
     Verification API, for more details, which details the use of the
1862 82 jeremybenn
     VAPI with the GPIO controller.  For backwards compatibility, the
1863 19 jeremybenn
     alternative name `base_vapi_id' is supported for this parameter,
1864
     but deprecated.
1865
 
1866
 
1867

1868
File: or1ksim.info,  Node: Display Interface Configuration,  Next: Frame Buffer Configuration,  Prev: GPIO Configuration,  Up: Peripheral Configuration
1869
 
1870
3.4.6 Display Interface Configuration
1871
-------------------------------------
1872
 
1873
Or1ksim models a VGA interface to an external monitor.  The VGA
1874
controller used in Or1ksim is the component implemented at OpenCores,
1875
and found in the top level CVS directory, `vga_lcd', with no support
1876 82 jeremybenn
for the optional hardware cursors.  It is described in the document
1877 19 jeremybenn
`VGA/LCD Core v2.0 Specifications' by Richard Herveille, which can be
1878 82 jeremybenn
found in the `doc' subdirectory.  It is a memory mapped component,
1879
which resides on the main OpenRISC Wishbone data bus.
1880 19 jeremybenn
 
1881
The current implementation provides only functionality to dump the
1882
screen to a file at intervals.
1883
 
1884 82 jeremybenn
VGA controller configuration is described in `section vga'.  This
1885 19 jeremybenn
section may appear multiple times, specifying multiple VGA controllers.
1886
The following parameters may be specified.
1887
 
1888
`enabled = 0|1'
1889 82 jeremybenn
     If 1 (true, the default), this VGA is enabled.  If 0, it is
1890 19 jeremybenn
     disabled.
1891
 
1892
`baseaddr = VALUE'
1893
     Set the base address of the VGA controller's memory mapped
1894 82 jeremybenn
     registers to VALUE.  The default is 0, which is probably not a
1895 19 jeremybenn
     sensible value.
1896
 
1897
     The VGA controller has a 12-bit address bus, with 7 32-bit
1898
     registers, at addresses 0x000 through 0x018, and two color lookup
1899 82 jeremybenn
     tables at addresses 0x800 through 0xfff.  The hardware cursor
1900 19 jeremybenn
     registers are not implemented, so addresses 0x01c through 0x7fc
1901
     are not used.
1902
 
1903
`irq = VALUE'
1904 82 jeremybenn
     Use VALUE as the IRQ number of this VGA controller.  Default value
1905 19 jeremybenn
     0.
1906
 
1907
`refresh_rate = VALUE'
1908 82 jeremybenn
     VALUE specifies number of cycles between screen dumps.  Default
1909 19 jeremybenn
     value is derived from the simulation clock cycle time (*note
1910
     Simulator Behavior: Simulator Behavior.), to correspond to dumping
1911
     50 times per simulated second.
1912
 
1913
`txfile = "FILE"'
1914
     FILE specifies the base of the filename for screen dumps.
1915
     Successive screen dumps will be in BMP format, in files with the
1916
     name `FILENNNN.bmp', where NNNN is a sequential count of the
1917 82 jeremybenn
     screen dumps starting at zero.  The default value is `"vga_out"'.
1918 19 jeremybenn
     For backwards compatibility, the alternative name `filename' is
1919
     supported for this parameter, but deprecated.
1920
 
1921
 
1922

1923
File: or1ksim.info,  Node: Frame Buffer Configuration,  Next: Keyboard Configuration,  Prev: Display Interface Configuration,  Up: Peripheral Configuration
1924
 
1925
3.4.7 Frame Buffer Configuration
1926
--------------------------------
1927
 
1928 82 jeremybenn
     Caution: The frame buffer is only partially implemented.  Its
1929 19 jeremybenn
     configuration fields are described here, but the component should
1930 82 jeremybenn
     not be used at this time.  Like the VGA controller, it is designed
1931 19 jeremybenn
     to make screen dumps to file.
1932
 
1933 82 jeremybenn
Frame buffer configuration is described in `section fb'.  This section
1934
may appear multiple times, specifying multiple frame buffers.  The
1935 19 jeremybenn
following parameters may be specified.
1936
 
1937
`enabled = 0|1'
1938 82 jeremybenn
     If 1 (true, the default), this frame buffer is enabled.  If 0, it
1939 19 jeremybenn
     is disabled.
1940
 
1941
`baseaddr = VALUE'
1942
     Set the base address of the frame buffer's memory mapped registers
1943 82 jeremybenn
     to VALUE.  The default is 0, which is probably not a sensible
1944
     value.
1945 19 jeremybenn
 
1946
     The frame buffer has an 121-bit address bus, with 4 32-bit
1947
     registers, at addresses 0x000 through 0x00c, and a PAL lookup
1948 82 jeremybenn
     table at addresses 0x400 through 0x4ff.  Addresses 0x010 through
1949 19 jeremybenn
     0x3fc and addresses 0x500 through 0x7ff are not used.
1950
 
1951
`refresh_rate = VALUE'
1952 82 jeremybenn
     VALUE specifies number of cycles between screen dumps.  Default
1953 19 jeremybenn
     value is derived from the simulation clock cycle time (*note
1954
     Simulator Behavior: Simulator Behavior.), to correspond to dumping
1955
     50 times per simulated second.
1956
 
1957
`txfile = "FILE"'
1958
     FILE specifies the base of the filename for screen dumps.
1959
     Successive screen dumps will be in BMP format, in files with the
1960
     name `FILENNNN.bmp', where NNNN is a sequential count of the
1961 82 jeremybenn
     screen dumps starting at zero.  The default value is `"fb_out"'.
1962 19 jeremybenn
     For backwards compatibility, the alternative name `filename' is
1963
     supported for this parameter, but deprecated.
1964
 
1965
 
1966

1967
File: or1ksim.info,  Node: Keyboard Configuration,  Next: Disc Interface Configuration,  Prev: Frame Buffer Configuration,  Up: Peripheral Configuration
1968
 
1969
3.4.8 Keyboard Configuration (PS2)
1970
----------------------------------
1971
 
1972 82 jeremybenn
The PS2 interface provided by Or1ksim is not documented.  It may be
1973 19 jeremybenn
based on the PS2 project at OpenCores, and found in the top level CVS
1974 82 jeremybenn
directory, `ps2'.  However this project lacks any documentation beyond
1975
its project webpage.  Since most PS2 interfaces follow the Intel i8042
1976 19 jeremybenn
standard, this is presumably what is expected with this device.
1977
 
1978
The implementation only provides for keyboard support, which is
1979 82 jeremybenn
modelled as a file of keystrokes.  There is no mouse support.
1980 19 jeremybenn
 
1981
     Caution: A standard i8042 device has two registers at addresses
1982 82 jeremybenn
     0x60 (command) and 0x64 (status).  Inspection of the code,
1983
     suggests that the Or1ksim component places these registers at
1984
     addresses 0x00 and 0x04.
1985 19 jeremybenn
 
1986
     The port of Linux for the OpenRISC 1000, which runs on Or1ksim
1987
     implements the i8042 device driver, anticipating these registers
1988 82 jeremybenn
     reside at their conventional address.  It seems unlikel that this
1989 19 jeremybenn
     code will work.
1990
 
1991
     This component should be used with caution.
1992
 
1993 82 jeremybenn
Keyboard configuration is described in `section kbd'.  This section may
1994
appear multiple times, specifying multiple keyboard interfaces.  The
1995 19 jeremybenn
following parameters may be specified.
1996
 
1997
`enabled = 0|1'
1998 82 jeremybenn
     If 1 (true, the default), this keyboard is enabled.  If 0, it is
1999 19 jeremybenn
     disabled.
2000
 
2001
`baseaddr = VALUE'
2002
     Set the base address of the keyboard's memory mapped registers to
2003 82 jeremybenn
     VALUE.  The default is 0, which is probably not a sensible value.
2004 19 jeremybenn
 
2005
     The keyboard PS/2 interface has an 3-bit address bus, with 2 8-bit
2006
     registers, at addresses 0x000 and 0x004.
2007
 
2008
          Caution: As noted above, a standard Intel 8042 interface
2009
          would expect to find these registers at locations 0x60 and
2010
          0x64, thus requiring at least a 7-bit bus.
2011
 
2012
`irq = VALUE'
2013 82 jeremybenn
     Use VALUE as the IRQ number of this Keyboard interface.  Default
2014 19 jeremybenn
     value 0.
2015
 
2016
`rxfile = "FILE"'
2017
     `file' specifies a file containing raw key stroke data, which
2018 82 jeremybenn
     models the input from a physical keyboard.  The default value is
2019 19 jeremybenn
     `"kbd_in"'.
2020
 
2021
 
2022

2023
File: or1ksim.info,  Node: Disc Interface Configuration,  Next: Generic Peripheral Configuration,  Prev: Keyboard Configuration,  Up: Peripheral Configuration
2024
 
2025
3.4.9 Disc Interface Configuration
2026
----------------------------------
2027
 
2028
The ATA/ATAPI disc controller used in Or1ksim is the OCIDEC (OpenCores
2029
IDE Controller) component implemented at OpenCores, and found in the
2030 82 jeremybenn
top level CVS directory, `ata'.  It is described in the document
2031 19 jeremybenn
`ATA/ATAPI-5 Core Specification' by Richard Herveille, which can be
2032 82 jeremybenn
found in the `doc' subdirectory.  It is a memory mapped component,
2033
which resides on the main OpenRISC Wishbone data bus.
2034 19 jeremybenn
 
2035 82 jeremybenn
ATA/ATAPI configuration is described in `section ata'.  This section
2036
may appear multiple times, specifying multiple disc controllers.  The
2037 19 jeremybenn
following parameters may be specified.
2038
 
2039
`enabled = 0|1'
2040 82 jeremybenn
     If 1 (true, the default), this ATA/ATAPI interface is enabled.  If
2041 19 jeremybenn
     0, it is disabled.
2042
 
2043
`baseaddr = VALUE'
2044
     Set the base address of the ATA/ATAPI interface's memory mapped
2045 82 jeremybenn
     registers to VALUE.  The default is 0, which is probably not a
2046 19 jeremybenn
     sensible value.
2047
 
2048
     The ATA/ATAPI PS/2 interface has an 5-bit address bus, with 8
2049 82 jeremybenn
     32-bit registers.  Depending on the version of the OCIDEC
2050
     ATA/ATAPI interface selected (see `dev_id' below), not all
2051
     registers will be available.
2052 19 jeremybenn
 
2053
`irq = VALUE'
2054 82 jeremybenn
     Use VALUE as the IRQ number of this ATA/ATAPI interface.  Default
2055 19 jeremybenn
     value 0.
2056
 
2057
`dev_id = 1|2|3'
2058
     This parameter specifies which version of the OCIDEC ATA/ATAPI
2059 82 jeremybenn
     interface to model.  The default value is 1.
2060 19 jeremybenn
 
2061
     Version 1 supports only the `CTRL', `STAT' and `PCTR' registers.
2062
     Versions 2 & 3 add the `FCTR' registers, Version 3 adds the `DTR'
2063
     registers and the `RXD'/`TXD' registers.
2064
 
2065
`rev = VALUE'
2066
     Set the VALUE as the revision of the OCIDEC ATA/ATAPI interface.
2067 82 jeremybenn
     The default value is 1.  The default value is 0.  Its value should
2068
     be in the range 0-15.  Larger values are truncated with a warning.
2069 19 jeremybenn
     This only affects the reset value of the `STAT' register, where it
2070
     forms bits 24-27.
2071
 
2072
`pio_mode0_t1 = VALUE'
2073
`pio_mode0_t2 = VALUE'
2074
`pio_mode0_t4 = VALUE'
2075
`pio_mode0_teoc = VALUE'
2076
     These parameters specify the timings for use with Programmed
2077 82 jeremybenn
     Input/Output (PIO) transfers.  They are specified as the number of
2078 19 jeremybenn
     clock cycles - 2, rounded up to the next highest integer, or zero
2079 82 jeremybenn
     if that would be negative.  The values should not exceed 255.  If
2080 19 jeremybenn
     they do, they will be ignored with a warning.
2081
 
2082
     See the ATA/ATAPI-5 specification for explanations of each of these
2083 82 jeremybenn
     timing parameters.  The default values are:
2084 19 jeremybenn
 
2085
          pio_mode0_t1   =  6
2086
          pio_mode0_t2   = 28
2087
          pio_mode0_t4   =  2
2088
          pio_mode0_teoc = 23
2089
 
2090
`dma_mode0_tm = VALUE'
2091
`dma_mode0_td = VALUE'
2092
`dma_mode0_teoc = VALUE'
2093
     These parameters specify the timings for use with DMA transfers.
2094
     They are specified as the number of clock cycles - 2, rounded up
2095
     to the next highest integer, or zero if that would be negative.
2096 82 jeremybenn
     The values should not exceed 255.  If they do, they will be
2097
     ignored with a warning.
2098 19 jeremybenn
 
2099
     See the ATA/ATAPI-5 specification for explanations of each of these
2100 82 jeremybenn
     timing parameters.  The default values are:
2101 19 jeremybenn
 
2102
          dma_mode0_tm   =  4
2103
          dma_mode0_td   = 21
2104
          dma_mode0_teoc = 21
2105
 
2106
 
2107
3.4.9.1 ATA/ATAPI Device Configuration
2108
......................................
2109
 
2110 82 jeremybenn
Within the `section ata', each device is specified separately.  The
2111 19 jeremybenn
device subsection is introduced by
2112
 
2113
     device VALUE
2114
 
2115 82 jeremybenn
VALUE is the device number, which should be 0 or 1.  The subsection
2116
ends with `enddevice'.  Note that if the same device number is
2117
specified more than once, the previous values will be overwritten.
2118
Within the `device' subsection, the following parameters may appear:
2119 19 jeremybenn
 
2120
`type = VALUE'
2121
     VALUEspecifies the type of device: 0 (the default) for "not
2122
     connected", 1 for hard disk simulated in a file and 2 for local
2123
     system hard disk.
2124
 
2125
`file = "FILENAME"'
2126
     `filename' specifies the file to be used for a simulated ATA
2127 82 jeremybenn
     device if the file type (see `type' above) is 1.  Default value
2128 19 jeremybenn
     `"ata-FileN"', where N is the device number.
2129
 
2130
`size = VALUE'
2131
     VALUE specifies the size of a simulated ATA device if the file
2132 82 jeremybenn
     type (see `type' above) is 1.  The default value is zero.
2133 19 jeremybenn
 
2134
`packet = 0|1'
2135 82 jeremybenn
     If 1 (true), implement the PACKET command feature set.  If 0 (the
2136 19 jeremybenn
     default), do not implement the PACKET command feature set.
2137
 
2138
`firmware = "STR"'
2139
     Firmware to report in response to the "Identify Device" command.
2140
     Default `"02207031"'.
2141
 
2142
`heads = VALUE'
2143 82 jeremybenn
     Number of heads in the device.  Default 7, use -1 to disable all
2144 19 jeremybenn
     heads.
2145
 
2146
`sectors = VALUE'
2147 82 jeremybenn
     Number of sectors per track in the device.  Default 32.
2148 19 jeremybenn
 
2149
`mwdma = 0|1|2|-1'
2150 82 jeremybenn
     Highest multi-word DMA mode supported.  Default 2, use -1 to
2151 19 jeremybenn
     disable.
2152
 
2153
`pio = 0|1|2|3|4'
2154 82 jeremybenn
     Highest PIO mode supported.  Default 4.
2155 19 jeremybenn
 
2156
 
2157

2158
File: or1ksim.info,  Node: Generic Peripheral Configuration,  Prev: Disc Interface Configuration,  Up: Peripheral Configuration
2159
 
2160
3.4.10 Generic Peripheral Configuration
2161
---------------------------------------
2162
 
2163
When used as a library (*note Simulator Library: Simulator Library.),
2164
Or1ksim makes provision for any additional peripheral to be implemented
2165 82 jeremybenn
externally.  Any read or write access to this peripheral's memory map
2166
generates "upcall"s to an external handler.  This interface can support
2167 19 jeremybenn
either C or C++, and was particularly designed to facilitate support
2168
for OSCI SystemC (see `http://www.systemc.org').
2169
 
2170
Generic peripheral configuration is described in `section generic'.
2171
This section may appear multiple times, specifying multiple external
2172 82 jeremybenn
peripherals.  The following parameters may be specified.
2173 19 jeremybenn
 
2174
`enabled = 0|1'
2175 82 jeremybenn
     If 1 (true, the default), this ATA/ATAPI interface is enabled.  If
2176 19 jeremybenn
     0, it is disabled.
2177
 
2178
`baseaddr = VALUE'
2179
     Set the base address of the generic peripheral's memory mapped
2180 82 jeremybenn
     registers to VALUE.  The default is 0, which is probably not a
2181 19 jeremybenn
     sensible value.
2182
 
2183
     The size of the memory mapped register space is controlled by the
2184
     `size' paramter, described below.
2185
 
2186
`size = VALUE'
2187
     Set the size of the generic peripheral's memory mapped register
2188 82 jeremybenn
     space to VALUE bytes.  Any read or write accesses to addresses with
2189 19 jeremybenn
     offsets of 0 to VALUE-1 bytes from the base address specified in
2190
     parameter `baseaddr' (see above) will be directed to the external
2191
     interface.
2192
 
2193 82 jeremybenn
     VALUE will be rounded up the nearest power of 2.  It's default
2194
     value is zero.  If VALUE is not an exact power of two, accesses to
2195 19 jeremybenn
     address offsets of VALUE or above up to the next power of 2 will
2196
     generate a warning, and have no effect (reads will return zero).
2197
 
2198
`name = "STR"'
2199 82 jeremybenn
     This gives the peripheral the name `"STR"'.  This is used to
2200 19 jeremybenn
     identify the peripheral in error messages and warnings, and when
2201 82 jeremybenn
     reporting its status.  The default value is
2202 19 jeremybenn
     `"anonymous external peripheral"'.
2203
 
2204
`byte_enabled = 0|1'
2205
`hw_enabled = 0|1'
2206
`word_enabled = 0|1'
2207
     If 1 (true, the default), these parameters respectively enable the
2208 82 jeremybenn
     device for byte wide, half-word wide and word wide accesses.  If 0,
2209 19 jeremybenn
     accesses of that width will fail.
2210
 
2211
 
2212

2213
File: or1ksim.info,  Node: Interactive Command Line,  Next: Verification API,  Prev: Configuration,  Up: Top
2214
 
2215
4 Interactive Command Line
2216
**************************
2217
 
2218
If started with the `-f' flag, or if interrupted with `ctrl-C', Or1ksim
2219 82 jeremybenn
provides the user with an interactive command line.  The commands
2220 19 jeremybenn
available, which may not be abbreviated, are:
2221
 
2222
`q'
2223
     Exit the simulator
2224
 
2225
`r'
2226 82 jeremybenn
     Display all the General Purpose Registers (GPRs).  Also shows the
2227 19 jeremybenn
     just executed and next to be executed instructions symbolically
2228
     and the state of the flag in the Supervision Register.
2229
 
2230
`t'
2231
     Execute the next instruction and then display register/instruction
2232
     information as with the `r' command (see above).
2233
 
2234
`run NUM [ hush ]'
2235 82 jeremybenn
     Execute NUM instructions.  The register/instruction information is
2236 19 jeremybenn
     displayed after each instruction, as with the `r' command (see
2237
     above) _unless_ `hush' is specified.
2238
 
2239
`pr REG VALUE'
2240
     Patch register REG with VALUE.
2241
 
2242
`dm FROMADDR [ TOADDR ]'
2243 82 jeremybenn
     Display memory bytes between FROMADDR and TOADDR.  If TOADDR is
2244
     not given, 64 bytes are displayed, starting at FROMADDR.
2245 19 jeremybenn
 
2246
          Caution: The output from this command is broken (a bug).
2247 82 jeremybenn
          Or1ksim attempts to print out 16 bytes per row.  However,
2248 19 jeremybenn
          instead of printing out the address at the start of each row,
2249
          it prints the address (of the first of the 16 bytes) before
2250
          _each_ byte.
2251
 
2252
`de FROMADDR [ TOADDR ]'
2253 82 jeremybenn
     Disassemble code between FROMADDR and TOADDR.  If TOADDR is not
2254 19 jeremybenn
     given, 16 instructions are disassembled.
2255
 
2256
     The disassembly is entirely numerical, and gives no symbolic
2257
     information.
2258
 
2259
`pm ADDR VALUE'
2260
     Patch the 4 bytes in memory starting at ADDR with the 32-bit VALUE.
2261
 
2262
`pc VALUE'
2263
     Patch the program counter with VALUE.
2264
 
2265
`cm FROMADDR TOADDR SIZE'
2266
     Copy SIZE bytes in memory from FROMADDR to TOADDR.
2267
 
2268
`break ADDR'
2269
     Toggle the breakpoint set at ADDR.
2270
 
2271
`breaks'
2272
     List all set breakpoints
2273
 
2274
`reset'
2275 82 jeremybenn
     Reset the simulator.  Includes modeling a reset of the processor,
2276
     so execution will restart from the reset vector location, 0x100.
2277 19 jeremybenn
 
2278
`hist'
2279
     If saving the execution history has been configured (*note
2280
     Simulator Behavior: Simulator Behavior.), display the execution
2281
     history.
2282
 
2283
`stall'
2284
     Stall the processor, so that control is passed to the debug unit.
2285 82 jeremybenn
     When stalled, the processor can execute no instructions.  This
2286 19 jeremybenn
     command is useful when debugging the JTAG interface, used by
2287
     debuggers such as GDB.
2288
 
2289
`unstall'
2290 82 jeremybenn
     Unstall the processor, so that normal execution can continue.
2291
     This command is useful when debugging the JTAG interface, used by
2292 19 jeremybenn
     debuggers such as GDB.
2293
 
2294
`stats CATEGORY | clear'
2295
     Print the statistics for the given CATEGORY, if available, or
2296 82 jeremybenn
     clear if `clear' is specified.  The categories are:
2297 19 jeremybenn
 
2298
    1
2299
          Miscellaneous statistics: branch predictions (if branch
2300
          predictions are enabled), branch target cache model (if
2301
          enabled), cache (if enbaled), MMU (if enabled) and number of
2302
          addtional load & store cycles.
2303
 
2304
          *Note Configuring the OpenRisc Achitectural Components: Core
2305
          OpenRISC Configuration, for details of how to enable these
2306
          various features.
2307
 
2308
    2
2309 82 jeremybenn
          Instruction usage statistics.  Requires hazard analysis to be
2310 19 jeremybenn
          enabled (*note CPU Configuration: CPU Configuration.).
2311
 
2312
    3
2313 82 jeremybenn
          Instruction dependency statistics.  Requires hazard analysis
2314 19 jeremybenn
          to be enabled (*note CPU Configuration: CPU Configuration.).
2315
 
2316
    4
2317 82 jeremybenn
          Functional unit dependency statistics.  Requires hazard
2318 19 jeremybenn
          analysis to be enabled (*note CPU Configuration: CPU
2319
          Configuration.).
2320
 
2321
    5
2322 82 jeremybenn
          Raw register usage over time.  Requires hazard analysis to be
2323 19 jeremybenn
          enabled (*note CPU Configuration: CPU Configuration.).
2324
 
2325
    6
2326 82 jeremybenn
          Store buffer statistics.  Requires the store buffer to be
2327 19 jeremybenn
          enabled (*note CPU Configuration: CPU Configuration.).
2328
 
2329
 
2330
`info'
2331
     Display detailed information about the simulator configuration.
2332
     This is quite a lengthy about, because all MMU TLB information is
2333
     displayed.
2334
 
2335
`dv FROMADDR [ TOADDR ] [ MODULE ]'
2336
     Dump the area of memory between FROMADDR and TOADDR as Verilog
2337 82 jeremybenn
     code for a synchronous, 23-bit wide SRAM module, named MODULE.  If
2338 19 jeremybenn
     TOADDR is not specified, then 64 bytes are dumped (as 16 32-bit
2339 82 jeremybenn
     words).  If MODULE is not specified, `or1k_mem' is used.
2340 19 jeremybenn
 
2341
     To save to a file, use the redirection function (described after
2342
     this table, below).
2343
 
2344
`dh FROMADDR [ TOADDR ]'
2345
     Dump the area of memory between FROMADDR and TOADDR as 32-bit hex
2346 82 jeremybenn
     numbers (no `0x', or `32'h' prefix).  If TOADDR is not specified,
2347 19 jeremybenn
     then 64 bytes are dumped (as 16 32-bit words).
2348
 
2349
     To save to a file, use the redirection function (described after
2350
     this table, below).
2351
 
2352
`setdbch'
2353 82 jeremybenn
     Toggle debug channels on/off.  *Note Standalone Simulator:
2354 19 jeremybenn
     Standalone Simulator, for a description of specifying debug
2355
     channels on the command line.
2356
 
2357
`set SECTION PARAM = VALUE'
2358
     Set the configuration parameter PARA in section SECTION to VALUE.
2359
     *Note Configuration: Configuration, for details of configuration
2360
     parameters and their settings.
2361
 
2362
`debug'
2363 82 jeremybenn
     Toggle the simulator debug mode.  *Note Debug Interface
2364 19 jeremybenn
     Configuration: Debug Interface Configuration, for information on
2365
     this parameter.
2366
 
2367
          Caution: This is effectively enabling or disabling the debug
2368 82 jeremybenn
          unit.  It does not effect the remote GDB debug interface.
2369 19 jeremybenn
          However using the remote debug interface while the debug unit
2370
          is disabled will lead to undefined behavior and likely crash
2371
          Or1ksim
2372
 
2373
`cuc'
2374
     Enter the the Custom Unit Compiler command prompt (*note CUC
2375
     Configuration: CUC Configuration.).
2376
 
2377
          Caution: The CUC must be properly configured, for this to
2378 82 jeremybenn
          succeed.  In particular a timing file must be available and
2379
          readable.  Otherwise Or1ksim will crash.
2380 19 jeremybenn
 
2381
`help'
2382
     Print out brief information about each command available.
2383
 
2384
`mprofile [-vh] [-m M] [-g N] [-f FILE] FROM TO'
2385 82 jeremybenn
     Run the memory profiling utility.  This follows the same usage as
2386 19 jeremybenn
     the standalone command (*note Memory Profiling Utility: Memory
2387
     Profiling Utility.).
2388
 
2389
`profile [-vhcq] [-g FILE]'
2390 82 jeremybenn
     Run the instruction profiling utility.  This follows the same
2391
     usage as the standalone command (*note Profiling Utility:
2392
     Profiling Utility.).
2393 19 jeremybenn
 
2394
 
2395
For all commands, it is possible to redirect the output to a file, by
2396
using the redirection operator, `>'.
2397
 
2398
     COMMAND > FILENAME
2399
 
2400
This is particularly useful for commands dumping a large amount of
2401
output, such as `dv'.
2402
 
2403
     Caution: Unfortunately there is a serious bug with the redirection
2404 82 jeremybenn
     operator.  It does not return output to standard output after the
2405
     command completes.  Until this bug is fixed, file redirection
2406 19 jeremybenn
     should not be used.
2407
 
2408

2409
File: or1ksim.info,  Node: Verification API,  Next: Code Internals,  Prev: Interactive Command Line,  Up: Top
2410
 
2411
5 Verification API (VAPI)
2412
*************************
2413
 
2414
The Verification API (VAPI) provides a TCP/IP interface to allow
2415 82 jeremybenn
components of the simulation to be controlled externally.  The
2416
interface is polled for new requests on each simulated clock cycle.
2417
Components within the simulator may send responses to such requests.
2418 19 jeremybenn
 
2419 82 jeremybenn
The inteface is an asynchronous duplex protocol.  On the request side
2420
it provides for simple commands, known as VAPI IDs (a 32 bit integer),
2421
with a single piece of data (also a 32 bit integer).  On the send side,
2422
it provides for sending a single VAPI ID and data.  However there is no
2423
explicit command-response structure.  Some components just accept
2424
requests (e.g.  to set values), some just generate sends (to report
2425 19 jeremybenn
values), and some do both.
2426
 
2427
Each component has a base ID (32 bit) and its commands will start from
2428 82 jeremybenn
that base ID.  This provides a simple partitioning of the command space
2429
amongst components.  Request commands will be directed to the component
2430 19 jeremybenn
with the closest base ID lower than the VAPI ID of the command.
2431
 
2432
Thus if there are two components with base IDs of 0x200 and 0x300, and
2433
a request with VAPI ID of 0x203 is received, it will be directed to the
2434
first component as its command #3.
2435
 
2436
The results of VAPI interactions are logged (by default in `vapi.log'
2437
unless an alternative is specified in `section vapi').
2438
 
2439
Currently the following components support VAPI:
2440
 
2441
Debug Unit
2442
     Although the Debug Unit can specify a base VAPI ID, it is not used
2443
     to send commands or receive requests.
2444
 
2445
     Instead, if the base VAPI ID is set, all remote JTAG protocol
2446
     exchanges are logged in the VAPI log file.
2447
 
2448
UART
2449
     If a base VAPI ID is specified, the UART sends details of any
2450
     chars or break characters sent, with dteails of the line control
2451
     register etc encoded in the data packet sent.
2452
 
2453
     This supports a single VAPI command request, but encodes a
2454
     sub-command in the top 8 bits of the associated data.
2455
 
2456
    `0x00'
2457
          This stuffs the least significant 8 bits of the data into the
2458
          serial register of the UART and the next 8 bits into the line
2459
          control register, effectively providing control of the next
2460
          character to be sent or received.
2461
 
2462
    `0x01'
2463
          The divisor latch bytes are set from the least significant 16
2464
          bits of the data.
2465
 
2466
    `0x02'
2467
          The line control register is set from bits 15-8 of the data.
2468
 
2469
    `0x03'
2470
          The UART skew is set from the least significant 16 bits of
2471
          the data
2472
 
2473
    `0x04'
2474
          If the 16th most significant bit of the data is 1, start
2475 82 jeremybenn
          sending breaks, otherwise stop sending breaks.  The breaks
2476
          are sent or cleared after the number of UART clock divider
2477
          ticks specified by the data (immediately if the data is zero).
2478 19 jeremybenn
 
2479
 
2480
DMA
2481
     Although the DMA unit supports a base VAPI ID in its configuration
2482
     (`section dma'), no VAPI data is sent, nor VAPI requests currently
2483
     implemented.
2484
 
2485
Ethernet
2486 82 jeremybenn
     The following requests are handled by the Ethernet.  Specified
2487 19 jeremybenn
     symbolically, these are the increments from the base VAPI ID of the
2488 82 jeremybenn
     Ethernet.  At present no implementation is provided behind these
2489 19 jeremybenn
     VAPI requests.
2490
 
2491
    `ETH_VAPI_DATA (0)'
2492
 
2493
    `ETH_VAPI_CTRL (0)'
2494
 
2495
GPIO
2496
     If a base VAPI ID is specified, the GPIO sends out on its base
2497
     VAPI ID (symbolically, GPIO_VAPI_DATA (0) offset from the base
2498
     VAPI ID) any changes in outputs.
2499
 
2500 82 jeremybenn
     The following requests are handled by the GPIO.  Specified
2501 19 jeremybenn
     symbolically, these are the increments from the VAPI base ID of the
2502
     GPIO.
2503
 
2504
    `GPIO_VAPI_DATA (0)'
2505
          Set the next input to the commands data field
2506
 
2507
    `GPIO_VAPI_AUX (1)'
2508
          Set the GPIO auxiliary inputs to the data field
2509
 
2510
    `GPIO_VAPI_CLOCK (2)'
2511
          Add an external GPIO clock trigger of period specified in the
2512
          data field.
2513
 
2514
    `GPIO_VAPI_RGPIO_OE (3)'
2515
          Set the GPIO output enable to the data field
2516
 
2517
    `GPIO_VAPI_RGPIO_INTE (4)'
2518
          Set the next interrupt to the data field
2519
 
2520
    `GPIO_VAPI_RGPIO_PTRIG (5)'
2521
          Set the next trigger to the data field
2522
 
2523
    `GPIO_VAPI_RGPIO_AUX (6)'
2524
          Set the next auxiliary input to the data field
2525
 
2526
    `GPIO_VAPI_RGPIO_CTRL (7)'
2527
          Set th next control input to the data field
2528
 
2529
 
2530
 
2531

2532
File: or1ksim.info,  Node: Code Internals,  Next: GNU Free Documentation License,  Prev: Verification API,  Up: Top
2533
 
2534
6 A Guide to Or1ksim Internals
2535
******************************
2536
 
2537 82 jeremybenn
These are notes to help those wanting to extend Or1ksim.  This section
2538 19 jeremybenn
assumes the use of a tag file, so file locations of entities'
2539 82 jeremybenn
definitions are not in general provided.  For more on tags, see the
2540
Linux manual page for `etags'.  A tag file can be created with:
2541 19 jeremybenn
 
2542
     make tags
2543
 
2544
* Menu:
2545
 
2546
* Coding Conventions::
2547
* Global Data Structures::
2548
* Concepts::
2549
* Internal Debugging::
2550
 
2551

2552
File: or1ksim.info,  Node: Coding Conventions,  Next: Global Data Structures,  Up: Code Internals
2553
 
2554
6.1 Coding Conventions for Or1ksim
2555
==================================
2556
 
2557
This chapter provides some guidelines for coding, to facilitate
2558
extensions to Or1ksim
2559
 
2560
_GNU Coding Standard_
2561
     Code should follow the GNU coding standard for C
2562 82 jeremybenn
     (`http://www.gnu.org/prep/standards/'.  If in doubt, put your code
2563 19 jeremybenn
     through the `indent' program.
2564
 
2565
_`#include' headers_
2566
     All C source code files should include `config.h' before any other
2567
     file.
2568
 
2569
     This should be followed by inclusion of any system headers (but see
2570
     the comments about portability and `port.h' below) and then by any
2571
     Or1ksim package headers.
2572
 
2573
     If `port.h' is required, it should be the first package header to
2574
     be included after the system headers.
2575
 
2576
     All C source code and header files should directly include any
2577 82 jeremybenn
     system or package header they depend on, i.e.  not rely on any
2578
     other header having already included it.  The two exceptions are
2579 19 jeremybenn
 
2580
       1. All header files may assume that `config.h' has already been
2581
          included.
2582
 
2583
       2. System headers which impose portability problems should be
2584
          included by using the package header `port.h', rather than
2585 82 jeremybenn
          the system headers themselves.  This is the case for code
2586 19 jeremybenn
          requiring
2587
 
2588
             * `strndup' (from `string.h')
2589
 
2590
             * Integer types (`intN_t', `uintN_t') (from `inttypes.h').
2591
 
2592
             * `isblank' (from `ctype.h')
2593
 
2594
 
2595
 
2596
_`#include' files once only_
2597
     All include files should be protected by `#ifndef' to ensure their
2598 82 jeremybenn
     definitions are only included once.  For instance a header file
2599 19 jeremybenn
     `X-Y.H' should surround its contents with:
2600
 
2601
          #ifndef X_Y__H
2602
          #define X_Y__H
2603
 
2604
          
2605
 
2606
          #endif  /* X_Y__H */
2607
 
2608
_Avoid `typedef'_
2609
     The GNU coding style for C does not have a clear way to distinguish
2610 82 jeremybenn
     between user type name and user variables.  For this reason
2611 19 jeremybenn
     `typedef' should be avoided except for the most ubiquitous user
2612 82 jeremybenn
     defined types.  This makes the code much easier to read.
2613 19 jeremybenn
 
2614
     There are some `typedef' declarations in the `argtable2' library
2615
     and the ELF and COFF headers, because this code is taken from
2616
     other places.
2617
 
2618
     Within Or1ksim legacy uses of `typedef' have largely been purged,
2619
     except in the Custom Unit Compiler (*note Custom Unit Compiler
2620
     (CUC) Configuration: CUC Configuration.).
2621
 
2622
     The remaining uses of `typedef' occur in two places:
2623
 
2624
        * `port/port.h' defines types to replace those in header files
2625
          that are not available (character functions, string
2626
          duplication, integer types).
2627
 
2628
          `cpu/or1k/arch.h' defines types for the key Or1ksim entities:
2629
          addresses (`oraddr_t'), unsigned register values (`uorreg_t')
2630
          and signed register (`orreg_t') values.
2631
 
2632
 
2633
     Where new types are defined, they should appear in one of these two
2634 82 jeremybenn
     files as appropriate.  Or1ksim specific types appearing in
2635
     `arch.h' should always have the suffix `_h'.
2636 19 jeremybenn
 
2637
_Don't begin names with underscore_
2638
     Names beginning with `_' are intended to be part of the C
2639 82 jeremybenn
     infrastructure.  They should not be used in the simulator code.
2640 19 jeremybenn
 
2641
_Keep Non-global top level entities static_
2642
     All top level entities (functions, variables), which are not
2643
     explicitly part of a global interface should be declared static.
2644
     This ensures that unwanted connections are not inadvertently built
2645
     across the program.
2646
 
2647
_Use of `inline'_
2648 82 jeremybenn
     Code should not be declared `inline'.  Modern compilers can work
2649 19 jeremybenn
     out for themselves what is best in this respect.
2650
 
2651
_Initialization_
2652 82 jeremybenn
     All data structures should be explicitly initialized.  In
2653
     particular code should not rely on static data structures being
2654
     initialized to zero.
2655 19 jeremybenn
 
2656
     The rationale is that in future static data structures may become
2657 82 jeremybenn
     dynamic.  This has been a particular source of bugs in Or1ksim
2658 19 jeremybenn
     historically.
2659
 
2660
     A specific case is with new peripherals, which should always
2661
     include a `start' function to pre-initialize all configuration
2662
     parameters to sensible defaults
2663
 
2664
_Configuration Validation_
2665
     All configuration values should be validated, preferably when
2666
     encountered, if not when the `section' is closed, or otherwise at
2667
     run time when the parameter is first used.
2668
 
2669
 
2670

2671
File: or1ksim.info,  Node: Global Data Structures,  Next: Concepts,  Prev: Coding Conventions,  Up: Code Internals
2672
 
2673
6.2 Global Data Structures
2674
==========================
2675
 
2676
`config'
2677
     The global variable `config' of type `struct config' holds the
2678
     configuration data for some of the Or1ksim components which are
2679 82 jeremybenn
     always present.  At present the components are:
2680 19 jeremybenn
 
2681
        * The simulator defined in `section sim' (*note Simulator
2682
          Configuration: Simulator Configuration.).
2683
 
2684
        * The Verification API (VAPI) defined  in `section vapi' (*note
2685
          Verification API (VAPI) Configuration: Verification API
2686
          Configuration.).
2687
 
2688
        * The Custom Unit Compiler (CUC), defined in `section cuc'
2689
          (*note Custom Unit Compiler (CUC) Configuration: CUC
2690
          Configuration.).
2691
 
2692
        * The CPU, defined in `section cpu' (*note CPU Configuration:
2693
          CPU Configuration.).
2694
 
2695
        * The data cache (but not the instruction cache), defined in
2696
          `section dc' (*note Cache Configuration: Cache
2697
          Configuration.).
2698
 
2699
        * The power management unit, defined in `section pm' (*note
2700
          Power Management Configuration: Power Management
2701
          Configuration.).
2702
 
2703
        * The programmable interrupt controller, defined in
2704
          `section pic' (*note Interrupt Configuration: Interrupt
2705
          Configuration.).
2706
 
2707
        * Branch prediciton, defined in `section bpb' (*note Branch
2708
          Prediction Configuration: Branch Prediction Configuration.).
2709
 
2710
        * The debug unit, defined in `section debug' (*note Debug
2711
          Interface Configuration: Debug Interface Configuration.).
2712
 
2713
 
2714
     This struct is made of a collection of structs, one for each
2715 82 jeremybenn
     component.  For example the simulator configuration is held in
2716 19 jeremybenn
     `config.sim'.
2717
 
2718
`config'
2719
     This is a linked list of data structures holding configuration data
2720
     for all sections which are not held in the main `config' data
2721 82 jeremybenn
     structure.  In general these are components (such as peripherals
2722
     and memory) which may occur multiple times.  However it also
2723
     handles some architectural components which may occur only once,
2724
     such as the memory management units, the instruction cache, the
2725
     interrupt controller and branch prediction.
2726 19 jeremybenn
 
2727
`runtime'
2728
     The global variable `runtime' of type `struct runtime' holds all
2729 82 jeremybenn
     the runtime information about the simulation.  To access this
2730 19 jeremybenn
     variable, `sim-config.h' must be included.
2731
 
2732
     This struct is itself made of 3 other structs, `cpu' (for CPU run
2733
     time state), `vapi' (for Verification API state) and `cuc' (for
2734
     Custom Unit Compiler state).
2735
 
2736
 
2737

2738
File: or1ksim.info,  Node: Concepts,  Next: Internal Debugging,  Prev: Global Data Structures,  Up: Code Internals
2739
 
2740
6.3 Concepts
2741
============
2742
 
2743
_Output Redirection_
2744 82 jeremybenn
     The current output stream is held in `runtime.cpu.fout'.  Output
2745 19 jeremybenn
     should be explicitly written to this stream, or may use the
2746
     `PRINTF' macro, which will write its arguments to this output
2747
     stream.
2748
 
2749
_Reset Hooks_
2750
     Any peripheral may register a routine to be called when the the
2751
     processor is reset by calling `reg_sim_reset', providing a
2752 82 jeremybenn
     function and pointer to a data structure as arguments.  On reset
2753 19 jeremybenn
     that function will be called with the data stucture pointer as
2754
     argument.
2755
 
2756
 
2757

2758
File: or1ksim.info,  Node: Internal Debugging,  Prev: Concepts,  Up: Code Internals
2759
 
2760
6.4 Internal Debugging
2761
======================
2762
 
2763
The function `debug' is like `printf', but with an extra first
2764 82 jeremybenn
argument, which is the debug level.  If the debug level specified in
2765
the simulator configuration (*note Simulator Behavior: Simulator
2766
Behavior.) is greater than or equal to this value, the remaining
2767
arguments are printed to the current output stream (*note Output
2768
Redirection: Output Redirection.).
2769 19 jeremybenn
 
2770

2771
File: or1ksim.info,  Node: GNU Free Documentation License,  Next: Index,  Prev: Code Internals,  Up: Top
2772
 
2773
7 GNU Free Documentation License
2774
********************************
2775
 
2776
                      Version 1.2, November 2002
2777
 
2778
     Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
2779
     51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA
2780
 
2781
     Everyone is permitted to copy and distribute verbatim copies
2782
     of this license document, but changing it is not allowed.
2783
 
2784
  0. PREAMBLE
2785
 
2786
     The purpose of this License is to make a manual, textbook, or other
2787
     functional and useful document "free" in the sense of freedom: to
2788
     assure everyone the effective freedom to copy and redistribute it,
2789
     with or without modifying it, either commercially or
2790
     noncommercially.  Secondarily, this License preserves for the
2791
     author and publisher a way to get credit for their work, while not
2792
     being considered responsible for modifications made by others.
2793
 
2794
     This License is a kind of "copyleft", which means that derivative
2795
     works of the document must themselves be free in the same sense.
2796
     It complements the GNU General Public License, which is a copyleft
2797
     license designed for free software.
2798
 
2799
     We have designed this License in order to use it for manuals for
2800
     free software, because free software needs free documentation: a
2801
     free program should come with manuals providing the same freedoms
2802
     that the software does.  But this License is not limited to
2803
     software manuals; it can be used for any textual work, regardless
2804
     of subject matter or whether it is published as a printed book.
2805
     We recommend this License principally for works whose purpose is
2806
     instruction or reference.
2807
 
2808
  1. APPLICABILITY AND DEFINITIONS
2809
 
2810
     This License applies to any manual or other work, in any medium,
2811
     that contains a notice placed by the copyright holder saying it
2812
     can be distributed under the terms of this License.  Such a notice
2813
     grants a world-wide, royalty-free license, unlimited in duration,
2814
     to use that work under the conditions stated herein.  The
2815
     "Document", below, refers to any such manual or work.  Any member
2816
     of the public is a licensee, and is addressed as "you".  You
2817
     accept the license if you copy, modify or distribute the work in a
2818
     way requiring permission under copyright law.
2819
 
2820
     A "Modified Version" of the Document means any work containing the
2821
     Document or a portion of it, either copied verbatim, or with
2822
     modifications and/or translated into another language.
2823
 
2824
     A "Secondary Section" is a named appendix or a front-matter section
2825
     of the Document that deals exclusively with the relationship of the
2826
     publishers or authors of the Document to the Document's overall
2827
     subject (or to related matters) and contains nothing that could
2828
     fall directly within that overall subject.  (Thus, if the Document
2829
     is in part a textbook of mathematics, a Secondary Section may not
2830
     explain any mathematics.)  The relationship could be a matter of
2831
     historical connection with the subject or with related matters, or
2832
     of legal, commercial, philosophical, ethical or political position
2833
     regarding them.
2834
 
2835
     The "Invariant Sections" are certain Secondary Sections whose
2836
     titles are designated, as being those of Invariant Sections, in
2837
     the notice that says that the Document is released under this
2838
     License.  If a section does not fit the above definition of
2839
     Secondary then it is not allowed to be designated as Invariant.
2840
     The Document may contain zero Invariant Sections.  If the Document
2841
     does not identify any Invariant Sections then there are none.
2842
 
2843
     The "Cover Texts" are certain short passages of text that are
2844
     listed, as Front-Cover Texts or Back-Cover Texts, in the notice
2845
     that says that the Document is released under this License.  A
2846
     Front-Cover Text may be at most 5 words, and a Back-Cover Text may
2847
     be at most 25 words.
2848
 
2849
     A "Transparent" copy of the Document means a machine-readable copy,
2850
     represented in a format whose specification is available to the
2851
     general public, that is suitable for revising the document
2852
     straightforwardly with generic text editors or (for images
2853
     composed of pixels) generic paint programs or (for drawings) some
2854
     widely available drawing editor, and that is suitable for input to
2855
     text formatters or for automatic translation to a variety of
2856
     formats suitable for input to text formatters.  A copy made in an
2857
     otherwise Transparent file format whose markup, or absence of
2858
     markup, has been arranged to thwart or discourage subsequent
2859
     modification by readers is not Transparent.  An image format is
2860
     not Transparent if used for any substantial amount of text.  A
2861
     copy that is not "Transparent" is called "Opaque".
2862
 
2863
     Examples of suitable formats for Transparent copies include plain
2864
     ASCII without markup, Texinfo input format, LaTeX input format,
2865
     SGML or XML using a publicly available DTD, and
2866
     standard-conforming simple HTML, PostScript or PDF designed for
2867
     human modification.  Examples of transparent image formats include
2868
     PNG, XCF and JPG.  Opaque formats include proprietary formats that
2869
     can be read and edited only by proprietary word processors, SGML or
2870
     XML for which the DTD and/or processing tools are not generally
2871
     available, and the machine-generated HTML, PostScript or PDF
2872
     produced by some word processors for output purposes only.
2873
 
2874
     The "Title Page" means, for a printed book, the title page itself,
2875
     plus such following pages as are needed to hold, legibly, the
2876
     material this License requires to appear in the title page.  For
2877
     works in formats which do not have any title page as such, "Title
2878
     Page" means the text near the most prominent appearance of the
2879
     work's title, preceding the beginning of the body of the text.
2880
 
2881
     A section "Entitled XYZ" means a named subunit of the Document
2882
     whose title either is precisely XYZ or contains XYZ in parentheses
2883
     following text that translates XYZ in another language.  (Here XYZ
2884
     stands for a specific section name mentioned below, such as
2885
     "Acknowledgements", "Dedications", "Endorsements", or "History".)
2886
     To "Preserve the Title" of such a section when you modify the
2887
     Document means that it remains a section "Entitled XYZ" according
2888
     to this definition.
2889
 
2890
     The Document may include Warranty Disclaimers next to the notice
2891
     which states that this License applies to the Document.  These
2892
     Warranty Disclaimers are considered to be included by reference in
2893
     this License, but only as regards disclaiming warranties: any other
2894
     implication that these Warranty Disclaimers may have is void and
2895
     has no effect on the meaning of this License.
2896
 
2897
  2. VERBATIM COPYING
2898
 
2899
     You may copy and distribute the Document in any medium, either
2900
     commercially or noncommercially, provided that this License, the
2901
     copyright notices, and the license notice saying this License
2902
     applies to the Document are reproduced in all copies, and that you
2903
     add no other conditions whatsoever to those of this License.  You
2904
     may not use technical measures to obstruct or control the reading
2905
     or further copying of the copies you make or distribute.  However,
2906
     you may accept compensation in exchange for copies.  If you
2907
     distribute a large enough number of copies you must also follow
2908
     the conditions in section 3.
2909
 
2910
     You may also lend copies, under the same conditions stated above,
2911
     and you may publicly display copies.
2912
 
2913
  3. COPYING IN QUANTITY
2914
 
2915
     If you publish printed copies (or copies in media that commonly
2916
     have printed covers) of the Document, numbering more than 100, and
2917
     the Document's license notice requires Cover Texts, you must
2918
     enclose the copies in covers that carry, clearly and legibly, all
2919
     these Cover Texts: Front-Cover Texts on the front cover, and
2920
     Back-Cover Texts on the back cover.  Both covers must also clearly
2921
     and legibly identify you as the publisher of these copies.  The
2922
     front cover must present the full title with all words of the
2923
     title equally prominent and visible.  You may add other material
2924
     on the covers in addition.  Copying with changes limited to the
2925
     covers, as long as they preserve the title of the Document and
2926
     satisfy these conditions, can be treated as verbatim copying in
2927
     other respects.
2928
 
2929
     If the required texts for either cover are too voluminous to fit
2930
     legibly, you should put the first ones listed (as many as fit
2931
     reasonably) on the actual cover, and continue the rest onto
2932
     adjacent pages.
2933
 
2934
     If you publish or distribute Opaque copies of the Document
2935
     numbering more than 100, you must either include a
2936
     machine-readable Transparent copy along with each Opaque copy, or
2937
     state in or with each Opaque copy a computer-network location from
2938
     which the general network-using public has access to download
2939
     using public-standard network protocols a complete Transparent
2940
     copy of the Document, free of added material.  If you use the
2941
     latter option, you must take reasonably prudent steps, when you
2942
     begin distribution of Opaque copies in quantity, to ensure that
2943
     this Transparent copy will remain thus accessible at the stated
2944
     location until at least one year after the last time you
2945
     distribute an Opaque copy (directly or through your agents or
2946
     retailers) of that edition to the public.
2947
 
2948
     It is requested, but not required, that you contact the authors of
2949
     the Document well before redistributing any large number of
2950
     copies, to give them a chance to provide you with an updated
2951
     version of the Document.
2952
 
2953
  4. MODIFICATIONS
2954
 
2955
     You may copy and distribute a Modified Version of the Document
2956
     under the conditions of sections 2 and 3 above, provided that you
2957
     release the Modified Version under precisely this License, with
2958
     the Modified Version filling the role of the Document, thus
2959
     licensing distribution and modification of the Modified Version to
2960
     whoever possesses a copy of it.  In addition, you must do these
2961
     things in the Modified Version:
2962
 
2963
       A. Use in the Title Page (and on the covers, if any) a title
2964
          distinct from that of the Document, and from those of
2965
          previous versions (which should, if there were any, be listed
2966
          in the History section of the Document).  You may use the
2967
          same title as a previous version if the original publisher of
2968
          that version gives permission.
2969
 
2970
       B. List on the Title Page, as authors, one or more persons or
2971
          entities responsible for authorship of the modifications in
2972
          the Modified Version, together with at least five of the
2973
          principal authors of the Document (all of its principal
2974
          authors, if it has fewer than five), unless they release you
2975
          from this requirement.
2976
 
2977
       C. State on the Title page the name of the publisher of the
2978
          Modified Version, as the publisher.
2979
 
2980
       D. Preserve all the copyright notices of the Document.
2981
 
2982
       E. Add an appropriate copyright notice for your modifications
2983
          adjacent to the other copyright notices.
2984
 
2985
       F. Include, immediately after the copyright notices, a license
2986
          notice giving the public permission to use the Modified
2987
          Version under the terms of this License, in the form shown in
2988
          the Addendum below.
2989
 
2990
       G. Preserve in that license notice the full lists of Invariant
2991
          Sections and required Cover Texts given in the Document's
2992
          license notice.
2993
 
2994
       H. Include an unaltered copy of this License.
2995
 
2996
       I. Preserve the section Entitled "History", Preserve its Title,
2997
          and add to it an item stating at least the title, year, new
2998
          authors, and publisher of the Modified Version as given on
2999
          the Title Page.  If there is no section Entitled "History" in
3000
          the Document, create one stating the title, year, authors,
3001
          and publisher of the Document as given on its Title Page,
3002
          then add an item describing the Modified Version as stated in
3003
          the previous sentence.
3004
 
3005
       J. Preserve the network location, if any, given in the Document
3006
          for public access to a Transparent copy of the Document, and
3007
          likewise the network locations given in the Document for
3008
          previous versions it was based on.  These may be placed in
3009
          the "History" section.  You may omit a network location for a
3010
          work that was published at least four years before the
3011
          Document itself, or if the original publisher of the version
3012
          it refers to gives permission.
3013
 
3014
       K. For any section Entitled "Acknowledgements" or "Dedications",
3015
          Preserve the Title of the section, and preserve in the
3016
          section all the substance and tone of each of the contributor
3017
          acknowledgements and/or dedications given therein.
3018
 
3019
       L. Preserve all the Invariant Sections of the Document,
3020
          unaltered in their text and in their titles.  Section numbers
3021
          or the equivalent are not considered part of the section
3022
          titles.
3023
 
3024
       M. Delete any section Entitled "Endorsements".  Such a section
3025
          may not be included in the Modified Version.
3026
 
3027
       N. Do not retitle any existing section to be Entitled
3028
          "Endorsements" or to conflict in title with any Invariant
3029
          Section.
3030
 
3031
       O. Preserve any Warranty Disclaimers.
3032
 
3033
     If the Modified Version includes new front-matter sections or
3034
     appendices that qualify as Secondary Sections and contain no
3035
     material copied from the Document, you may at your option
3036
     designate some or all of these sections as invariant.  To do this,
3037
     add their titles to the list of Invariant Sections in the Modified
3038
     Version's license notice.  These titles must be distinct from any
3039
     other section titles.
3040
 
3041
     You may add a section Entitled "Endorsements", provided it contains
3042
     nothing but endorsements of your Modified Version by various
3043
     parties--for example, statements of peer review or that the text
3044
     has been approved by an organization as the authoritative
3045
     definition of a standard.
3046
 
3047
     You may add a passage of up to five words as a Front-Cover Text,
3048
     and a passage of up to 25 words as a Back-Cover Text, to the end
3049
     of the list of Cover Texts in the Modified Version.  Only one
3050
     passage of Front-Cover Text and one of Back-Cover Text may be
3051
     added by (or through arrangements made by) any one entity.  If the
3052
     Document already includes a cover text for the same cover,
3053
     previously added by you or by arrangement made by the same entity
3054
     you are acting on behalf of, you may not add another; but you may
3055
     replace the old one, on explicit permission from the previous
3056
     publisher that added the old one.
3057
 
3058
     The author(s) and publisher(s) of the Document do not by this
3059
     License give permission to use their names for publicity for or to
3060
     assert or imply endorsement of any Modified Version.
3061
 
3062
  5. COMBINING DOCUMENTS
3063
 
3064
     You may combine the Document with other documents released under
3065
     this License, under the terms defined in section 4 above for
3066
     modified versions, provided that you include in the combination
3067
     all of the Invariant Sections of all of the original documents,
3068
     unmodified, and list them all as Invariant Sections of your
3069
     combined work in its license notice, and that you preserve all
3070
     their Warranty Disclaimers.
3071
 
3072
     The combined work need only contain one copy of this License, and
3073
     multiple identical Invariant Sections may be replaced with a single
3074
     copy.  If there are multiple Invariant Sections with the same name
3075
     but different contents, make the title of each such section unique
3076
     by adding at the end of it, in parentheses, the name of the
3077
     original author or publisher of that section if known, or else a
3078
     unique number.  Make the same adjustment to the section titles in
3079
     the list of Invariant Sections in the license notice of the
3080
     combined work.
3081
 
3082
     In the combination, you must combine any sections Entitled
3083
     "History" in the various original documents, forming one section
3084
     Entitled "History"; likewise combine any sections Entitled
3085
     "Acknowledgements", and any sections Entitled "Dedications".  You
3086
     must delete all sections Entitled "Endorsements."
3087
 
3088
  6. COLLECTIONS OF DOCUMENTS
3089
 
3090
     You may make a collection consisting of the Document and other
3091
     documents released under this License, and replace the individual
3092
     copies of this License in the various documents with a single copy
3093
     that is included in the collection, provided that you follow the
3094
     rules of this License for verbatim copying of each of the
3095
     documents in all other respects.
3096
 
3097
     You may extract a single document from such a collection, and
3098
     distribute it individually under this License, provided you insert
3099
     a copy of this License into the extracted document, and follow
3100
     this License in all other respects regarding verbatim copying of
3101
     that document.
3102
 
3103
  7. AGGREGATION WITH INDEPENDENT WORKS
3104
 
3105
     A compilation of the Document or its derivatives with other
3106
     separate and independent documents or works, in or on a volume of
3107
     a storage or distribution medium, is called an "aggregate" if the
3108
     copyright resulting from the compilation is not used to limit the
3109
     legal rights of the compilation's users beyond what the individual
3110
     works permit.  When the Document is included in an aggregate, this
3111
     License does not apply to the other works in the aggregate which
3112
     are not themselves derivative works of the Document.
3113
 
3114
     If the Cover Text requirement of section 3 is applicable to these
3115
     copies of the Document, then if the Document is less than one half
3116
     of the entire aggregate, the Document's Cover Texts may be placed
3117
     on covers that bracket the Document within the aggregate, or the
3118
     electronic equivalent of covers if the Document is in electronic
3119
     form.  Otherwise they must appear on printed covers that bracket
3120
     the whole aggregate.
3121
 
3122
  8. TRANSLATION
3123
 
3124
     Translation is considered a kind of modification, so you may
3125
     distribute translations of the Document under the terms of section
3126
     4.  Replacing Invariant Sections with translations requires special
3127
     permission from their copyright holders, but you may include
3128
     translations of some or all Invariant Sections in addition to the
3129
     original versions of these Invariant Sections.  You may include a
3130
     translation of this License, and all the license notices in the
3131
     Document, and any Warranty Disclaimers, provided that you also
3132
     include the original English version of this License and the
3133
     original versions of those notices and disclaimers.  In case of a
3134
     disagreement between the translation and the original version of
3135
     this License or a notice or disclaimer, the original version will
3136
     prevail.
3137
 
3138
     If a section in the Document is Entitled "Acknowledgements",
3139
     "Dedications", or "History", the requirement (section 4) to
3140
     Preserve its Title (section 1) will typically require changing the
3141
     actual title.
3142
 
3143
  9. TERMINATION
3144
 
3145
     You may not copy, modify, sublicense, or distribute the Document
3146
     except as expressly provided for under this License.  Any other
3147
     attempt to copy, modify, sublicense or distribute the Document is
3148
     void, and will automatically terminate your rights under this
3149
     License.  However, parties who have received copies, or rights,
3150
     from you under this License will not have their licenses
3151
     terminated so long as such parties remain in full compliance.
3152
 
3153
 10. FUTURE REVISIONS OF THIS LICENSE
3154
 
3155
     The Free Software Foundation may publish new, revised versions of
3156
     the GNU Free Documentation License from time to time.  Such new
3157
     versions will be similar in spirit to the present version, but may
3158
     differ in detail to address new problems or concerns.  See
3159
     `http://www.gnu.org/copyleft/'.
3160
 
3161
     Each version of the License is given a distinguishing version
3162
     number.  If the Document specifies that a particular numbered
3163
     version of this License "or any later version" applies to it, you
3164
     have the option of following the terms and conditions either of
3165
     that specified version or of any later version that has been
3166
     published (not as a draft) by the Free Software Foundation.  If
3167
     the Document does not specify a version number of this License,
3168
     you may choose any version ever published (not as a draft) by the
3169
     Free Software Foundation.
3170
 
3171
ADDENDUM: How to use this License for your documents
3172
====================================================
3173
 
3174
To use this License in a document you have written, include a copy of
3175
the License in the document and put the following copyright and license
3176
notices just after the title page:
3177
 
3178
       Copyright (C)  YEAR  YOUR NAME.
3179
       Permission is granted to copy, distribute and/or modify this document
3180
       under the terms of the GNU Free Documentation License, Version 1.2
3181
       or any later version published by the Free Software Foundation;
3182
       with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
3183
       Texts.  A copy of the license is included in the section entitled ``GNU
3184
       Free Documentation License''.
3185
 
3186
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
3187
replace the "with...Texts." line with this:
3188
 
3189
         with the Invariant Sections being LIST THEIR TITLES, with
3190
         the Front-Cover Texts being LIST, and with the Back-Cover Texts
3191
         being LIST.
3192
 
3193
If you have Invariant Sections without Cover Texts, or some other
3194
combination of the three, merge those two alternatives to suit the
3195
situation.
3196
 
3197
If your document contains nontrivial examples of program code, we
3198
recommend releasing these examples in parallel under your choice of
3199
free software license, such as the GNU General Public License, to
3200
permit their use in free software.
3201
 
3202

3203
File: or1ksim.info,  Node: Index,  Prev: GNU Free Documentation License,  Up: Top
3204
 
3205
Index
3206
*****
3207
 
3208
 
3209
* Menu:
3210
3211
* --cumulative:                          Profiling Utility.   (line  26)
3212
* --debug-config:                        Standalone Simulator.
3213
                                                              (line  48)
3214 82 jeremybenn
* --disable-all-tests:                   Configuring the Build.
3215
                                                              (line 128)
3216 19 jeremybenn
* --disable-arith-flag:                  Configuring the Build.
3217
                                                              (line  93)
3218
* --disable-debug:                       Configuring the Build.
3219
                                                              (line 121)
3220
* --disable-ethphy:                      Configuring the Build.
3221
                                                              (line  54)
3222
* --disable-ov-flag:                     Configuring the Build.
3223
                                                              (line  70)
3224
* --disable-profiling:                   Configuring the Build.
3225
                                                              (line  25)
3226
* --disable-range-stats:                 Configuring the Build.
3227
                                                              (line  64)
3228 82 jeremybenn
* --enable-all-tests:                    Configuring the Build.
3229
                                                              (line 127)
3230 19 jeremybenn
* --enable-arith-flag:                   Configuring the Build.
3231
                                                              (line  92)
3232
* --enable-debug:                        Configuring the Build.
3233
                                                              (line 120)
3234
* --enable-ethphy:                       Configuring the Build.
3235
                                                              (line  53)
3236
* --enable-execution:                    Configuring the Build.
3237
                                                              (line  32)
3238
* --enable-mprofile:                     Standalone Simulator.
3239
                                                              (line  77)
3240
* --enable-ov-flag:                      Configuring the Build.
3241
                                                              (line  69)
3242
* --enable-profile:                      Standalone Simulator.
3243
                                                              (line  74)
3244
* --enable-profiling:                    Configuring the Build.
3245
                                                              (line  24)
3246
* --enable-range-stats:                  Configuring the Build.
3247
                                                              (line  63)
3248
* --file:                                Standalone Simulator.
3249
                                                              (line  24)
3250
* --filename:                            Memory Profiling Utility.
3251
                                                              (line  51)
3252
* --generate:                            Profiling Utility.   (line  34)
3253
* --group:                               Memory Profiling Utility.
3254
                                                              (line  47)
3255
* --help:                                Standalone Simulator.
3256
                                                              (line  20)
3257
* --help (memory profiling utility):     Memory Profiling Utility.
3258
                                                              (line  22)
3259
* --help (profiling utility):            Profiling Utility.   (line  22)
3260
* --interactive:                         Standalone Simulator.
3261
                                                              (line  54)
3262
* --mode:                                Memory Profiling Utility.
3263
                                                              (line  26)
3264
* --nosrv:                               Standalone Simulator.
3265
                                                              (line  32)
3266
* --quiet:                               Profiling Utility.   (line  30)
3267
* --srv:                                 Standalone Simulator.
3268
                                                              (line  40)
3269
* --strict-npc:                          Standalone Simulator.
3270
                                                              (line  57)
3271
* --version:                             Standalone Simulator.
3272
                                                              (line  16)
3273
* --version (memory profiling utility):  Memory Profiling Utility.
3274
                                                              (line  17)
3275
* --version (profiling utility):         Profiling Utility.   (line  17)
3276
* -c:                                    Profiling Utility.   (line  26)
3277
* -d:                                    Standalone Simulator.
3278
                                                              (line  48)
3279
* -f <1>:                                Memory Profiling Utility.
3280
                                                              (line  51)
3281
* -f:                                    Standalone Simulator.
3282
                                                              (line  24)
3283
* -g <1>:                                Memory Profiling Utility.
3284
                                                              (line  47)
3285
* -g:                                    Profiling Utility.   (line  34)
3286
* -h:                                    Standalone Simulator.
3287
                                                              (line  20)
3288
* -h (memory profiling utility):         Memory Profiling Utility.
3289
                                                              (line  22)
3290
* -h (profiling utility):                Profiling Utility.   (line  22)
3291
* -i:                                    Standalone Simulator.
3292
                                                              (line  54)
3293
* -m:                                    Memory Profiling Utility.
3294
                                                              (line  26)
3295
* -q:                                    Profiling Utility.   (line  30)
3296
* -v:                                    Standalone Simulator.
3297
                                                              (line  16)
3298
* -v (memory profiling utility):         Memory Profiling Utility.
3299
                                                              (line  17)
3300
* -v (profiling utility):                Profiling Utility.   (line  17)
3301
* 0x00 UART VAPI sub-command (UART verification): Verification API.
3302
                                                              (line  49)
3303
* 0x01 UART VAPI sub-command (UART verification): Verification API.
3304
                                                              (line  55)
3305
* 0x02 UART VAPI sub-command (UART verification): Verification API.
3306
                                                              (line  59)
3307
* 0x03 UART VAPI sub-command (UART verification): Verification API.
3308
                                                              (line  62)
3309
* 0x04 UART VAPI sub-command (UART verification): Verification API.
3310
                                                              (line  66)
3311
* 16550 (UART configuration):            UART Configuration.  (line  73)
3312 82 jeremybenn
* all tests enabled:                     Configuring the Build.
3313
                                                              (line 128)
3314 19 jeremybenn
* Argtable2 debugging:                   Configuring the Build.
3315
                                                              (line 121)
3316
* ATA/ATAPI configuration:               Disc Interface Configuration.
3317
                                                              (line   6)
3318
* ATA/ATAPI device configuration:        Disc Interface Configuration.
3319
                                                              (line  88)
3320
* base_vapi_id (GPIO configuration - deprecated): GPIO Configuration.
3321
                                                              (line  32)
3322
* baseaddr (ATA/ATAPI configuration):    Disc Interface Configuration.
3323
                                                              (line  22)
3324
* baseaddr (DMA configuration):          DMA Configuration.   (line  24)
3325
* baseaddr (Ethernet configuration):     Ethernet Configuration.
3326
                                                              (line  22)
3327
* baseaddr (frame buffer configuration): Frame Buffer Configuration.
3328
                                                              (line  20)
3329
* baseaddr (generic peripheral configuration): Generic Peripheral Configuration.
3330
                                                              (line  22)
3331
* baseaddr (GPIO configuration):         GPIO Configuration.  (line  21)
3332
* baseaddr (keyboard configuration):     Keyboard Configuration.
3333
                                                              (line  36)
3334
* baseaddr (memory configuration):       Memory Configuration.
3335
                                                              (line  62)
3336
* baseaddr (memory controller configuration): Memory Controller Configuration.
3337 82 jeremybenn
                                                              (line  29)
3338 19 jeremybenn
* baseaddr (UART configuration):         UART Configuration.  (line  22)
3339
* baseaddr (VGA configuration):          Display Interface Configuration.
3340
                                                              (line  26)
3341
* blocksize (cache configuration):       Cache Configuration. (line  29)
3342
* BPB configuration:                     Branch Prediction Configuration.
3343
                                                              (line   6)
3344
* branch prediction configuration:       Branch Prediction Configuration.
3345
                                                              (line   6)
3346
* break (Interactive CLI):               Interactive Command Line.
3347
                                                              (line  57)
3348
* breakpoint list (Interactive CLI):     Interactive Command Line.
3349
                                                              (line  60)
3350
* breakpoint set/clear (Interactive CLI): Interactive Command Line.
3351
                                                              (line  57)
3352
* breaks (Interactive CLI):              Interactive Command Line.
3353
                                                              (line  60)
3354
* btic (branch prediction configuration): Branch Prediction Configuration.
3355
                                                              (line  19)
3356
* byte_enabled (generic peripheral configuration): Generic Peripheral Configuration.
3357
                                                              (line  48)
3358
* cache configuration:                   Cache Configuration. (line   6)
3359
* calling_convention (CUC configuration): CUC Configuration.  (line  34)
3360
* ce (memory configuration):             Memory Configuration.
3361 82 jeremybenn
                                                              (line  92)
3362 19 jeremybenn
* cfgr (CPU configuration):              CPU Configuration.   (line  47)
3363
* channel (UART configuration):          UART Configuration.  (line  29)
3364
* clear breakpoint (Interactive CLI):    Interactive Command Line.
3365
                                                              (line  57)
3366 82 jeremybenn
* clkcycle (simulator configuration):    Simulator Behavior.  (line 103)
3367 19 jeremybenn
* cm (Interactive CLI):                  Interactive Command Line.
3368
                                                              (line  54)
3369
* command line for Or1ksim standalone use: Standalone Simulator.
3370
                                                              (line   6)
3371
* complex model:                         Configuring the Build.
3372
                                                              (line  32)
3373
* config:                                Global Data Structures.
3374
                                                              (line   7)
3375
* config.bpb:                            Global Data Structures.
3376
                                                              (line  37)
3377
* config.cpu:                            Global Data Structures.
3378
                                                              (line  22)
3379
* config.cuc:                            Global Data Structures.
3380
                                                              (line  18)
3381
* config.dc:                             Global Data Structures.
3382
                                                              (line  25)
3383
* config.debug:                          Global Data Structures.
3384
                                                              (line  40)
3385
* config.pic:                            Global Data Structures.
3386
                                                              (line  33)
3387
* config.pm:                             Global Data Structures.
3388
                                                              (line  29)
3389
* config.sim:                            Global Data Structures.
3390
                                                              (line  11)
3391
* config.vapi:                           Global Data Structures.
3392
                                                              (line  14)
3393
* configuration dynamic structure:       Global Data Structures.
3394
                                                              (line  49)
3395
* configuration file structure:          Configuration File Format.
3396
                                                              (line   6)
3397
* configuration global structure:        Global Data Structures.
3398
                                                              (line   7)
3399
* configuration info (Interactive CLI):  Interactive Command Line.
3400
                                                              (line 119)
3401
* configuration of generic peripherals:  Generic Peripheral Configuration.
3402
                                                              (line   6)
3403
* configuration parameter setting (Interactive CLI): Interactive Command Line.
3404
                                                              (line 146)
3405
* configuring branch prediction:         Branch Prediction Configuration.
3406
                                                              (line   6)
3407
* configuring data & instruction caches: Cache Configuration. (line   6)
3408
* configuring data & instruction MMUs:   Memory Management Configuration.
3409
                                                              (line   6)
3410
* configuring DMA:                       DMA Configuration.   (line   6)
3411
* configuring memory:                    Memory Configuration.
3412
                                                              (line   6)
3413
* configuring Or1ksim:                   Configuration.       (line   6)
3414
* configuring power management:          Power Management Configuration.
3415
                                                              (line   6)
3416
* configuring the ATA/ATAPI interfaces:  Disc Interface Configuration.
3417
                                                              (line   6)
3418
* configuring the behavior of Or1ksim:   Simulator Behavior.  (line   6)
3419
* configuring the CPU:                   CPU Configuration.   (line   6)
3420
* configuring the Custom Unit Compiler (CUC): CUC Configuration.
3421
                                                              (line   6)
3422
* configuring the debug unit and interface to external debuggers: Debug Interface Configuration.
3423
                                                              (line   6)
3424
* configuring the Ethernet interface:    Ethernet Configuration.
3425
                                                              (line   6)
3426
* configuring the frame buffer:          Frame Buffer Configuration.
3427
                                                              (line   6)
3428
* configuring the GPIO:                  GPIO Configuration.  (line   6)
3429
* configuring the interrupt controller:  Interrupt Configuration.
3430
                                                              (line   6)
3431
* configuring the keyboard interface:    Keyboard Configuration.
3432
                                                              (line   6)
3433
* configuring the memory controller:     Memory Controller Configuration.
3434
                                                              (line   6)
3435
* configuring the processor:             CPU Configuration.   (line   6)
3436
* configuring the PS2 interface:         Keyboard Configuration.
3437
                                                              (line   6)
3438
* configuring the UART:                  UART Configuration.  (line   6)
3439
* configuring the Verification API (VAPI): Verification API Configuration.
3440
                                                              (line   6)
3441
* configuring the VGA interface:         Display Interface Configuration.
3442
                                                              (line   6)
3443
* copying memory (Interactive CLI):      Interactive Command Line.
3444
                                                              (line  54)
3445
* CPU configuration:                     CPU Configuration.   (line   6)
3446
* CUC configuration:                     CUC Configuration.   (line   6)
3447
* Custom Unit Compiler (Interactive CLI): Interactive Command Line.
3448
                                                              (line 162)
3449
* Custom Unit Compiler Configuration:    CUC Configuration.   (line   6)
3450
* data cache configuration:              Cache Configuration. (line   6)
3451
* data MMU configuration:                Memory Management Configuration.
3452
                                                              (line   6)
3453
* DCGE (power management register):      Power Management Configuration.
3454
                                                              (line  21)
3455
* debug (Interactive CLI):               Interactive Command Line.
3456
                                                              (line 151)
3457
* debug (simulator configuration):       Simulator Behavior.  (line  13)
3458
* debug channel toggle (Interactive CLI): Interactive Command Line.
3459
                                                              (line 141)
3460
* debug interface configuration:         Debug Interface Configuration.
3461
                                                              (line   6)
3462
* debug mode toggle (Interactive CLI):   Interactive Command Line.
3463
                                                              (line 151)
3464
* debug unit configuration:              Debug Interface Configuration.
3465
                                                              (line   6)
3466
* Debug Unit verification (VAPI):        Verification API.    (line  34)
3467
* debugging enabled (Argtable2):         Configuring the Build.
3468
                                                              (line 121)
3469
* delayr (memory configuration):         Memory Configuration.
3470 82 jeremybenn
                                                              (line 110)
3471 19 jeremybenn
* delayw (memory configuration):         Memory Configuration.
3472 82 jeremybenn
                                                              (line 116)
3473 19 jeremybenn
* dependstats (CPU configuration):       CPU Configuration.   (line  84)
3474
* dev_id (ATA/ATAPI configuration):      Disc Interface Configuration.
3475
                                                              (line  36)
3476
* disassemble (Interactive CLI):         Interactive Command Line.
3477
                                                              (line  41)
3478
* disc interface configuration:          Disc Interface Configuration.
3479
                                                              (line   6)
3480
* disc interface device configuration:   Disc Interface Configuration.
3481
                                                              (line  88)
3482
* display interface configuration:       Display Interface Configuration.
3483
                                                              (line   6)
3484
* displaying memory (Interactive CLI):   Interactive Command Line.
3485
                                                              (line  31)
3486
* displaying registers (Interactive CLI): Interactive Command Line.
3487
                                                              (line  14)
3488
* dm (Interactive CLI):                  Interactive Command Line.
3489
                                                              (line  31)
3490
* dma (Ethernet configuration):          Ethernet Configuration.
3491
                                                              (line  33)
3492
* DMA configuration:                     DMA Configuration.   (line   6)
3493
* DMA verification (VAPI):               Verification API.    (line  73)
3494
* dma_mode0_td (ATA/ATAPI configuration): Disc Interface Configuration.
3495
                                                              (line  70)
3496
* dma_mode0_teoc (ATA/ATAPI configuration): Disc Interface Configuration.
3497
                                                              (line  71)
3498
* dma_mode0_tm (ATA/ATAPI configuration): Disc Interface Configuration.
3499
                                                              (line  69)
3500
* DME (power management register):       Power Management Configuration.
3501
                                                              (line  15)
3502
* DMMU configuration:                    Memory Management Configuration.
3503
                                                              (line   6)
3504
* doze mode (power management register): Power Management Configuration.
3505
                                                              (line  15)
3506
* dv (Interactive CLI):                  Interactive Command Line.
3507
                                                              (line 124)
3508
* dynamic clock gating (power management register): Power Management Configuration.
3509
                                                              (line  21)
3510
* dynamic model:                         Configuring the Build.
3511
                                                              (line  32)
3512
* dynamic ports, use of:                 Verification API Configuration.
3513
                                                              (line  23)
3514
* edge_trigger (interrupt controller):   Interrupt Configuration.
3515
                                                              (line  16)
3516
* enable_bursts (CUC configuration):     CUC Configuration.   (line  38)
3517
* enabled (ATA/ATAPI configuration):     Disc Interface Configuration.
3518
                                                              (line  18)
3519
* enabled (branch prediction configuration): Branch Prediction Configuration.
3520
                                                              (line  15)
3521
* enabled (cache configuration):         Cache Configuration. (line  11)
3522
* enabled (debug interface configuration): Debug Interface Configuration.
3523
                                                              (line  11)
3524
* enabled (DMA configuration):           DMA Configuration.   (line  20)
3525
* enabled (Ethernet configuration):      Ethernet Configuration.
3526
                                                              (line  18)
3527
* enabled (frame buffer configuration):  Frame Buffer Configuration.
3528
                                                              (line  16)
3529
* enabled (generic peripheral configuration): Generic Peripheral Configuration.
3530
                                                              (line  18)
3531
* enabled (GPIO configuration):          GPIO Configuration.  (line  17)
3532
* enabled (interrupt controller):        Interrupt Configuration.
3533
                                                              (line  12)
3534
* enabled (keyboard configuration):      Keyboard Configuration.
3535
                                                              (line  32)
3536
* enabled (memory controller configuration): Memory Controller Configuration.
3537 82 jeremybenn
                                                              (line  18)
3538 19 jeremybenn
* enabled (MMU configuration):           Memory Management Configuration.
3539
                                                              (line  12)
3540
* enabled (power management configuration): Power Management Configuration.
3541
                                                              (line  35)
3542
* enabled (UART configuration):          UART Configuration.  (line  18)
3543
* enabled (verification API configuration): Verification API Configuration.
3544
                                                              (line  15)
3545
* enabled (VGA configuration):           Display Interface Configuration.
3546
                                                              (line  22)
3547
* enabling Ethernet via socket:          Configuring the Build.
3548
                                                              (line  54)
3549
* entrysize (MMU configuration):         Memory Management Configuration.
3550
                                                              (line  32)
3551
* ETH_VAPI_CTRL (Ethernet verification): Verification API.    (line  86)
3552
* ETH_VAPI_DATA (Ethernet verification): Verification API.    (line  84)
3553
* Ethernet configuration:                Ethernet Configuration.
3554
                                                              (line   6)
3555
* Ethernet verification (VAPI):          Verification API.    (line  78)
3556
* Ethernet via socket, enabling:         Configuring the Build.
3557
                                                              (line  54)
3558 82 jeremybenn
* exe_log (simulator configuration):     Simulator Behavior.  (line  49)
3559
* exe_log_end (simulator configuration): Simulator Behavior.  (line  89)
3560
* exe_log_file (simulator configuration): Simulator Behavior. (line  97)
3561 19 jeremybenn
* exe_log_fn (simulator configuration - deprecated): Simulator Behavior.
3562 82 jeremybenn
                                                              (line  97)
3563 19 jeremybenn
* exe_log_marker (simulator configuration): Simulator Behavior.
3564 82 jeremybenn
                                                              (line  93)
3565 19 jeremybenn
* exe_log_start (simulator configuration): Simulator Behavior.
3566 82 jeremybenn
                                                              (line  86)
3567
* exe_log_type (simulator configuration): Simulator Behavior. (line  55)
3568 19 jeremybenn
* exe_log_type=default (simulator configuration): Simulator Behavior.
3569 82 jeremybenn
                                                              (line  58)
3570 19 jeremybenn
* exe_log_type=hardware (simulator configuration): Simulator Behavior.
3571 82 jeremybenn
                                                              (line  62)
3572 19 jeremybenn
* exe_log_type=simple (simulator configuration): Simulator Behavior.
3573 82 jeremybenn
                                                              (line  69)
3574 19 jeremybenn
* exe_log_type=software (simulator configuration): Simulator Behavior.
3575 82 jeremybenn
                                                              (line  74)
3576 19 jeremybenn
* executing code (Interactive CLI):      Interactive Command Line.
3577
                                                              (line  23)
3578
* execution history (Interactive CLI):   Interactive Command Line.
3579
                                                              (line  67)
3580
* file (ATA/ATAPI device configuration): Disc Interface Configuration.
3581
                                                              (line 104)
3582
* file (keyboard configuration):         Keyboard Configuration.
3583
                                                              (line  51)
3584
* filename (frame buffer configuration - deprecated): Frame Buffer Configuration.
3585 82 jeremybenn
                                                              (line  36)
3586 19 jeremybenn
* filename (VGA configuration - deprecated): Display Interface Configuration.
3587
                                                              (line  47)
3588
* firmware (ATA/ATAPI device configuration): Disc Interface Configuration.
3589
                                                              (line 117)
3590
* flag setting by instructions:          Configuring the Build.
3591
                                                              (line  93)
3592
* frame buffer configuration:            Frame Buffer Configuration.
3593
                                                              (line   6)
3594
* gdb_enabled (debug interface configuration): Debug Interface Configuration.
3595
                                                              (line  47)
3596
* generic peripheral configuration:      Generic Peripheral Configuration.
3597
                                                              (line   6)
3598
* GPIO configuration:                    GPIO Configuration.  (line   6)
3599
* GPIO verification (VAPI):              Verification API.    (line  88)
3600
* GPIO_VAPI_AUX (GPIO verification):     Verification API.    (line 100)
3601
* GPIO_VAPI_CLOCK (GPIO verification):   Verification API.    (line 103)
3602
* GPIO_VAPI_CTRL (GPIO verification):    Verification API.    (line 119)
3603
* GPIO_VAPI_DATA (GPIO verification):    Verification API.    (line  97)
3604
* GPIO_VAPI_INTE (GPIO verification):    Verification API.    (line 110)
3605
* GPIO_VAPI_PTRIG (GPIO verification):   Verification API.    (line 113)
3606
* GPIO_VAPI_RGPIO (GPIO verification):   Verification API.    (line 107)
3607
* hazards (CPU configuration):           CPU Configuration.   (line  69)
3608
* heads (ATA/ATAPI device configuration): Disc Interface Configuration.
3609
                                                              (line 121)
3610
* help (Interactive CLI):                Interactive Command Line.
3611
                                                              (line 170)
3612
* hexadecimal memory dump (Interactive CLI): Interactive Command Line.
3613
                                                              (line 133)
3614
* hide_device_id (verification API configuration): Verification API Configuration.
3615
                                                              (line  36)
3616
* hist (Interactive CLI):                Interactive Command Line.
3617
                                                              (line  67)
3618 82 jeremybenn
* history (simulator configuration):     Simulator Behavior.  (line  40)
3619 19 jeremybenn
* history of execution (Interactive CLI): Interactive Command Line.
3620
                                                              (line  67)
3621
* hitdelay (branch prediction configuration): Branch Prediction Configuration.
3622
                                                              (line  33)
3623
* hitdelay (instruction cache configuration): Cache Configuration.
3624
                                                              (line  38)
3625
* hitdelay (MMU configuration):          Memory Management Configuration.
3626
                                                              (line  51)
3627
* hw_enabled (generic peripheral configuration): Generic Peripheral Configuration.
3628
                                                              (line  49)
3629
* IMMU configuration:                    Memory Management Configuration.
3630
                                                              (line   6)
3631
* index (memory controller configuration): Memory Controller Configuration.
3632 82 jeremybenn
                                                              (line  51)
3633 19 jeremybenn
* info (Interactive CLI):                Interactive Command Line.
3634
                                                              (line 119)
3635
* installing Or1ksim:                    Installation.        (line   6)
3636
* instruction cache configuration:       Cache Configuration. (line   6)
3637
* instruction MMU configuration:         Memory Management Configuration.
3638
                                                              (line   6)
3639
* instruction profiling for Or1ksim:     Profiling Utility.   (line   6)
3640
* instruction profiling utility (Interactive CLI): Interactive Command Line.
3641
                                                              (line 178)
3642
* internal debugging:                    Internal Debugging.  (line   6)
3643
* interrupt controller configuration:    Interrupt Configuration.
3644
                                                              (line   6)
3645
* irq (ATA/ATAPI configuration):         Disc Interface Configuration.
3646
                                                              (line  32)
3647
* irq (DMA configuration):               DMA Configuration.   (line  34)
3648
* irq (GPIO configuration):              GPIO Configuration.  (line  29)
3649
* irq (keyboard configuration):          Keyboard Configuration.
3650
                                                              (line  47)
3651
* irq (UART configuration):              UART Configuration.  (line  70)
3652
* irq (VGA configuration):               Display Interface Configuration.
3653
                                                              (line  37)
3654
* jitter (UART configuration):           UART Configuration.  (line  78)
3655
* keyboard configuration:                Keyboard Configuration.
3656
                                                              (line   6)
3657
* library version of Or1ksim:            Simulator Library.   (line   6)
3658
* license for Or1ksim:                   GNU Free Documentation License.
3659
                                                              (line   6)
3660
* list breakpoints (Interactive CLI):    Interactive Command Line.
3661
                                                              (line  60)
3662
* load_hitdelay (data cache configuration): Cache Configuration.
3663
                                                              (line  46)
3664
* load_missdelay (data cache configuration): Cache Configuration.
3665
                                                              (line  50)
3666
* log (memory configuration):            Memory Configuration.
3667 82 jeremybenn
                                                              (line 122)
3668 19 jeremybenn
* log_enabled (verification API configuration): Verification API Configuration.
3669
                                                              (line  28)
3670 82 jeremybenn
* long:                                  Simulator Library.   (line  74)
3671 19 jeremybenn
* mc (memory configuration):             Memory Configuration.
3672 82 jeremybenn
                                                              (line 100)
3673 19 jeremybenn
* memory configuration:                  Memory Configuration.
3674
                                                              (line   6)
3675
* memory controller configuration:       Memory Controller Configuration.
3676
                                                              (line   6)
3677
* memory copying (Interactive CLI):      Interactive Command Line.
3678
                                                              (line  54)
3679
* memory display (Interactive CLI):      Interactive Command Line.
3680
                                                              (line  31)
3681
* memory dump, hexadecimal (Interactive CLI): Interactive Command Line.
3682
                                                              (line 133)
3683
* memory dump, Verilog (Interactive CLI): Interactive Command Line.
3684
                                                              (line 124)
3685
* memory patching (Interactive CLI):     Interactive Command Line.
3686
                                                              (line  48)
3687
* memory profiling end address:          Memory Profiling Utility.
3688
                                                              (line  56)
3689
* memory profiling start address:        Memory Profiling Utility.
3690
                                                              (line  56)
3691
* memory profiling utility (Interactive CLI): Interactive Command Line.
3692
                                                              (line 173)
3693
* memory profiling version of Or1ksim:   Memory Profiling Utility.
3694
                                                              (line   6)
3695
* memory_order (CUC configuration):      CUC Configuration.   (line  15)
3696
* memory_order=exact (CUC configuration): CUC Configuration.  (line  27)
3697
* memory_order=none (CUC configuration): CUC Configuration.   (line  18)
3698
* memory_order=strong (CUC configuration): CUC Configuration. (line  25)
3699
* memory_order=weak (CUC configuration): CUC Configuration.   (line  21)
3700
* missdelay (branch prediction configuration): Branch Prediction Configuration.
3701
                                                              (line  37)
3702
* missdelay (instruction cache configuration): Cache Configuration.
3703
                                                              (line  42)
3704
* missdelay (MMU configuration):         Memory Management Configuration.
3705
                                                              (line  55)
3706
* MMU configuration:                     Memory Management Configuration.
3707
                                                              (line   6)
3708 82 jeremybenn
* mprof_file (simulator configuration):  Simulator Behavior.  (line  34)
3709 19 jeremybenn
* mprof_fn (simulator configuration - deprecated): Simulator Behavior.
3710 82 jeremybenn
                                                              (line  34)
3711 19 jeremybenn
* mprofile (Interactive CLI):            Interactive Command Line.
3712
                                                              (line 173)
3713 82 jeremybenn
* mprofile (simulator configuration):    Simulator Behavior.  (line  29)
3714 19 jeremybenn
* mwdma (ATA/ATAPI device configuration): Disc Interface Configuration.
3715
                                                              (line 128)
3716
* name (generic peripheral configuration): Generic Peripheral Configuration.
3717
                                                              (line  42)
3718
* name (memory configuration):           Memory Configuration.
3719 82 jeremybenn
                                                              (line  83)
3720 19 jeremybenn
* no_multicycle (CUC configuration):     CUC Configuration.   (line  42)
3721
* nsets (cache configuration):           Cache Configuration. (line  15)
3722
* nsets (MMU configuration):             Memory Management Configuration.
3723
                                                              (line  16)
3724
* nways (cache configuration):           Cache Configuration. (line  22)
3725
* nways (MMU configuration):             Memory Management Configuration.
3726
                                                              (line  22)
3727 82 jeremybenn
* or1ksim_get_time_period:               Simulator Library.   (line  64)
3728 19 jeremybenn
* or1ksim_init:                          Simulator Library.   (line  18)
3729 82 jeremybenn
* or1ksim_interrupt:                     Simulator Library.   (line  79)
3730
* or1ksim_interrupt_clear:               Simulator Library.   (line  97)
3731
* or1ksim_interrupt_set:                 Simulator Library.   (line  88)
3732
* or1ksim_is_le:                         Simulator Library.   (line  69)
3733
* or1ksim_reset_duration:                Simulator Library.   (line  49)
3734
* or1ksim_run:                           Simulator Library.   (line  44)
3735
* or1ksim_set_time_point:                Simulator Library.   (line  60)
3736 19 jeremybenn
* output rediretion:                     Concepts.            (line   7)
3737
* overflow flag setting by instructions: Configuring the Build.
3738
                                                              (line  70)
3739
* packet (ATA/ATAPI device configuration): Disc Interface Configuration.
3740
                                                              (line 113)
3741
* pagesize (MMU configuration):          Memory Management Configuration.
3742
                                                              (line  27)
3743
* patching memory (Interactive CLI):     Interactive Command Line.
3744
                                                              (line  48)
3745
* patching registers (Interactive CLI):  Interactive Command Line.
3746
                                                              (line  28)
3747
* patching the program counter (Interactive CLI): Interactive Command Line.
3748
                                                              (line  51)
3749
* pattern (memory configuration):        Memory Configuration.
3750
                                                              (line  50)
3751
* pc (Interactive CLI):                  Interactive Command Line.
3752
                                                              (line  51)
3753
* PIC configuration:                     Interrupt Configuration.
3754
                                                              (line   6)
3755
* pio (ATA/ATAPI device configuration):  Disc Interface Configuration.
3756
                                                              (line 132)
3757
* pio_mode0_t1 (ATA/ATAPI configuration): Disc Interface Configuration.
3758
                                                              (line  51)
3759
* pio_mode0_t2 (ATA/ATAPI configuration): Disc Interface Configuration.
3760
                                                              (line  52)
3761
* pio_mode0_t4 (ATA/ATAPI configuration): Disc Interface Configuration.
3762
                                                              (line  53)
3763
* pio_mode0_teoc (ATA/ATAPI configuration): Disc Interface Configuration.
3764
                                                              (line  54)
3765
* pm (Interactive CLI):                  Interactive Command Line.
3766
                                                              (line  48)
3767
* PMR - DGCE:                            Power Management Configuration.
3768
                                                              (line  21)
3769
* PMR - DME:                             Power Management Configuration.
3770
                                                              (line  15)
3771
* PMR - SDF:                             Power Management Configuration.
3772
                                                              (line  12)
3773
* PMR - SME:                             Power Management Configuration.
3774
                                                              (line  16)
3775
* PMR - SUME:                            Power Management Configuration.
3776
                                                              (line  24)
3777
* PMU configuration:                     Power Management Configuration.
3778
                                                              (line   6)
3779
* poc (memory controller configuration): Memory Controller Configuration.
3780 82 jeremybenn
                                                              (line  38)
3781 19 jeremybenn
* port range for TCP/IP:                 Verification API Configuration.
3782
                                                              (line  23)
3783
* power management configuration:        Power Management Configuration.
3784
                                                              (line   6)
3785
* power management register, DGCE:       Power Management Configuration.
3786
                                                              (line  21)
3787
* power management register, DME:        Power Management Configuration.
3788
                                                              (line  15)
3789
* power management register, SDF:        Power Management Configuration.
3790
                                                              (line  12)
3791
* power management register, SME:        Power Management Configuration.
3792
                                                              (line  16)
3793
* power management register, SUME:       Power Management Configuration.
3794
                                                              (line  24)
3795
* pr (Interactive CLI):                  Interactive Command Line.
3796
                                                              (line  28)
3797
* private ports, use of:                 Verification API Configuration.
3798
                                                              (line  23)
3799
* processor configuration:               CPU Configuration.   (line   6)
3800
* processor stall (Interactive CLI):     Interactive Command Line.
3801
                                                              (line  72)
3802
* processor unstall (Interactive CLI):   Interactive Command Line.
3803
                                                              (line  78)
3804
* prof_file (simulator configuration):   Simulator Behavior.  (line  23)
3805
* prof_fn (simulator configuration - deprecated): Simulator Behavior.
3806
                                                              (line  23)
3807
* profile (simulator configuration):     Simulator Behavior.  (line  19)
3808
* profiling for Or1ksim:                 Profiling Utility.   (line   6)
3809
* profiling utility (Interactive CLI):   Interactive Command Line.
3810
                                                              (line 178)
3811
* program counter patching (Interactive CLI): Interactive Command Line.
3812
                                                              (line  51)
3813
* programmable interrupt controller configuration: Interrupt Configuration.
3814
                                                              (line   6)
3815
* PS2 configuration:                     Keyboard Configuration.
3816
                                                              (line   6)
3817
* q (Interactive CLI):                   Interactive Command Line.
3818
                                                              (line  11)
3819
* quitting (Interactive CLI):            Interactive Command Line.
3820
                                                              (line  11)
3821
* r (Interactive CLI):                   Interactive Command Line.
3822
                                                              (line  14)
3823
* random_seed (memory configuration):    Memory Configuration.
3824
                                                              (line  40)
3825
* refresh_rate (frame buffer configuration): Frame Buffer Configuration.
3826 82 jeremybenn
                                                              (line  30)
3827 19 jeremybenn
* refresh_rate (VGA configuration):      Display Interface Configuration.
3828
                                                              (line  41)
3829
* reg_sim_reset:                         Concepts.            (line  13)
3830
* register display (Interactive CLI):    Interactive Command Line.
3831
                                                              (line  14)
3832
* register over time statistics:         Configuring the Build.
3833
                                                              (line  64)
3834
* register patching (Interactive CLI):   Interactive Command Line.
3835
                                                              (line  28)
3836
* Remote Serial Protocol:                Debug Interface Configuration.
3837
                                                              (line  20)
3838
* reset (Interactive CLI):               Interactive Command Line.
3839
                                                              (line  63)
3840
* reset hooks:                           Concepts.            (line  13)
3841
* reset the simulator (Interactive CLI): Interactive Command Line.
3842
                                                              (line  63)
3843
* rev (ATA/ATAPI configuration):         Disc Interface Configuration.
3844
                                                              (line  44)
3845
* rev (CPU configuration):               CPU Configuration.   (line  15)
3846
* rsp_enabled (debug interface configuration): Debug Interface Configuration.
3847
                                                              (line  20)
3848
* rsp_port (debug interface configuration): Debug Interface Configuration.
3849
                                                              (line  36)
3850
* rtx_type (Ethernet configuration):     Ethernet Configuration.
3851
                                                              (line  46)
3852
* run (Interactive CLI):                 Interactive Command Line.
3853
                                                              (line  23)
3854
* running code (Interactive CLI):        Interactive Command Line.
3855
                                                              (line  23)
3856
* running Or1ksim:                       Usage.               (line   6)
3857
* runtime:                               Global Data Structures.
3858
                                                              (line  58)
3859
* runtime global structure:              Global Data Structures.
3860
                                                              (line  58)
3861
* runtime.cpu:                           Global Data Structures.
3862
                                                              (line  62)
3863
* runtime.cpu.fout:                      Concepts.            (line   7)
3864
* runtime.cuc:                           Global Data Structures.
3865
                                                              (line  62)
3866
* runtime.vapi:                          Global Data Structures.
3867
                                                              (line  62)
3868
* rx_channel (Ethernet configuration):   Ethernet Configuration.
3869
                                                              (line  59)
3870
* rxfile (Ethernet configuration):       Ethernet Configuration.
3871
                                                              (line  68)
3872
* sbp_bf_fwd (branch prediction configuration): Branch Prediction Configuration.
3873
                                                              (line  23)
3874
* sbp_bnf_fwd (branch prediction configuration): Branch Prediction Configuration.
3875
                                                              (line  28)
3876
* sbuf_len (CPU configuration):          CPU Configuration.   (line  96)
3877
* SDF (power management register):       Power Management Configuration.
3878
                                                              (line  12)
3879
* section ata:                           Disc Interface Configuration.
3880
                                                              (line   6)
3881
* section bpb:                           Branch Prediction Configuration.
3882
                                                              (line   6)
3883
* section cpio:                          GPIO Configuration.  (line   6)
3884
* section cpu:                           CPU Configuration.   (line   6)
3885
* section cuc:                           CUC Configuration.   (line   6)
3886
* section dc:                            Cache Configuration. (line   6)
3887
* section debug:                         Debug Interface Configuration.
3888
                                                              (line   6)
3889
* section dma:                           DMA Configuration.   (line   6)
3890
* section dmmu:                          Memory Management Configuration.
3891
                                                              (line   6)
3892
* section ethernet:                      Ethernet Configuration.
3893
                                                              (line   6)
3894
* section fb:                            Frame Buffer Configuration.
3895
                                                              (line   6)
3896
* section generic:                       Generic Peripheral Configuration.
3897
                                                              (line   6)
3898
* section ic:                            Cache Configuration. (line   6)
3899
* section immu:                          Memory Management Configuration.
3900
                                                              (line   6)
3901
* section kb:                            Keyboard Configuration.
3902
                                                              (line   6)
3903
* section mc:                            Memory Controller Configuration.
3904
                                                              (line   6)
3905
* section memory:                        Memory Configuration.
3906
                                                              (line   6)
3907
* section pic:                           Interrupt Configuration.
3908
                                                              (line   6)
3909
* section pmu:                           Power Management Configuration.
3910
                                                              (line   6)
3911
* section sim:                           Simulator Behavior.  (line   6)
3912
* section uart:                          UART Configuration.  (line   6)
3913
* section vapi:                          Verification API Configuration.
3914
                                                              (line   6)
3915
* section vga:                           Display Interface Configuration.
3916
                                                              (line   6)
3917
* sections:                              Global Data Structures.
3918
                                                              (line  49)
3919
* sectors (ATA/ATAPI device configuration): Disc Interface Configuration.
3920
                                                              (line 125)
3921
* server_port (debug interface configuration): Debug Interface Configuration.
3922
                                                              (line  69)
3923
* server_port (verification API configuration): Verification API Configuration.
3924
                                                              (line  19)
3925
* set (Interactive CLI):                 Interactive Command Line.
3926
                                                              (line 146)
3927
* set breakpoint (Interactive CLI):      Interactive Command Line.
3928
                                                              (line  57)
3929
* setdbch (Interactive CLI):             Interactive Command Line.
3930
                                                              (line 141)
3931
* simple model:                          Configuring the Build.
3932
                                                              (line  32)
3933
* simulator configuration:               Simulator Behavior.  (line   6)
3934
* simulator configuration info (Interactive CLI): Interactive Command Line.
3935
                                                              (line 119)
3936
* simulator reset (Interactive CLI):     Interactive Command Line.
3937
                                                              (line  63)
3938
* simulator statistics (Interactive CLI): Interactive Command Line.
3939
                                                              (line  83)
3940
* size (ATA/ATAPI device configuration): Disc Interface Configuration.
3941
                                                              (line 109)
3942
* size (generic peripheral configuration): Generic Peripheral Configuration.
3943
                                                              (line  30)
3944
* size (memory configuration):           Memory Configuration.
3945
                                                              (line  67)
3946
* sleep mode (power management register): Power Management Configuration.
3947
                                                              (line  16)
3948
* slow down factor (power management register): Power Management Configuration.
3949
                                                              (line  12)
3950
* SME (power management register):       Power Management Configuration.
3951
                                                              (line  16)
3952
* sockif (Ethernet configuration):       Ethernet Configuration.
3953
                                                              (line  83)
3954
* sr (CPU configuration):                CPU Configuration.   (line  53)
3955
* stall (Interactive CLI):               Interactive Command Line.
3956
                                                              (line  72)
3957
* stall the processor (Interactive CLI): Interactive Command Line.
3958
                                                              (line  72)
3959
* statistics, register over time:        Configuring the Build.
3960
                                                              (line  64)
3961
* statistics, simulation (Interactive CLI): Interactive Command Line.
3962
                                                              (line  83)
3963
* stats (Interactive CLI):               Interactive Command Line.
3964
                                                              (line  83)
3965
* stepping code (Interactive CLI):       Interactive Command Line.
3966
                                                              (line  19)
3967
* store_hitdelay (data cache configuration): Cache Configuration.
3968
                                                              (line  54)
3969
* store_missdelay (data cache configuration): Cache Configuration.
3970
                                                              (line  58)
3971
* SUME (power management register):      Power Management Configuration.
3972
                                                              (line  24)
3973
* superscalar (CPU configuration):       CPU Configuration.   (line  58)
3974
* suspend mode (power management register): Power Management Configuration.
3975
                                                              (line  24)
3976
* t (Interactive CLI):                   Interactive Command Line.
3977
                                                              (line  19)
3978
* TCP/IP port range:                     Verification API Configuration.
3979
                                                              (line  23)
3980
* TCP/IP port range for or1ksim service: Debug Interface Configuration.
3981
                                                              (line  74)
3982
* TCP/IP port range for or1ksim-rsp service: Debug Interface Configuration.
3983
                                                              (line  41)
3984 82 jeremybenn
* tests, all enabled.:                   Configuring the Build.
3985
                                                              (line 128)
3986 19 jeremybenn
* timings_file (CUC configuration):      CUC Configuration.   (line  46)
3987
* timings_fn (CUC configuration - deprecated): CUC Configuration.
3988
                                                              (line  46)
3989
* toggle breakpoint (Interactive CLI):   Interactive Command Line.
3990
                                                              (line  57)
3991
* toggle debug channels (Interactive CLI): Interactive Command Line.
3992
                                                              (line 141)
3993
* toggle debug mode (Interactive CLI):   Interactive Command Line.
3994
                                                              (line 151)
3995
* tx_channel (Ethernet configuration):   Ethernet Configuration.
3996
                                                              (line  60)
3997
* txfile (Ethernet configuration):       Ethernet Configuration.
3998
                                                              (line  69)
3999
* txfile (frame buffer configuration):   Frame Buffer Configuration.
4000 82 jeremybenn
                                                              (line  36)
4001 19 jeremybenn
* txfile (VGA configuration):            Display Interface Configuration.
4002
                                                              (line  47)
4003
* type (ATA/ATAPI device configuration): Disc Interface Configuration.
4004
                                                              (line  99)
4005
* type (memory configuration):           Memory Configuration.
4006
                                                              (line  11)
4007
* type=pattern (memory configuration):   Memory Configuration.
4008
                                                              (line  21)
4009
* type=random (memory configuration):    Memory Configuration.
4010
                                                              (line  15)
4011
* type=unknown (memory configuration):   Memory Configuration.
4012
                                                              (line  25)
4013
* type=zero (memory configuration):      Memory Configuration.
4014
                                                              (line  29)
4015
* UART configuration:                    UART Configuration.  (line   6)
4016
* UART I/O from/to a physical serial port: UART Configuration.
4017
                                                              (line  62)
4018
* UART I/O from/to an xterm:             UART Configuration.  (line  38)
4019
* UART I/O from/to files:                UART Configuration.  (line  33)
4020
* UART I/O from/to open file descriptors: UART Configuration. (line  58)
4021
* UART I/O from/to TCP/IP:               UART Configuration.  (line  45)
4022
* UART verification (VAPI):              Verification API.    (line  41)
4023
* unstall (Interactive CLI):             Interactive Command Line.
4024
                                                              (line  78)
4025
* unstall the processor (Interactive CLI): Interactive Command Line.
4026
                                                              (line  78)
4027
* upr (CPU configuration):               CPU Configuration.   (line  21)
4028
* ustates (cache configuration):         Cache Configuration. (line  33)
4029
* ustates (MMU configuration):           Memory Management Configuration.
4030
                                                              (line  41)
4031
* VAPI configuration:                    Verification API Configuration.
4032
                                                              (line   6)
4033
* VAPI for Debug Unit:                   Verification API.    (line  34)
4034
* VAPI for DMA:                          Verification API.    (line  73)
4035
* VAPI for Ethernet:                     Verification API.    (line  78)
4036
* VAPI for GPIO:                         Verification API.    (line  88)
4037
* VAPI for UART:                         Verification API.    (line  41)
4038
* vapi_id (debug interface configuration): Debug Interface Configuration.
4039
                                                              (line  80)
4040
* vapi_id (DMA configuration) <1>:       Ethernet Configuration.
4041
                                                              (line  88)
4042
* vapi_id (DMA configuration):           DMA Configuration.   (line  38)
4043
* vapi_id (GPIO configuration):          GPIO Configuration.  (line  32)
4044
* vapi_id (UART configuration):          UART Configuration.  (line  85)
4045
* vapi_log_file (verification API configuration): Verification API Configuration.
4046
                                                              (line  41)
4047
* vapi_log_fn (verification API configuration - deprecated): Verification API Configuration.
4048
                                                              (line  41)
4049
* ver (CPU configuration):               CPU Configuration.   (line  15)
4050
* verbose (simulator configuration):     Simulator Behavior.  (line  10)
4051
* Verification API configuration:        Verification API Configuration.
4052
                                                              (line   6)
4053
* Verilog memory dump (Interactive CLI): Interactive Command Line.
4054
                                                              (line 124)
4055
* VGA configuration:                     Display Interface Configuration.
4056
 
4057
 
4058
                                                              (line  50)
4059
4060
4061

4062
Tag Table:
4063
Node: Top814
4064
Node: Installation1224
4065
Node: Preparation1471
4066 90 jeremybenn
Node: Configuring the Build1766
4067
Node: Build and Install7245
4068
Node: Known Issues8091
4069
Node: Usage10232
4070
Node: Standalone Simulator10446
4071
Node: Profiling Utility13349
4072
Node: Memory Profiling Utility14259
4073
Node: Simulator Library15624
4074
Node: Configuration21109
4075
Node: Configuration File Format21718
4076
Node: Configuration File Preprocessing22010
4077
Node: Configuration File Syntax22381
4078
Node: Simulator Configuration25166
4079
Node: Simulator Behavior25457
4080
Node: Verification API Configuration29501
4081
Node: CUC Configuration31441
4082
Node: Core OpenRISC Configuration33358
4083
Node: CPU Configuration33860
4084
Node: Memory Configuration37665
4085
Node: Memory Management Configuration42978
4086
Node: Cache Configuration45355
4087
Node: Interrupt Configuration47741
4088
Node: Power Management Configuration48477
4089
Node: Branch Prediction Configuration49754
4090
Node: Debug Interface Configuration51114
4091
Node: Peripheral Configuration55334
4092
Node: Memory Controller Configuration55960
4093
Node: UART Configuration58565
4094
Node: DMA Configuration62084
4095
Node: Ethernet Configuration63951
4096
Node: GPIO Configuration67929
4097
Node: Display Interface Configuration69562
4098
Node: Frame Buffer Configuration71871
4099
Node: Keyboard Configuration73735
4100
Node: Disc Interface Configuration75973
4101
Node: Generic Peripheral Configuration80916
4102
Node: Interactive Command Line83211
4103
Node: Verification API90185
4104
Node: Code Internals94615
4105
Node: Coding Conventions95175
4106
Node: Global Data Structures99602
4107
Node: Concepts102259
4108
Ref: Output Redirection102404
4109
Node: Internal Debugging102943
4110
Node: GNU Free Documentation License103440

powered by: WebSVN 2.1.0

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