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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 450 jeremybenn
This is ../../doc/or1ksim.info, produced by makeinfo version 4.13 from
2
../../doc/or1ksim.texi.
3 19 jeremybenn
 
4
INFO-DIR-SECTION Embedded development
5
START-INFO-DIR-ENTRY
6 442 julius
* Or1ksim: (or32-elf-or1ksim).  The OpenRISC 1000 Architectural
7 19 jeremybenn
                                        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 510 jeremybenn
     tar jxf or1ksim-0.5.1rc1.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 510 jeremybenn
     ../or1ksim-0.5.1rc1/configure --target=or32-elf ...
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 385 jeremybenn
For testing (using `make check'), the `--target' parameter may be
92
specified, to allow the target tool chain to be selected.  If not
93
specified, it will default to `or32-elf', which is the same prefix used
94
with the standard OpenRISC toolchain installation script.
95 19 jeremybenn
 
96 104 jeremybenn
A number of Or1ksim specific features in the simulator do require
97
enabling at configuration.  These include
98
 
99 19 jeremybenn
`--enable-profiling'
100
`--disable-profiling'
101 82 jeremybenn
     If enabled, Or1ksim is compiled for profiling with `gprof'.  This
102
     is disabled by default.  Only really of value for developers of
103 19 jeremybenn
     Or1ksim.
104
 
105
`--enable-execution=simple'
106
`--enable-execution=complex'
107
`--enable-execution=dynamic'
108
     Or1ksim has developed to improve functionality and performance.
109
     This feature allows three versions of Or1ksim to be built
110
 
111
    `--enable-execution=simple'
112
          Build the original simple interpreting simulator
113
 
114
    `--enable-execution=complex'
115 82 jeremybenn
          Build a more complex interpreting simulator.  Experiments
116
          suggest this is 50% faster than the simple simulator.  This
117
          is the default.
118 19 jeremybenn
 
119
    `--enable-execution=dynamic'
120 82 jeremybenn
          Build a dynamically compiling simulator.  This is the way
121
          many modern ISS are built.  This represents a work in
122
          progress.  Currently Or1ksim will compile, but segfaults if
123
          configured with this option.
124 19 jeremybenn
 
125
 
126
     The default is `--enable-execution=complex'.
127
 
128
`--enable-ethphy'
129
`--disable-ethphy'
130
     If enabled, this option allows the Ethernet to be simulated by
131
     connecting via a socket (the alternative reads and writes, from
132 82 jeremybenn
     and to files).  This must then be configured using the relevant
133
     fields in the `ethernet' section of the configuration file.  *Note
134 19 jeremybenn
     Ethernet Configuration: Ethernet Configuration.
135
 
136
     The default is for this to be disabled.
137
 
138 127 jeremybenn
`--enable-unsigned-xori'
139
`--disable-unsigned-xori'
140 346 jeremybenn
     Historically, `l.xori', has sign extended its operand.  This is
141 127 jeremybenn
     inconsistent with the other logical opcodes (`l.andi', `l.ori'),
142
     but in the absence of `l.not', it allows a register to be inverted
143
     in a single instruction using:
144
 
145
          `l.xori  rD,rA,-1'
146
 
147
     This flag causes Or1ksim to treat the immediate operand as
148
     unsigned (i.e to zero-extend rather than sign-extend).
149
 
150
     The default is to sign-extend, so that existing code will continue
151
     to work.
152
 
153
          Caution: The GNU compiler tool chain makes heavy use of this
154
          instruction.  Using unsigned behavior will require the
155
          compiler to be modified accordingly.
156
 
157
          This option is provided for experimentation.  A future
158
          version of OpenRISC may adopt this more consistent behavior
159
          and also provide a `l.not' opcode.
160
 
161 19 jeremybenn
`--enable-range-stats'
162
`--disable-range-stats'
163
     If enabled, this option allows statistics to be collected to
164 82 jeremybenn
     analyse register access over time.  The default is for this to be
165 19 jeremybenn
     disabled.
166
 
167
`--enable-debug'
168
`--disable-debug'
169
     This is a feature of the Argtable2 package used to process
170 82 jeremybenn
     arguments.  If enabled, some debugging features are turned on in
171
     Argtable2.  It is provided for completeness, but there is no
172
     reason why this feature should ever be needed by any Or1ksim user.
173 19 jeremybenn
 
174 82 jeremybenn
`--enable-all-tests'
175
`--disable-all-tests'
176
     Some of the tests (at the time of writing just one) will not
177
     compile without error.  If enabled with this flag, all test
178
     programs will be compiled with `make check'.
179 19 jeremybenn
 
180 82 jeremybenn
     This flag is intended for those working on the test package, who
181
     wish to get the missing test(s) working.
182
 
183
 
184 112 jeremybenn
A number of configuration flags have been removed since version 0.3.0,
185 346 jeremybenn
because they led to invalid behavior of Or1ksim.  Those removed are:
186 112 jeremybenn
 
187 124 jeremybenn
`--enable-arith-flag'
188
`--disable-arith-flag'
189
     If enabled, this option caused certain instructions to set the flag
190
     (`F' bit) in the supervision register if the result were zero.
191
     The instructions affected by this were `l.add', `l.addc',
192
     `l.addi', `l.and' and `l.andi'.
193
 
194 346 jeremybenn
     If set, this caused incorrect behavior.  Whether or not flags are
195 124 jeremybenn
     set is part of the OpenRISC 1000 architectural specification.  The
196
     only flags which should set this are the "set flag" instructions:
197
     `l.sfeq', `l.sfeqi', `l.sfges', `l.sfgesi', `l.sfgeu', `l.sfgeui',
198
     `l.sfgts', `l.sfgtsi', `l.sfgtu', `l.sfgtui', `l.sfles',
199
     `l.sflesi', `l.sfleu', `l.sfleui', `l.sflts', `l.sfltsi',
200
     `l.sfltu', `l.sfltui', `l.sfne' and `l.sfnei'.
201
 
202 112 jeremybenn
`--enable-ov-flag'
203
`--disable-ov-flag'
204 124 jeremybenn
     This flag caused certain instructions to set the overflow flag.
205
     If not, those instructions would not set the overflow flat.  The
206
     instructions affected by this were `l.add', `l.addc', `l.addi',
207
     `l.and', `l.andi', `l.div', `l.divu', `l.mul', `l.muli', `l.or',
208
     `l.ori', `l.sll', `l.slli', `l.srl', `l.srli', `l.sra', `l.srai',
209
     `l.sub', `l.xor' and `l.xori'.
210 112 jeremybenn
 
211
     This guaranteed incorrect behavior.  The OpenRISC 1000 architecture
212
     specification defines which flags are set by which instructions.
213
 
214
     Within the above list, the arithmetic instructions (`l.add',
215
     `l.addc', `l.addi', `l.div', `l.divu', `l.mul', `l.muli' and
216
     `l.sub'), together with `l.addic' which is missed out, set the
217
     overflow flag.  All the others (`l.and', `l.andi', `l.or',
218
     `l.ori', `l.sll', `l.slli', `l.srl', `l.srli', `l.sra', `l.srai',
219
     `l.xor' and `l.xori') do not.
220
 
221
 
222 19 jeremybenn

223
File: or1ksim.info,  Node: Build and Install,  Next: Known Issues,  Prev: Configuring the Build,  Up: Installation
224
 
225
1.3 Building and Installing
226
===========================
227
 
228 82 jeremybenn
Build the tool with:
229 19 jeremybenn
 
230
     make all
231 82 jeremybenn
 
232
If you have the OpenRISC tool chain and DejaGNU installed, you can
233
verify the tool as follows (otherwise omit this step):
234
 
235
     make check
236
 
237
Install the tool with:
238
 
239 19 jeremybenn
     make install
240
 
241
This will install the three variations of the Or1ksim tool,
242 442 julius
`or32-elf-sim', `or32-elf-psim' and `or32-elf-mpsim', the Or1ksim
243
library, `libsim', the header file, `or1ksim.h' and this documentation
244
in `info' format.
245 19 jeremybenn
 
246
The documentation may be created and installed in alternative formats
247
(PDF, Postscript, DVI, HTML) with for example:
248
 
249
     make pdf
250
     make install-pdf
251
 
252

253
File: or1ksim.info,  Node: Known Issues,  Prev: Build and Install,  Up: Installation
254
 
255
1.4 Known Problems and Issues
256
=============================
257
 
258 346 jeremybenn
Full details of outstanding issues may be found in the `NEWS' file in
259
the main directory of the distribution.  The OpenRISC tracker may be
260
used to see the current state of these issues and to raise new problems
261
and feature requests.  It may be found at bugtracker.
262 19 jeremybenn
 
263 346 jeremybenn
The following issues are long standing and unlikely to be fixed in
264
Or1ksim in the near future.
265
 
266 19 jeremybenn
   * The Supervision Register Little Endian Enable (LEE) bit is
267 82 jeremybenn
     ignored.  Or1ksim can be built for either little endian or big
268 19 jeremybenn
     endian use, but that behavior cannot be changed dynamically.
269
 
270
   * Or1ksim is not reentrant, so a program cannot instantiate multiple
271 82 jeremybenn
     instances using the library.  This is clearly a problem when
272
     considering multi-core applications.  However it stems from the
273
     original design, and can only be fixed by a complete rewrite.  The
274 19 jeremybenn
     entire source code uses static global constants liberally!
275
 
276
 
277

278
File: or1ksim.info,  Node: Usage,  Next: Configuration,  Prev: Installation,  Up: Top
279
 
280
2 Usage
281
*******
282
 
283
* Menu:
284
 
285
* Standalone Simulator::
286
* Profiling Utility::
287
* Memory Profiling Utility::
288 442 julius
* Trace Generation::
289 19 jeremybenn
* Simulator Library::
290 440 jeremybenn
* Ethernet TUN/TAP Interface::
291 460 jeremybenn
* l.nop Support::
292 19 jeremybenn
 
293

294
File: or1ksim.info,  Node: Standalone Simulator,  Next: Profiling Utility,  Up: Usage
295
 
296
2.1 Standalone Simulator
297
========================
298
 
299
The general form the standalone command is:
300
 
301 442 julius
     or32-elf-sim [-vhiqVt] [-f FILE] [--nosrv] [--srv=[N]]
302 346 jeremybenn
                      [-m ][-d STR]
303 19 jeremybenn
                      [--enable-profile] [--enable-mprofile] [FILE]
304
 
305 82 jeremybenn
Many of the options have both a short and a long form.  For example
306
`-h' or `--help'.
307 19 jeremybenn
 
308
`-v'
309
`--version'
310
     Print out the version and copyright notice for Or1ksim and exit.
311
 
312
`-h'
313
`--help'
314
     Print out help about the command line options and what they mean.
315
 
316 346 jeremybenn
`-i'
317
`--interactive'
318
     After starting, drop into the Or1ksim interactive command shell.
319
 
320
`-q'
321
`--quiet'
322
     Do not generate any information messages, only error messages.
323
 
324
`-V'
325
`--verbose'
326
     Generate extra output messages (equivalent of specifying the
327
     "verbose" option in the simulator configuration section (see *note
328
     Simulator Behavior: Simulator Behavior.).
329
 
330 385 jeremybenn
`-t'
331
`--trace'
332 420 jeremybenn
     Dump instruction just executed and any register/memory location
333
     chaged after each instruction (one line per instruction).
334 385 jeremybenn
 
335 472 jeremybenn
`--trace-physical'
336
`--trace-virtual'
337
     When tracing instructions, show the physical address
338
     (`--trace-physical') and/or the virtual address
339
     (`--trace-virtual') of the instruction being executed.  Both flags
340
     may be specified, in which case both physical and virtual
341
     addresses are shown, physical first.
342
 
343
          Note: Either or both flags may be specified without
344
          `--trace', to indicate how addresses should be shown if
345
          subsequently enabled by a `SIGUSER1' signal or `l.nop 8'
346
          opcode (*note Trace Generation: Trace Generation.).
347
 
348 19 jeremybenn
`-f FILE'
349 385 jeremybenn
`--file=FILE'
350 19 jeremybenn
     Read configuration commands from the specified file, looking first
351
     in the current directory, and otherwise in the `$HOME/.or1k'
352 82 jeremybenn
     directory.  If this argument is not specified, the file `sim.cfg'
353
     in those two locations is used.  Failure to find the file is a
354
     fatal error.  *Note Configuration: Configuration, for detailed
355
     information on configuring Or1ksim.
356 19 jeremybenn
 
357
`--nosrv'
358 235 jeremybenn
     Do not start up the "Remote Serial Protocol" debug server.  This
359
     overrides any setting specified in the configuration file.  This
360
     option may not be specified with `--srv'.  If it is, a rude
361
     message is printed and the `--nosrv' option is ignored.
362 19 jeremybenn
 
363
`--srv'
364
 
365
`--srv=N'
366 235 jeremybenn
     Start up the "Remote Serial Protocol" debug server.  This
367
     overrides any setting specified in the configuration file.  If the
368
     parameter, N, is specified, use that as the TCP/IP port for the
369
     server, otherwise a random value from the private port range
370
     (41920-65535) will be used.  This option may not be specified with
371
     `--nosrv'.  If it is, a rude message is printed and the `--nosrv'
372
     option is ignored.
373 19 jeremybenn
 
374 385 jeremybenn
`-m SIZE'
375 346 jeremybenn
`--memory=SIZE'
376
     Configure a memory block of SIZE bytes, starting at address zero.
377
     The size may be followed by `k', `K', `m', `M', `g', `G', to
378
     indicate kilobytes (2^10 bytes), megabytes (2^20 bytes) and
379
     gigabytes (2^30 bytes).
380
 
381
     This is mainly intended for use when Or1ksim is used without a
382
     configuration file, to allow just the processor and memory to be
383
     set up.  This is the equivalent of specifying a configuration
384
     memory section with `baseaddr = 0' and `size = SIZE' and all other
385
     parameters taking their default value.
386
 
387
     If a configuration file is also used, it should be sure not to
388
     specify an overlapping memory block.
389
 
390 385 jeremybenn
`-d CONFIG_STRING'
391 19 jeremybenn
`--debug-config=CONFIG_STRING'
392 82 jeremybenn
     Enable selected debug messages in Or1ksim.  This parameter is for
393
     use by developers only, and is not covered further here.  See the
394 19 jeremybenn
     source code for more details.
395
 
396 346 jeremybenn
`--report-memory-errors'
397
     By default all exceptions are now handled silently.  If this
398
     option is specified, bus exceptions will be reported with a
399
     message to standard error indicating the address at which the
400
     exception occurred.
401 19 jeremybenn
 
402 346 jeremybenn
     This was the default behaviour up to Or1ksim 0.4.0.  This flag is
403
     provided for those who wish to keep that behavior.
404
 
405 19 jeremybenn
`--strict-npc'
406
     In real hardware, setting the next program counter (NPC, SPR 16),
407 82 jeremybenn
     flushes the processor pipeline.  The consequence of this is that
408
     until the pipeline refills, reading the NPC will return zero.
409
     This is typically the case when debugging, since the processor is
410 19 jeremybenn
     stalled.
411
 
412
     Historically, Or1ksim has always returned the value of the NPC,
413 82 jeremybenn
     irrespective of when it is changed.  If the `--strict-npc' option
414
     is used, then Or1ksim will mirror real hardware more accurately.
415
     If the NPC is changed while the processor is stalled, subsequent
416 19 jeremybenn
     reads of its value will return 0 until the processor is unstalled.
417
 
418
     This is not currently the default behavior, since tools such as
419
     GDB have been implemented assuming the historic Or1ksim behavior.
420
     However at some time in the future it will become the default.
421
 
422
`--enable-profile'
423
     Enable instruction profiling.
424
 
425
`--enable-mprofile'
426
     Enable memory profiling.
427
 
428
 
429

430
File: or1ksim.info,  Node: Profiling Utility,  Next: Memory Profiling Utility,  Prev: Standalone Simulator,  Up: Usage
431
 
432
2.2 Profiling Utility
433
=====================
434
 
435 82 jeremybenn
This utility analyses instruction profile data generated by Or1ksim.
436
It may be invoked as a standalone command, or from the Or1ksim CLI.
437
The general form the standalone command is:
438 19 jeremybenn
 
439 442 julius
     or32-elf-profile [-vhcq] [-g=FILE]
440 19 jeremybenn
 
441 82 jeremybenn
Many of the options have both a short and a long form.  For example
442
`-h' or `--help'.
443 19 jeremybenn
 
444
`-v'
445
`--version'
446
     Print out the version and copyright notice for the Or1ksim
447
     profiling utility and exit.
448
 
449
`-h'
450
`--help'
451
     Print out help about the command line options and what they mean.
452
 
453
`-c'
454
`--cumulative'
455
     Show cumulative sum of cycles in functions
456
 
457
`-q'
458
`--quiet'
459
     Suppress messages
460
 
461
`-g=FILE'
462
`--generate=FILE'
463 82 jeremybenn
     The data file to analyse.  If omitted, the default file,
464 19 jeremybenn
     `sim.profile' is used.
465
 
466
 
467

468 442 julius
File: or1ksim.info,  Node: Memory Profiling Utility,  Next: Trace Generation,  Prev: Profiling Utility,  Up: Usage
469 19 jeremybenn
 
470
2.3 Memory Profiling Utility
471
============================
472
 
473 82 jeremybenn
This utility analyses memory profile data generated by Or1ksim.  It may
474
be invoked as a standalone command, or from the Or1ksim CLI.  The
475 19 jeremybenn
general form the standalone command is:
476
 
477 442 julius
     or32-elf-mprofile  [-vh] [-m=M] [-g=N] [-f=FILE] FROM TO
478 19 jeremybenn
 
479 82 jeremybenn
Many of the options have both a short and a long form.  For example
480
`-h' or `--help'.
481 19 jeremybenn
 
482
`-v'
483
`--version'
484
     Print out the version and copyright notice for the Or1ksim memory
485
     profiling utility and exit.
486
 
487
`-h'
488
`--help'
489
     Print out help about the command line options and what they mean.
490
 
491
`-m=M'
492
`--mode=M'
493 82 jeremybenn
     Specify the mode out output.  Permitted options are
494 19 jeremybenn
 
495
    `detailed'
496
    `d'
497 82 jeremybenn
          Detailed output.  This is the default if no mode is specified.
498 19 jeremybenn
 
499
    `pretty'
500
    `p'
501
          Pretty printed output.
502
 
503
    `access'
504
    `a'
505
          Memory accesses only.
506
 
507
    `width'
508
    `w'
509
          Access width only.
510
 
511
 
512
`-g=N'
513
`--group=N'
514
     Group 2^n bits of successive addresses together.
515
 
516
`-f=FILE'
517
`--filename=FILE'
518 82 jeremybenn
     The data file to analyse.  If not specified, the default,
519 19 jeremybenn
     `sim.profile' is used.
520
 
521
`FROM'
522
`TO'
523
     FROM and TO are respectively the start and end address of the
524
     region of memory to be analysed.
525
 
526
 
527

528 442 julius
File: or1ksim.info,  Node: Trace Generation,  Next: Simulator Library,  Prev: Memory Profiling Utility,  Up: Usage
529 19 jeremybenn
 
530 442 julius
2.4 Trace Generation
531
====================
532
 
533
An execution trace can be generated at run time with options passed by
534
the command line, or via the operating system's signal passing
535 472 jeremybenn
mechanism, or by `l.nop' opcodes in an application program.
536 442 julius
 
537 472 jeremybenn
The following flag can be used to create an execution dump.
538 450 jeremybenn
 
539 442 julius
`-t'
540
`--trace'
541
     Dump instruction just executed and any register/memory location
542 472 jeremybenn
     changed after each instruction (one line per instruction).  Each
543
     line starts with either "S" or "U" to indicate whether the
544
     processor was in supervisor or user mode _when the instruction
545
     completed_.  It is worth bearing in mind that tracing happens at
546
     completion of instruction execution and shows the state at that
547
     time.
548 442 julius
 
549 450 jeremybenn
Passing a signal `SIGUSR1' while the simulator is running toggles trace
550
generation. This can be done with the following command, assuming
551
Or1ksim's executable name is `or32-elf-sim':
552
 
553
     pkill -SIGUSR1 or32-elf-sim
554
 
555
This is useful in the case where trace output is desired after a
556
significant amount of simulation time, where it would be inconvenient to
557
generate trace up to that point.
558
 
559
If the `pkill' utility is not available, the `kill' utility can be used
560
if Or1ksim's process number is known. Use the following to determine
561
the process ID of the `or32-elf-sim' and then send the `SIGUSR1'
562
command to toggle execution trace generation:
563
 
564
     ps a | grep or32-elf-sim
565
     kill -SIGUSR1 _process-number_
566
 
567 472 jeremybenn
Tracing can also be enabled and disabled from within a target program
568
using the `l.nop 8' and `l.nop 9' opcodes to enable and disable tracing
569
respectively.
570
 
571
By default tracing will show the virtual address of each instruction
572
traced.  This may be controlled by two options, `--trace-physical' to
573
show the physical address and/or `--trace-virtual' to show the virtual
574
address. If neither is specified, the virtual address is shown.
575
 
576
     Note: Either or both flags may be specified without `--trace', to
577
     indicate how addresses should be shown if subsequently enabled by a
578
     `SIGUSER1' signal or `l.nop 8' opcode.
579
 
580 442 julius

581
File: or1ksim.info,  Node: Simulator Library,  Next: Ethernet TUN/TAP Interface,  Prev: Trace Generation,  Up: Usage
582
 
583
2.5 Simulator Library
584 19 jeremybenn
=====================
585
 
586
Or1ksim may be used as a static of dynamic library, `libsim.a' or
587 82 jeremybenn
`libsim.so'.  When compiling with the static library, the flag, `-lsim'
588 19 jeremybenn
should be added to the link command.
589
 
590
The header file `or1ksim.h' contains appropriate declarations of the
591 82 jeremybenn
functions exported by the Or1ksim library.  These are:
592 19 jeremybenn
 
593 346 jeremybenn
 -- `or1ksim.h': int or1ksim_init (int ARGC, char *ARGV, void
594 432 jeremybenn
          *CLASS_PTR, int (*UPR)(void *CLASS_PTR, unsigned long int
595
          ADDR, unsigned char MASK[], unsigned char RDATA[], int
596
          DATA_LEN), int (*UPW)(void *CLASS_PTR, unsigned long int
597
          ADDR, unsigned char MASK[], unsigned char WDATA[], int
598
          DATA_LEN))
599 346 jeremybenn
     The initialization function is supplied with a vector of arguments,
600
     which are interpreted as arguments to the standalone version (see
601
     *note Standalone Simulator: Standalone Simulator.), a pointer to
602
     the calling class, CLASS_PTR (since the library may be used from
603
     C++) and two up-call functions, one for reads, UPR, and one for
604
     writes, UPW.
605 19 jeremybenn
 
606
     UPW is called for any write to an address external to the model
607 82 jeremybenn
     (determined by a `generic' section in the configuration file).
608
     UPR is called for any reads to an external address.  The CLASS_PTR
609
     is passed back with these upcalls, allowing the function to
610
     associate the call with the class which originally initialized the
611 93 jeremybenn
     library.  Both UPW and UPR should return zero on success and
612
     non-zero otherwise.  At the present time the meaning of non-zero
613
     values is not defined but this may change in the future.
614 19 jeremybenn
 
615 93 jeremybenn
     MASK indicates which bytes in the data are to be written or read.
616 82 jeremybenn
     Bytes to be read/written should have 0xff set in MASK.  Otherwise
617 93 jeremybenn
     the byte should be zero.  The adddress, ADDR, is the _full_
618
     address, since the upcall function must handle all generic
619
     devices, using the full address for decoding.
620 19 jeremybenn
 
621 346 jeremybenn
     Endianness is not a concern, since Or1ksim is transferring byte
622
     vectors, not multi-byte values.
623 19 jeremybenn
 
624 346 jeremybenn
     The result indicates whether the initialization was successful.
625
     The integer values are available as an `enum or1ksim', with
626
     possible values `OR1KSIM_RC_OK' and `OR1KSIM_RC_BADINIT'.
627 19 jeremybenn
 
628 346 jeremybenn
          Caution: This is a change from versions 0.3.0 and 0.4.0.  It
629
          further simplifies the interface, and makes Or1ksim more
630
          consistent with payload representation in SystemC TLM 2.0.
631
 
632 93 jeremybenn
          Note: The current implementation of Or1ksim always transfers
633
          single words (4 bytes), using masks if smaller values are
634
          required.  In this it mimcs the behavior of the WishBone bus.
635
 
636
 
637 19 jeremybenn
 -- `or1ksim.h': int or1ksim_run (double DURATION)
638
     Run the simulator for the simulated duration specified (in
639 346 jeremybenn
     seconds).  A duration of -1 indicates `run forever'
640 19 jeremybenn
 
641 346 jeremybenn
     The result indicates how the run terminated.  The integer values
642
     are available as an `enum or1ksim', with possible values
643
     `OR1KSIM_RC_OK' (ran for the full duration), `OR1KSIM_RC_BRKPT'
644
     (terminated early due to hitting a breakpoint) and
645
     `OR1KSIM_RC_HALTED' (terminated early due to hitting `l.nop 1').
646 19 jeremybenn
 
647 346 jeremybenn
 
648 19 jeremybenn
 -- `or1ksim.h': void or1ksim_reset_duration (double DURATION)
649
     Change the duration of a run specified in an earlier call to
650 82 jeremybenn
     `or1ksim_run'.  Typically this is called from an upcall, which
651 19 jeremybenn
     realizes it needs to change the duration of the run specified in
652
     the call to `or1ksim_run' that has been interrupted by the upcall.
653
 
654
     The time specified is the amount of time that the run must continue
655
     for (i.e the duration from _now_, not the duration from the
656
     original call to `or1ksim_run').
657
 
658
 
659
 -- `or1ksim.h': void or1ksim_set_time_point ()
660 82 jeremybenn
     Set a timing point.  For use with `or1ksim_get_time_period'.
661 19 jeremybenn
 
662
 
663
 -- `or1ksim.h': double or1ksim_get_time_period ()
664
     Return the simulated time (in seconds) that has elapsed since the
665
     last call to `or1ksim_set_time_point'.
666
 
667
 
668
 -- `or1ksim.h': int or1ksim_is_le ()
669
     Return 1 (logical true) if the Or1ksim simulation is
670
     little-endian, 0 otherwise.
671
 
672
 
673
 -- `or1ksim.h': unsigned long int or1ksim_clock_rate ()
674 82 jeremybenn
     Return the Or1ksim clock rate (in Hz).  This is the value
675
     specified in the configuration file.
676 19 jeremybenn
 
677
 
678
 -- `or1ksim.h': void or1ksim_interrupt (int I)
679 82 jeremybenn
     Generate an edge-triggered interrupt on interrupt line I.  The
680 432 jeremybenn
     interrupt must be cleared separately by clearing the corresponding
681
     bit in the PICSR SPR.  Until the interrupt is cleared, any further
682
     interrupts on the same line will be ignored with a warning.  A
683
     warning will be generated and the interrupt request ignored if
684
     level sensitive interrupts have been configured with the
685
     programmable interrupt controller (*note Interrupt Configuration:
686
     Interrupt Configuration.).
687 19 jeremybenn
 
688
 
689
 -- `or1ksim.h': void or1ksim_interrupt_set (int I)
690 82 jeremybenn
     Assert a level-triggered interrupt on interrupt line I.  The
691 19 jeremybenn
     interrupt must be cleared separately by an explicit call to
692 432 jeremybenn
     `or1ksim_interrupt_clear'.  Until the interrupt is cleared, any
693
     further setting of interrupts on the same line will be ignored
694
     with a warning.  A warning will be generated, and the interrupt
695
     request ignored if edge sensitive interrupts have been configured
696
     with the programmable interrupt controller (*note Interrupt
697
     Configuration: Interrupt Configuration.).
698 19 jeremybenn
 
699
 
700
 -- `or1ksim.h': void or1ksim_interrupt_clear (int I)
701
     Clear a level-triggered interrupt on interrupt line I, which was
702 82 jeremybenn
     previously asserted by a call to `or1ksim_interrupt_set'.  A
703 19 jeremybenn
     warning will be generated, and the interrupt request ignored if
704
     edge sensitive interrupts have been configured with the
705
     programmable interrupt controller (*note Interrupt Configuration:
706
     Interrupt Configuration.).
707
 
708
 
709 104 jeremybenn
 -- `or1ksim.h': double or1ksim_jtag_reset ()
710 346 jeremybenn
     Drive a reset sequence through the JTAG interface.  Return the
711 104 jeremybenn
     (model) time taken for this action.  Remember that the JTAG has
712
     its own clock, which can be an order of magnitude slower than the
713
     main clock, so even a reset (5 JTAG cycles) could take 50
714
     processor clock cycles to complete.
715
 
716
 
717 432 jeremybenn
 -- `or1ksim.h': double or1ksim_jtag_shift_ir (unsigned char *JREG, int
718
          NUM_BITS)
719 104 jeremybenn
     Shift the supplied register through the JTAG instruction register.
720 346 jeremybenn
     Return the (model) time taken for this action.  The register is
721 104 jeremybenn
     supplied as a byte vector, with the least significant bits in the
722
     least significant byte.  If the total number of bits is not an
723
     exact number of bytes, then the odd bits are found in the least
724
     significant end of the highest numbered byte.
725
 
726
     For example a 12-bit register would have bits 0-7 in byte 0 and
727
     bits 11-8 in the least significant 4 bits of byte 1.
728
 
729
 
730 432 jeremybenn
 -- `or1ksim.h': double or1ksim_jtag_shift_dr (unsigned char *JREG, int
731
          NUM_BITS)
732 104 jeremybenn
     Shift the supplied register through the JTAG data register.
733 346 jeremybenn
     Return the (model) time taken for this action.  The register is
734 104 jeremybenn
     supplied as a byte vector, with the least significant bits in the
735
     least significant byte.  If the total number of bits is not an
736
     exact number of bytes, then the odd bits are found in the least
737
     significant end of the highest numbered byte.
738
 
739
     For example a 12-bit register would have bits 0-7 in byte 0 and
740
     bits 11-8 in the least significant 4 bits of byte 1.
741
 
742
 
743 432 jeremybenn
 -- `or1ksim.h': int or1ksim_read_mem (unsigned long int ADDR, unsigned
744
          char *BUF, int LEN)
745 346 jeremybenn
     Read LEN bytes from ADDR, placing the result in BUF.  Return LEN
746
     on success and 0 on failure.
747
 
748
          Note: This function was added in Or1ksim 0.5.0.
749
 
750
 
751 432 jeremybenn
 -- `or1ksim.h': int or1ksim_write_mem (unsigned long int ADDR, const
752
          unsigned char *BUF, int LEN)
753 346 jeremybenn
     Write LEN bytes to ADDR, taking the data from BUF.  Return LEN on
754
     success and 0 on failure.
755
 
756
          Note: This function was added in Or1ksim 0.5.0.
757
 
758
 
759 432 jeremybenn
 -- `or1ksim.h': int or1ksim_read_spr (int SPRNUM, unsigned long int
760
          *SPRVAL_PTR)
761 346 jeremybenn
     Read the SPR specified by SPRNUM, placing the result in
762
     SPRVAL_PTR.  Return non-zero on success and 0 on failure.
763
 
764
          Note: This function was added in Or1ksim 0.5.0.
765
 
766
 
767 432 jeremybenn
 -- `or1ksim.h': int or1ksim_write_spr (int SPRNUM, unsigned long int
768
          SPRVA)
769 346 jeremybenn
     Write SPRVAL to the SPR specified by SPRNUM.  Return non-zero on
770
     success and 0 on failure.
771
 
772
          Note: This function was added in Or1ksim 0.5.0.
773
 
774
 
775 432 jeremybenn
 -- `or1ksim.h': int or1ksim_read_reg (int REGNUM, unsigned long int
776
          *REGVAL_PTR)
777 346 jeremybenn
     Read the general purpose register specified by REGNUM, placing the
778
     result in REGVAL_PTR.  Return non-zero on success and 0 on failure.
779
 
780
          Note: This function was added in Or1ksim 0.5.0.
781
 
782
 
783 432 jeremybenn
 -- `or1ksim.h': int or1ksim_write_reg (int REGNUM, unsigned long int
784
          REGVA)
785 346 jeremybenn
     Write REGVAL to the general purpose register specified by REGNUM.
786
     Return non-zero on success and 0 on failure.
787
 
788
          Note: This function was added in Or1ksim 0.5.0.
789
 
790
 
791 432 jeremybenn
 -- `or1ksim.h': void or1ksim_set_stall_state (int STATE)
792 346 jeremybenn
     Set the processor's state according to STATE (1 = stalled, 0 = not
793
     stalled).
794
 
795
          Note: This function was added in Or1ksim 0.5.0.
796
 
797
 
798 19 jeremybenn
The libraries will be installed in the `lib' sub-directory of the main
799
installation directory (as specified with the `--prefix' option to the
800
`configure' script).
801
 
802
For example if the main installation directory is `/opt/or1ksim', the
803 82 jeremybenn
library will be found in the `/opt/or1ksim/lib' directory.  It is
804 19 jeremybenn
available as both a static library (`libsim.a') and a shared object
805
(`libsim.so').
806
 
807
To link against the library add the `-lsim' flag when linking and do
808
one of the following:
809
 
810
   * Add the library directory to the `LD_LIBRARY_PATH' environment
811 82 jeremybenn
     variable during execution.  For example:
812 19 jeremybenn
 
813
          export LD_LIBRARY_PATH=/opt/or1ksim/lib:$LD_LIBRARY_PATH
814
 
815
   * Add the library directory to the `LD_RUN_PATH' environment
816 82 jeremybenn
     variable during linking.  For example:
817 19 jeremybenn
 
818
          export LD_RUN_PATH=/opt/or1ksim/lib:$LD_RUN_PATH
819
 
820
   * Use the linker `--rpath' option and specify the library directory
821 82 jeremybenn
     when linking your program.  For example
822 19 jeremybenn
 
823 82 jeremybenn
          gcc ...  -Wl,--rpath -Wl,/opt/or1ksim/lib ...
824 19 jeremybenn
 
825
   * Add the library directory to `/etc/ld.so.conf'
826
 
827
 
828

829 460 jeremybenn
File: or1ksim.info,  Node: Ethernet TUN/TAP Interface,  Next: l.nop Support,  Prev: Simulator Library,  Up: Usage
830 440 jeremybenn
 
831 442 julius
2.6 Ethernet TUN/TAP Interface
832 440 jeremybenn
==============================
833
 
834
When an Ethernet peripheral is configured (*note Ethernet
835
Configuration: Ethernet Configuration.), one option is to tunnel
836
traffic through a TUN/TAP interface.  The low level TAP interface is
837
used to tunnel raw Ethernet datagrams.
838
 
839
The TAP interface can then be connected to a physical Ethernet through a
840
bridge, allowing the Or1ksim model to connect to a physical network.
841
This is particularly when Or1ksim is running the OpenRISC Linux kernel
842
image.
843
 
844
This section explains how to set up a bridge for use by Or1ksim. It does
845
require superuser access to the host machine (or at least the relevant
846
network capabilities). A system administrator can modify these
847
guidelines so they are executed on reboot if appropriate.
848
 
849
* Menu:
850
 
851
* Setting Up a Persistent TAP device::
852
* Establishing a Bridge::
853
* Opening the Firewall::
854
* Disabling Ethernet Filtering::
855
* Networking from OpenRISC Linux and BusyBox::
856
* Tearing Down a Bridge::
857
 
858

859
File: or1ksim.info,  Node: Setting Up a Persistent TAP device,  Next: Establishing a Bridge,  Up: Ethernet TUN/TAP Interface
860
 
861 442 julius
2.6.1 Setting Up a Persistent TAP device
862 440 jeremybenn
----------------------------------------
863
 
864
TUN/TAP devices can be created dynamically, but this requires superuser
865
privileges (or at least `CAP_NET_ADMIN' capability).  The solution is
866
to create a persistent TAP device.  This can be done using either
867
`openvpn' or `tunctl'.  In either case the package must be installed on
868
the host system.  Using `openvpn', the following would set up a TAP
869
interface for a specified user and group.
870
 
871
     openvpn --mktun --dev tap_n_ --user _username_ --group _groupname_
872
 
873

874
File: or1ksim.info,  Node: Establishing a Bridge,  Next: Opening the Firewall,  Prev: Setting Up a Persistent TAP device,  Up: Ethernet TUN/TAP Interface
875
 
876 442 julius
2.6.2 Establishing a Bridge
877 440 jeremybenn
---------------------------
878
 
879
A bridge is a "virtual" local area network interfaces, subsuming two or
880
more existing network interfaces.  In this case we will bridge the
881
physical Ethernet interface of the host with the TAP interface that
882
will be used by Or1ksim.
883
 
884
The Ethernet and TAP must lose their own individual IP addresses (by
885
setting them to 0.0.0.0) and are replaced by the IP address of the
886
bridge interface. To do this we use the `bridge-utils' package, which
887
must be installed on the host system. These commands are require
888
superuser privileges or `CAP_NET_ADMIN' capability. To create a new
889
interface `br_n_' the following commands are appropriate.
890
 
891
     brctl addbr br_n_
892
     brctl addif br_n_ eth_x_
893
     brctl addif br_n_ tap_y_
894
 
895
     ifconfig eth_x_ 0.0.0.0 promisc up
896
     ifconfig tap_y_ 0.0.0.0 promisc up
897
 
898
     dhclient br_n_
899
 
900
The last command instructs the bridge to obtain its IP address, netmask,
901
broadcast address, gateway and nameserver information using DHCP.  In a
902
network without DHCP it should be replaced by `ifconfig' to set a
903
static IP address, netmask and broadcast address.
904
 
905
     Note: This will leave a spare dhclient process running in the
906
     background, which should be killed for tidiness. There is a
907
     technique to avoid this using `omshell', but that is beyond the
908
     scope of this guide.
909
 
910
     Note: It is not clear to the author why the existing interfaces
911
     need to be brought up in promiscuous mode, but it seems to cure
912
     various problems.
913
 
914

915
File: or1ksim.info,  Node: Opening the Firewall,  Next: Disabling Ethernet Filtering,  Prev: Establishing a Bridge,  Up: Ethernet TUN/TAP Interface
916
 
917 442 julius
2.6.3 Opening the Firewall
918 440 jeremybenn
--------------------------
919
 
920
Firewall rules should be added to ensure traffic flows freely through
921
the TAP and bridge interfaces. As superuser the following commands are
922
appropriate.
923
 
924
     iptables -A INPUT -i tap_y_ -j ACCEPT
925
     iptables -A INPUT -i br_n_ -j ACCEPT
926
     iptables -A FORWARD -i br_n_ -j ACCEPT
927
 
928

929
File: or1ksim.info,  Node: Disabling Ethernet Filtering,  Next: Networking from OpenRISC Linux and BusyBox,  Prev: Opening the Firewall,  Up: Ethernet TUN/TAP Interface
930
 
931 442 julius
2.6.4 Disabling Ethernet Filtering
932 440 jeremybenn
----------------------------------
933
 
934
Some systems may have ethernet filtering enabled (`ebtables',
935
`bridge-nf', `arptables') which will stop traffic flowing through the
936
bridge.
937
 
938
The easiest way to disable this is by writing zero to all `bridge-nf-*'
939
entries in `/proc/sys/net/bridge'. As superuser the following commands
940
will achieve this.
941
 
942
     cd /proc/sys/net/bridge
943
     for f in bridge-nf-*; do echo 0 > $f; done
944
 
945

946
File: or1ksim.info,  Node: Networking from OpenRISC Linux and BusyBox,  Next: Tearing Down a Bridge,  Prev: Disabling Ethernet Filtering,  Up: Ethernet TUN/TAP Interface
947
 
948 442 julius
2.6.5 Networking from OpenRISC Linux and BusyBox
949 440 jeremybenn
------------------------------------------------
950
 
951
The main use of this style of Ethernet interface to Or1ksim is when
952
running the OpenRISC Linux kernel with BusyBox. The following commands
953
in the BusyBox console window will configure the Ethernet interface
954
(assumed to be `eth0') and bring it up with a DHCP assigned address.
955
 
956
     ifconfig eth0
957
     ifup eth0
958
 
959
At this stage interface to IP addresses will work correctly.
960
 
961
For DNS to work the BusyBox system needs to know where to find a
962
nameserver.  Under BusyBox, `udhcp' does not configure
963
`/etc/resolv.conf' automatically.
964
 
965
The solution is to duplicate the nameserver entry from the
966
`/etc/resolv.conf' file of the host on the BusyBox system. A typical
967
file might be as follows:
968
 
969
     `nameserver 192.168.0.1'
970
 
971
It is convenient to make this permanent within the Linux initramfs. Add
972
the file as `arch/openrisc/support/initramfs/etc/resolv.conf' within
973
the Linux source tree and rebuild `vmlinux'. It will then be present
974
automatically.
975
 
976
One of the most useful functions that is possible is to mount the host
977
file system through NFS. For example, from the BusyBox console:
978
 
979
     mount -t nfs -o nolock 192.168.0.60:/home /mnt
980
 
981
Another useful technique is to telnet into the BusyBox system from the
982
host. This is particularly valuable when a console process locks up,
983
since the `xterm' console will not recognize ctrl-C. Instead the rogue
984
process can be killed from a telnet connection.
985
 
986

987
File: or1ksim.info,  Node: Tearing Down a Bridge,  Prev: Networking from OpenRISC Linux and BusyBox,  Up: Ethernet TUN/TAP Interface
988
 
989 442 julius
2.6.6 Tearing Down a Bridge
990 440 jeremybenn
---------------------------
991
 
992
There is little reason why a bridge should ever need to be torn down,
993
but if desired, the following commands will achieve the effect.
994
 
995
     ifconfig br_n_ down
996
     brctl delbr br_n_
997
 
998
     dhclient eth_x_
999
 
1000
As before this will leave a spare `dhclient' process in the background
1001
which should be killed.
1002
 
1003
If desired the TAP interface can be deleted using
1004
 
1005
     openvpn --rmtun -dev tap_y_
1006
 
1007
     Caution: The TAP interface should not be in use when running this
1008
     command. For example any OpenRISC Linux/BusyBox sessions should be
1009
     closed first.
1010
 
1011

1012 460 jeremybenn
File: or1ksim.info,  Node: l.nop Support,  Prev: Ethernet TUN/TAP Interface,  Up: Usage
1013
 
1014
2.7 l.nop Opcode Support
1015
========================
1016
 
1017
The OpenRISC `l.nop' opcode can take a parameter.  This has no effect
1018
on the semantics of the opcode, but can be used to trigger side effect
1019
behavior in a simulator.  Within Or1ksim, the following parameters are
1020
supported.
1021
 
1022
`l.nop 0'
1023
     The equivalent to `l.nop' with no parameter. Has no side effects.
1024
 
1025
`l.nop 1'
1026
     Execution of Or1ksim is terminated. This is used to implement the
1027
     library `exit' functions.
1028
 
1029
`l.nop 2'
1030
     Report the value in `r3' on the console as a 32-bit hex value.
1031
 
1032
`l.nop 3'
1033
     In earlier versions of Or1ksim this treated `r3' as a pointer to a
1034 508 jeremybenn
     `printf' style format string, and registers `r4' through `r8' as
1035 460 jeremybenn
     parameters for that format string.
1036
 
1037
     This opcode is no longer supported, and has no effect if used.
1038
 
1039
`l.nop 4'
1040
     The value in `r3' is printed to standard output as an ASCII
1041
     character.  All library output routines are implemented using this
1042
     opcode.
1043
 
1044
`l.nop 5'
1045
     The statistics counters are reset.
1046
 
1047
`l.nop 6'
1048
     The number of clock ticks since start of execution (a 64-bit
1049
     value) is returned in `r11' (low 32 bits) and `r12' (high 32 bits).
1050
 
1051
`l.nop 7'
1052
     The number of picoseconds per clock cycle is returned in `r11'.
1053
     This is used with `l.nop 6' to implement timing functions.
1054
 
1055
`l.nop 8'
1056
     Instruction tracing is turned on.
1057
 
1058
`l.nop 9'
1059
     Instruction tracing is turned off.
1060
 
1061 483 jeremybenn
`l.nop 10'
1062
     A 32-bit random number is returned in `r11'.
1063 460 jeremybenn
 
1064 483 jeremybenn
     The random numbers are generated using `random', which in turn is
1065
     seeded through `srandom' using the host `/dev/urandom' if
1066
     available, or else the process ID of the Or1ksim instance.
1067
 
1068
     This opcode is particularly useful for situations where a target
1069
     program running on Or1ksim needs to obtain genuine system entropy
1070
     to generate random numbers.
1071
 
1072
`l.nop 11'
1073
     Return a non-zero value in `r11'.
1074
 
1075
     This opcode can be used to detect if a target is running under
1076
     Or1ksim.  Set `r11' to zero, issue this opcode, and look to see if
1077
     `r11' is non-zero.
1078
 
1079
 
1080 460 jeremybenn

1081 19 jeremybenn
File: or1ksim.info,  Node: Configuration,  Next: Interactive Command Line,  Prev: Usage,  Up: Top
1082
 
1083
3 Configuration
1084
***************
1085
 
1086 82 jeremybenn
Or1ksim is configured through a configuration file.  This is specified
1087 19 jeremybenn
through the `-f' parameter to the Or1ksim command, or passed as a
1088 82 jeremybenn
string when initializing the Or1ksim library.  If no file is specified,
1089
the default `sim.cfg' is used.  The file is looked for first in the
1090 224 jeremybenn
current directory, then in the `$HOME/.or1ksim' directory of the user.
1091 19 jeremybenn
 
1092
* Menu:
1093
 
1094
* Configuration File Format::
1095
* Simulator Configuration::
1096
* Core OpenRISC Configuration::
1097
* Peripheral Configuration::
1098
 
1099

1100
File: or1ksim.info,  Node: Configuration File Format,  Next: Simulator Configuration,  Up: Configuration
1101
 
1102
3.1 Configuration File Format
1103
=============================
1104
 
1105 346 jeremybenn
The configuration file is a plain text file.  A reference example,
1106
`sim.cfg', is included in the top level directory of the distribution.
1107 19 jeremybenn
 
1108
* Menu:
1109
 
1110
* Configuration File Preprocessing::
1111
* Configuration File Syntax::
1112
 
1113

1114
File: or1ksim.info,  Node: Configuration File Preprocessing,  Next: Configuration File Syntax,  Up: Configuration File Format
1115
 
1116
3.1.1 Configuration File Preprocessing
1117
--------------------------------------
1118
 
1119 82 jeremybenn
The configuration file may include C style comments (i.e.  delimited by
1120 19 jeremybenn
`/*' and `*/').
1121
 
1122

1123
File: or1ksim.info,  Node: Configuration File Syntax,  Prev: Configuration File Preprocessing,  Up: Configuration File Format
1124
 
1125
3.1.2 Configuration File Syntax
1126
-------------------------------
1127
 
1128
The configuration file is divided into a series of sections, with the
1129
general form:
1130
 
1131
     section SECTION_NAME
1132
 
1133
       ...
1134
 
1135
     end
1136
 
1137
Sections may also have sub-sections within them (currently only the
1138
ATA/ATAPI disc interface uses this).
1139
 
1140
Within a section, or sub-section are a series of parameter assignments,
1141
one per line, withe the general form
1142
 
1143
       PARAMETER = VALUE
1144
 
1145
Depending on the parameter, the value may be a named value (an
1146
enumeration), an integer (specified in any format acceptable in C) or a
1147 82 jeremybenn
string in doubple quotes.  For flag parameters, the value 1 is used to
1148
mean "true" or "on" and the value "0" to mean "false" or "off".  An
1149 19 jeremybenn
example from a memory section shows each of these
1150
 
1151
     section memory
1152
       type    = random
1153
       pattern = 0x00
1154
       name    = "FLASH"
1155
       ...
1156
     end
1157
 
1158
Many parameters are optional and take reasonable default values if not
1159 82 jeremybenn
specified.  However there are some parameters (for example the `ce'
1160 19 jeremybenn
parameter in `section memory') _must_ be specified.
1161
 
1162
Subsections are introduced by a keyword, with a parameter value (no `='
1163 82 jeremybenn
sign), and end with the same keyword prefixed by `end'.  Thus the
1164 19 jeremybenn
ATA/ATAPI inteface (`section ata') has a `device' subsection, thus:
1165
 
1166
     section ata
1167
       ...
1168
       device 0
1169
         type    = 1
1170
         file = "FILENAME"
1171
         ...
1172
       enddevice
1173
       ...
1174
     end
1175
 
1176
Some sections (for example `section sim') should appear only once.
1177
Others (for example `section memory' may appear multiple times.
1178
 
1179
Sections may be omitted, _unless they contain parameters which are
1180 82 jeremybenn
non-optional_.  If the section describes a part of the simulator which
1181 19 jeremybenn
is optional (for example whether it has a UART), then that
1182 82 jeremybenn
functionality will not be provided.  If the section describes a part of
1183 19 jeremybenn
the simulator which is not optional (for example the CPU), then all the
1184
parameters of that section will take their default values.
1185
 
1186
All optional parts of the functionality are always described by
1187
sections including a `enabled' parameter, which can be set to 0 to
1188
ensure that functionality is explicitly omitted.
1189
 
1190
Even if a section is disabled, all its parameters will be read and
1191 82 jeremybenn
stored.  This is helpful if the section is subsequently enabled from
1192
the Or1ksim command line (*note Interactive Command Line: Interactive
1193 19 jeremybenn
Command Line.).
1194
 
1195
     Tip: It generally clearer to have sections describing _all_
1196
     components, with omitted functionality explicitly indicated by
1197
     setting the `enabled' parameter to 0
1198
 
1199
The following sections describe the various configuration sections and
1200
the parameters which may be set in each.
1201
 
1202

1203
File: or1ksim.info,  Node: Simulator Configuration,  Next: Core OpenRISC Configuration,  Prev: Configuration File Format,  Up: Configuration
1204
 
1205
3.2 Simulator Configuration
1206
===========================
1207
 
1208
* Menu:
1209
 
1210
* Simulator Behavior::
1211
* Verification API Configuration::
1212
* CUC Configuration::
1213
 
1214

1215
File: or1ksim.info,  Node: Simulator Behavior,  Next: Verification API Configuration,  Up: Simulator Configuration
1216
 
1217
3.2.1 Simulator Behavior
1218
------------------------
1219
 
1220 82 jeremybenn
Simulator behavior is described in `section sim'.  This section should
1221
appear only once.  The following parameters may be specified.
1222 19 jeremybenn
 
1223
`verbose = 0|1'
1224 82 jeremybenn
     If 1 (true), print extra messages.  Default 0.
1225 19 jeremybenn
 
1226
`debug = 0-9'
1227 82 jeremybenn
 
1228
     higher the value the greater the number of messages.  Default 0.
1229
     Negative values will be treated as 0 (with a warning).  Values
1230
     that are too large will be treated as 9 (with a warning).
1231 19 jeremybenn
 
1232
`profile = 0|1'
1233
     If 1 (true) generate a profiling file using the file specified in
1234 82 jeremybenn
     the `prof_file' parameter or otherwise `sim.profile'.  Default 0.
1235 19 jeremybenn
 
1236
`prof_file = ``FILENAME'''
1237 82 jeremybenn
     Specifies the file to be used with the `profile' parameter.
1238
     Default `sim.profile'.  For backwards compatibility, the
1239
     alternative name `prof_fn' is supported for this parameter, but
1240 346 jeremybenn
     deprecated.  Default `sim.profile'.
1241 19 jeremybenn
 
1242
`mprofile = 0|1'
1243
     If 1 (true) generate a memory profiling file using the file
1244
     specified in the `mprof_file' parameter or otherwise
1245 82 jeremybenn
     `sim.mprofile'.  Default 0.
1246 19 jeremybenn
 
1247 346 jeremybenn
`mprof_file = ``FILENAME'''
1248 19 jeremybenn
     Specifies the file to be used with the `mprofile' parameter.
1249 82 jeremybenn
     Default `sim.mprofile'.  For backwards compatibility, the
1250 19 jeremybenn
     alternative name `mprof_fn' is supported for this parameter, but
1251 346 jeremybenn
     deprecated.  Default `sim.mprofile'.
1252 19 jeremybenn
 
1253
`history = 0|1'
1254 82 jeremybenn
     If 1 (true) track execution flow.  Default 0.
1255 19 jeremybenn
 
1256
          Note: Setting this parameter seriously degrades performance.
1257
 
1258
          Note: If this execution flow tracking is enabled, then
1259
          `dependstats' must be enabled in the CPU configuration
1260
          section (*note CPU Configuration: CPU Configuration.).
1261
 
1262
`exe_log = 0|1'
1263 82 jeremybenn
     If 1 (true), generate an execution log.  Log is written to the
1264
     file specified in parameter `exe_log_file'.  Default 0.
1265 19 jeremybenn
 
1266
          Note: Setting this parameter seriously degrades performance.
1267
 
1268
`exe_log_type = default|hardware|simple|software'
1269
     Type of execution log to produce.
1270
 
1271
    `default'
1272 82 jeremybenn
          Produce default output for the execution log.  In the current
1273 19 jeremybenn
          implementation this is the equivalent of `hardware'.
1274
 
1275
    `hardware'
1276
          After each instruction execution, log the number of
1277
          instructions executed so far, the next instruction to execute
1278
          (in hex), the general purpose registers (GPRs), status
1279
          register, exception program counter, exception, effective
1280
          address register and exception status register.
1281
 
1282
    `simple'
1283
          After each instruction execution, log the number of
1284
          instructions executed so far and the next instruction to
1285
          execute, symbolically disassembled.
1286
 
1287
    `software'
1288
          After each instruction execution, log the number of
1289
          instructions executed so far and the next instruction to
1290 82 jeremybenn
          execute, symbolically disassembled.  Also show the value of
1291 19 jeremybenn
          each operand to the instruction.
1292
 
1293
 
1294 82 jeremybenn
     Default value `hardware'.  Any unrecognized keyword (case
1295 19 jeremybenn
     insensitive) will be treated as the default with a warning.
1296
 
1297
          Note: Execution logs can be _very_ big.
1298
 
1299
`exe_log_start = VALUE'
1300 82 jeremybenn
     Address of the first instruction to start logging.  Default 0.
1301 19 jeremybenn
 
1302
`exe_log_end = VALUE'
1303 82 jeremybenn
     Address of the last instruction to log.  Default no limit (i.e
1304
     once started logging will continue until the simulator exits).
1305 19 jeremybenn
 
1306
`exe_log_marker = VALUE'
1307
     Specifies the number of instructions between printing horizontal
1308 82 jeremybenn
     markers.  Default is to produce no markers.
1309 19 jeremybenn
 
1310
`exe_log_file = FILENAME'
1311
     Filename for the execution log filename if `exe_log' is enabled.
1312 82 jeremybenn
     Default `executed.log'.  For backwards compatibility, the
1313 19 jeremybenn
     alternative name `exe_log_fn' is supported for this parameter, but
1314
     deprecated.
1315
 
1316 202 julius
`exe_bin_insn_log = 0|1'
1317 346 jeremybenn
     Enable logging of executed instructions to a file in binary format.
1318
     This is helpful for off-line dynamic execution analysis.
1319 202 julius
 
1320 346 jeremybenn
          Note: Execution logs can be _very_ big.  For example, while
1321 220 jeremybenn
          booting the Linux kernel, version 2.6.34, a log file 1.2GB in
1322
          size was generated.
1323 202 julius
 
1324
`exe_bin_insn_log_file = FILENAME'
1325
     Filename for the binary execution log filename if
1326
     `exe_bin_insn_log' is enabled.  Default `exe-insn.bin'.
1327
 
1328 19 jeremybenn
`clkcycle = VALUE[ps|ns|us|ms]'
1329 82 jeremybenn
     Specify the time taken by one clock cycle.  If no units are
1330
     specified, `ps' is assumed.  Default 4000ps (250MHz).
1331 19 jeremybenn
 
1332
 
1333

1334
File: or1ksim.info,  Node: Verification API Configuration,  Next: CUC Configuration,  Prev: Simulator Behavior,  Up: Simulator Configuration
1335
 
1336
3.2.2 Verification API (VAPI) Configuration
1337
-------------------------------------------
1338
 
1339
The Verification API (VAPI) provides a TCP/IP interface to allow
1340 82 jeremybenn
components of the simulation to be controlled externally.  *Note
1341 19 jeremybenn
Verification API: Verification API, for more details.
1342
 
1343 82 jeremybenn
Verification API configuration is described in `section vapi'.  This
1344
section may appear at most once.  The following parameters may be
1345 19 jeremybenn
specified.
1346
 
1347
`enabled = 0|1'
1348
     If 1 (true), verification API is enabled and its server started.
1349
     If 0 (the default), it is disabled.
1350
 
1351
`server_port = VALUE'
1352
     When VAPI is enabled, communication will be via TCP/IP on the port
1353 82 jeremybenn
     specified by VALUE.  The value must lie in the range 1 to 65535.
1354 19 jeremybenn
     The default value is 50000.
1355
 
1356 82 jeremybenn
          Tip: There is no registered port for Or1ksim VAPI.  Good
1357 19 jeremybenn
          practice suggests users should adopt port values in the
1358 82 jeremybenn
          "Dynamic" or "Private" port range, i.e.  49152-65535.
1359 19 jeremybenn
 
1360
`log_enabled = 0|1'
1361
     If 1 (true), all VAPI requests and sent commands will be logged.
1362 82 jeremybenn
     If 0 (the default), logging is diabled.  Logs are written to the
1363 19 jeremybenn
     file specified by the `vapi_log_file' field (see below).
1364
 
1365
          Caution: This can generate a substantial amount of file I/O
1366
          and seriously degrade simulator performance.
1367
 
1368
`hide_device_id = 0|1'
1369 82 jeremybenn
     If 1 (true) don't log the device ID.  If 0 (the default), log the
1370
     device ID.  This feature (when set to 1) is provided for backwards
1371 19 jeremybenn
     compatibility with an old version of VAPI.
1372
 
1373
`vapi_log_file = "FILENAME"'
1374
     Use `filename' as the file for logged data is logging is enabled
1375 82 jeremybenn
     (see `log_enabled' above).  The default is `"vapi.log"'.  For
1376 19 jeremybenn
     backwards compatibility, the alternative name `vapi_log_fn' is
1377
     supported for this parameter, but deprecated.
1378
 
1379
 
1380

1381
File: or1ksim.info,  Node: CUC Configuration,  Prev: Verification API Configuration,  Up: Simulator Configuration
1382
 
1383
3.2.3 Custom Unit Compiler (CUC) Configuration
1384
----------------------------------------------
1385
 
1386
The Custom Unit Compiler (CUC) was a project by Marko Mlinar to generate
1387 82 jeremybenn
Verilog from ANSI C functions.  The project seems to not have progressed
1388
beyond the initial prototype phase.  The configuration parameters are
1389 19 jeremybenn
described here for the record.
1390
 
1391 82 jeremybenn
CUC configuration is described in `section cuc'.  This section may
1392
appear at most once.  The following parameters may be specified.
1393 19 jeremybenn
 
1394
`memory_order = none|weak|strong|exact'
1395
     This parameter specifies the memory ordering required:
1396
 
1397
    `memory_order=none'
1398
          Different memory ordering, even if there are dependencies.
1399
          Bursts can be made, width can change.
1400
 
1401 346 jeremybenn
    `memory_order=weak'
1402 82 jeremybenn
          Different memory ordering, even if there are dependencies.  If
1403 19 jeremybenn
          dependencies cannot occur, then bursts can be made, width can
1404
          change.
1405
 
1406 346 jeremybenn
    `memory_order=strong'
1407 82 jeremybenn
          Same memory ordering.  Bursts can be made, width can change.
1408 19 jeremybenn
 
1409 346 jeremybenn
    `memory_order=exact'
1410 19 jeremybenn
          Exactly the same memory ordering and widths.
1411
 
1412
 
1413 82 jeremybenn
     The default value is `memory_order=exact'.  Invalid memory
1414 19 jeremybenn
     orderings are ignored with a warning.
1415
 
1416
`calling_convention = 0|1'
1417 82 jeremybenn
     If 1 (true), programs follow OpenRISC calling conventions.  If 0
1418 19 jeremybenn
     (the default), they may use other convenitions.
1419
 
1420
`enable_bursts = 0 | 1'
1421 82 jeremybenn
     If 1 (true), bursts are detected.  If 0 (the default), bursts are
1422 19 jeremybenn
     not detected.
1423
 
1424
`no_multicycle = 0 | 1'
1425 82 jeremybenn
     If 1 (true), no multicycle logic paths will be generated.  If 0
1426
     (the default), multicycle logic paths will be generated.
1427 19 jeremybenn
 
1428
`timings_file = "FILENAME"'
1429 82 jeremybenn
     FILENAME specifies a file containing timing information.  The
1430
     default value is `"virtex.tim"'.  For backwards compatibility, the
1431 19 jeremybenn
     alternative name `timings_fn' is supported for this parameter, but
1432
     deprecated.
1433
 
1434
 
1435

1436
File: or1ksim.info,  Node: Core OpenRISC Configuration,  Next: Peripheral Configuration,  Prev: Simulator Configuration,  Up: Configuration
1437
 
1438
3.3 Configuring the OpenRISC Architectural Components
1439
=====================================================
1440
 
1441
* Menu:
1442
 
1443
* CPU Configuration::
1444
* Memory Configuration::
1445
* Memory Management Configuration::
1446
* Cache Configuration::
1447
* Interrupt Configuration::
1448
* Power Management Configuration::
1449
* Branch Prediction Configuration::
1450
* Debug Interface Configuration::
1451
 
1452

1453
File: or1ksim.info,  Node: CPU Configuration,  Next: Memory Configuration,  Up: Core OpenRISC Configuration
1454
 
1455
3.3.1 CPU Configuration
1456
-----------------------
1457
 
1458 82 jeremybenn
CPU configuration is described in `section cpu'.  This section should
1459
appear only once.  At present Or1ksim does not model multi-CPU systems.
1460 19 jeremybenn
The following parameters may be specified.
1461
 
1462
`ver = VALUE'
1463
 
1464
`cfg = VALUE'
1465
 
1466
`rev = VALUE'
1467
     The values are used to form the corresponding fields in the `VR'
1468 82 jeremybenn
     Special Purpose Register (SPR 0).  Default values 0.  A warning is
1469 19 jeremybenn
     given and the value truncated if it is too large (8 bits for `ver'
1470
     and `cfg', 6 bits for `rev').
1471
 
1472
`upr = VALUE'
1473
     Used as the value of the Unit Present Register (UPR) Special
1474 82 jeremybenn
     Purpose Register (SPR 1) to VALUE.  Default value is 0x0000075f,
1475 19 jeremybenn
     i.e.
1476
        * UPR present (0x00000001)
1477
 
1478
        * Data cache present (0x00000002)
1479
 
1480
        * Instruction cache present (0x00000004)
1481
 
1482
        * Data MMY present (0x00000008)
1483
 
1484
        * Instruction MMU present (0x00000010)
1485
 
1486
        * Debug unit present (0x00000040)
1487
 
1488
        * Power management unit present (0x00000100)
1489
 
1490
        * Programmable interrupt controller present (0x00000200)
1491
 
1492
        * Tick timer present (0x00000400)
1493
 
1494
     However, with the exection of the UPR present (0x00000001) and tick
1495
     timer present, the various fields will be modified with the values
1496
     specified in their corresponding configuration sections.
1497
 
1498
`cfgr = VALUE'
1499
     Sets the CPU configuration register (Special Purpose Register 2) to
1500 82 jeremybenn
     VALUE.  Default value is 0x00000020, i.e.  support for the ORBIS32
1501
     instruction set.  Attempts to set any other value are accepted, but
1502 19 jeremybenn
     issue a warning that there is no support for the instruction set.
1503
 
1504
`sr = VALUE'
1505
     Sets the supervision register Special Purpose Register (SPR 0x11)
1506 82 jeremybenn
     to VALUE.  Default value is 0x00008001, i.e.  start in supervision
1507 19 jeremybenn
     mode (0x00000001) and set the "Fixed One" bit (0x00008000).
1508
 
1509 98 jeremybenn
          Note: This is particularly useful when an image is held in
1510
          Flash at high memory (0xf0000000).  The EPH  bit can be set,
1511
          so that interrupt vectors are basedf at 0xf0000000, rather
1512
          than 0x0.
1513
 
1514 19 jeremybenn
`superscalar = 0|1'
1515 82 jeremybenn
     If 1, the processor operates in superscalar mode.  Default value is
1516 19 jeremybenn
     0.
1517
 
1518
     In the current simulator, the only functional effect of superscalar
1519
     mode is to affect the calculation of the number of cycles taken to
1520
     execute an instruction.
1521
 
1522
          Caution: The code for this does not appear to be complete or
1523
          well tested, so users are advised not to use this option.
1524
 
1525
`hazards = 0|1'
1526 82 jeremybenn
     If 1, data hazards are tracked in a superscalar CPU.  Default
1527
     value is 0.
1528 19 jeremybenn
 
1529
     In the current simulator, the only functional effect is to cause
1530
     logging of hazard waiting information if the CPU is superscalar.
1531
     However nowhere in the simulator is this data actually computed,
1532
     so the net result is probably to have no effect.
1533
 
1534
     if harzards are tracked, current hazards can be displayed using the
1535
     simulator's `r' command.
1536
 
1537
          Caution: The code for this does not appear to be complete or
1538
          well tested, so users are advised not to use this option.
1539
 
1540
`dependstats = 0|1'
1541 82 jeremybenn
     If 1, inter-instruction dependencies are calculated.  Default
1542
     value 0.
1543 19 jeremybenn
 
1544
     If these values are calculated, the depencies can be displayed
1545
     using the simulator's `stat' command.
1546
 
1547
          Note: This field must be enabled, if execution execution flow
1548
          tracking (field `history') has been requested in the simulator
1549
          configuration section (*note Simulator Behavior: Simulator
1550
          Behavior.).
1551
 
1552
`sbuf_len = VALUE'
1553
     The length of the store buffer is set to VALUE, which must be no
1554 82 jeremybenn
     greater than 256.  Larger values will be truncated to 256 with a
1555
     warning.  Negative values will be treated as 0 with a warning.
1556
     Use 0 to disable the store buffer.
1557 19 jeremybenn
 
1558
     When the store buffer is active, stores are accumulated and
1559
     committed when I/O is idle.
1560
 
1561 100 julius
`hardfloat = 0|1'
1562 346 jeremybenn
     If 1, hardfloat instructions are enabled.  Default value 0.
1563 19 jeremybenn
 
1564 104 jeremybenn
 
1565 19 jeremybenn

1566
File: or1ksim.info,  Node: Memory Configuration,  Next: Memory Management Configuration,  Prev: CPU Configuration,  Up: Core OpenRISC Configuration
1567
 
1568
3.3.2 Memory Configuration
1569
--------------------------
1570
 
1571 82 jeremybenn
Memory configuration is described in `section memory'.  This section
1572 98 jeremybenn
may appear multiple times, specifying multiple blocks of memory.
1573 19 jeremybenn
 
1574 98 jeremybenn
     Caution: The user may choose whether or not to enable a memory
1575 385 jeremybenn
     controller.  If a memory controller is enabled, then appropriate
1576
     initalization code must be provided.  The section describing
1577
     memory controller configuration describes the steps necessary for
1578
     using smaller or larger memory sections (*note Memory Controller
1579
     Configuration: Memory Controller Configuration.).
1580 98 jeremybenn
 
1581 385 jeremybenn
     The "uClibc" startup code initalizes a memory controller, assumed
1582
     to be mapped at 0x93000000.  If a memory controller is _not_
1583
     enabled, then the standard C library code will generate memory
1584
     access errors.  The solution is to declare an additional writable
1585
     memory block, mimicing the memory controller's register bank as
1586
     follows.
1587 98 jeremybenn
 
1588
          section memory
1589
            pattern = 0x00
1590
            type = unknown
1591
            name = "MC shadow"
1592
            baseaddr = 0x93000000
1593
            size     = 0x00000080
1594
            delayr = 2
1595
            delayw = 4
1596
          end
1597
 
1598
 
1599
The following parameters may be specified.
1600
 
1601 418 julius
`type=random|pattern|unknown|zero|exitnops'
1602 82 jeremybenn
     Specifies the values to which memory should be initialized.  The
1603 19 jeremybenn
     default value is `unknown'.
1604
 
1605
    `random'
1606 82 jeremybenn
          Set the memory values to be a random value.  A seed for the
1607 19 jeremybenn
          random generator may be set using the `random_seed' field in
1608
          this section (see below), thus ensuring the same "random"
1609
          values are used each time.
1610
 
1611
    `pattern'
1612
          Set the memory values to be a pattern value, which is set
1613
          using the `pattern' field in this section (see below).
1614
 
1615
    `unknown'
1616 82 jeremybenn
          The memory values are not initialized (i.e.  left "unknown").
1617 240 julius
          This option will yield faster initialization of the
1618 346 jeremybenn
          simulator.  This is the default.
1619 19 jeremybenn
 
1620
    `zero'
1621 82 jeremybenn
          Set the memory values to be 0.  This is the equivalent of
1622 19 jeremybenn
          `type=pattern' and a `pattern' value of 0, and implemented as
1623
          such.
1624
 
1625 420 jeremybenn
               Note: As a consequence, if the `pattern' field is
1626
               _subsequently_ specified in this section, the value in
1627
               that field will be used instead of zero to initialize
1628
               the memory.
1629
 
1630 418 julius
    `exitnops'
1631
          Set the memory values to be an instruction used to signal end
1632
          of simulation. This is useful for causing immediate end of
1633
          simulation when PC corruption occurs.
1634
 
1635 19 jeremybenn
 
1636
`random_seed = VALUE'
1637 82 jeremybenn
     Set the seed for the random number generator to VALUE.  This only
1638 19 jeremybenn
     has any effect for memory type `random'.
1639
 
1640
     The default value is -1, which means the seed will be set from a
1641
     call to the `time' function, thus ensuring different random values
1642 82 jeremybenn
     are used on each run.  The simulator prints out the seed used in
1643 19 jeremybenn
     this case, allowing repeat runs to regenerate the same random
1644
     values used in any particular run.
1645
 
1646
`pattern = VALUE'
1647 82 jeremybenn
     Set the pattern to be used when initializing memory to VALUE.  The
1648
     default value is 0.  This only has any effect for memory type
1649
     `pattern'.  The least significant 8 bits of this value is used to
1650
     initialize each byte.  More than 8 bits can be specified, but will
1651 19 jeremybenn
     ignored with a warning.
1652
 
1653
          Tip: The default value, is equivalent to setting the memory
1654 82 jeremybenn
          `type' to be `zero'.  If that is what is intended, then using
1655 19 jeremybenn
          `type=zero' explicitly is better than using `type=pattern'
1656
          and not specifying a value for `pattern'.
1657
 
1658
`baseaddr = VALUE'
1659 82 jeremybenn
     Set the base address of the memory to VALUE.  It should be aligned
1660 19 jeremybenn
     to a multiple of the memory size rounded up to the nearest 2^n.
1661
     The default value is 0.
1662
 
1663
`size = VALUE'
1664 82 jeremybenn
     Set the size of the memory block to be VALUE bytes.  This should
1665
     be a multiple of 4 (i.e.  word aligned).  The default value is
1666
     1024.
1667 19 jeremybenn
 
1668
          Note: When allocating memory, the simulator will allocate the
1669
          nearest 2^n bytes greater than or equal to VALUE, and will not
1670
          notice memory misses in any part of the memory between VALUE
1671
          and the amount allocated.
1672
 
1673
          As a consequence users are strongly recommended to specify
1674 82 jeremybenn
          memory sizes that are an exact power of 2.  If some other
1675 19 jeremybenn
          amount of memory is required, it should be specified as
1676
          separate, contiguous blocks, each of which is a power of 2 in
1677
          size.
1678
 
1679
`name = "TEXT"'
1680 82 jeremybenn
     Name the block.  Typically these describe the type of memory being
1681
     modeled (thus `"SRAM"' or `"Flash"'.  The default is
1682 19 jeremybenn
     `"anonymous memory block"'.
1683
 
1684
          Note: It is not clear that this information is currently ever
1685 82 jeremybenn
          used in normal operation of the simulator.  Even the `info'
1686 19 jeremybenn
          command of the simulator ignores it.
1687
 
1688
`ce = VALUE'
1689 82 jeremybenn
     Set the chip enable index of the memory instance.  Each memory
1690 19 jeremybenn
     instance should have a unique chip enable index, which should be
1691 82 jeremybenn
     greater than or equal to zero.  This is used by the memory
1692 19 jeremybenn
     controller when identifying different memory instances.
1693
 
1694 346 jeremybenn
     There is no requirement to set `ce' if a memory controller is not
1695
     enabled.  The default value is -1 (invalid).
1696 19 jeremybenn
 
1697
`mc = VALUE'
1698 82 jeremybenn
     Specifies the memory controller this memory is connected to.  It
1699 19 jeremybenn
     should correspond to the `index' field specified in a `section mc'
1700
     for a memory controller (*note Memory Controller Configuration:
1701
     Memory Controller Configuration.).
1702
 
1703 346 jeremybenn
     There is no requirement to set `mc' if a memory controller is not
1704
     enabled.  Default value is 0, which is also the default value of a
1705 98 jeremybenn
     memory controller `index' field.  This is suitable therefore for
1706
     designs with just one memory controller.
1707 19 jeremybenn
 
1708
`delayr = VALUE'
1709 82 jeremybenn
     The number of cycles required for a read access.  Set to -1 if the
1710
     memory does not support reading.  Default value 1.  The simulator
1711 19 jeremybenn
     will add this number of cycles to the total instruction cycle
1712
     count when reading from main memory.
1713
 
1714
`delayw = VALUE'
1715 82 jeremybenn
     The number of cycles required for a write access.  Set to -1 if the
1716
     memory does not support writing.  Default value 1.  The simulator
1717 19 jeremybenn
     will add this number of cycles to the total instruction cycle
1718
     count when writing to main memory.
1719
 
1720
`log = "FILE"'
1721
     If specified, `file' names a file for all memory accesses to be
1722 82 jeremybenn
     logged.  If not specified, the default value, NULL is used, meaning
1723 19 jeremybenn
     that the memory is not logged.
1724
 
1725
 
1726

1727
File: or1ksim.info,  Node: Memory Management Configuration,  Next: Cache Configuration,  Prev: Memory Configuration,  Up: Core OpenRISC Configuration
1728
 
1729
3.3.3 Memory Management Configuration
1730
-------------------------------------
1731
 
1732
Memory Management Unit (MMU) configuration is described in `section
1733
dmmu' (for the data MMU) and `section immu' (for the instruction MMU).
1734 82 jeremybenn
Each section should appear at most once.  The following parameters may
1735 19 jeremybenn
be specified.
1736
 
1737
`enabled = 0|1'
1738
     If 1 (true), the data or instruction (as appropriate) MMU is
1739 82 jeremybenn
     enabled.  If 0 (the default), it is disabled.
1740 19 jeremybenn
 
1741
`nsets = VALUE'
1742
     Sets the number of data or instruction (as appropriate) TLB sets to
1743 82 jeremybenn
     VALUE, which must be a power of two, not exceeding 128.  Values
1744
     which do not fit these criteria are ignored with a warning.  The
1745 19 jeremybenn
     default value is 1.
1746
 
1747
`nways = VALUE'
1748
     Sets the number of data or instruction (as appropriate) TLB ways to
1749 82 jeremybenn
     VALUE.  The value must be in the range 1 to 4.  Values outside
1750
     this range are ignored with a warning.  The default value is 1.
1751 19 jeremybenn
 
1752
`pagesize = VALUE'
1753
     The data or instruction (as appropriate) MMU page size is set to
1754 82 jeremybenn
     VALUE, which must be a power of 2.  Values which are not a power
1755
     of 2 are ignored with a warning.  The default is 8192 (0x2000).
1756 19 jeremybenn
 
1757
`entrysize = VALUE'
1758
     The data or instruction (as appropriate) MMU entry size is set to
1759 82 jeremybenn
     VALUE, which must be a power of 2.  Values which are not a power
1760
     of 2 are ignored with a warning.  The default value is 1.
1761 19 jeremybenn
 
1762
          Note: Or1ksim does not appear to use the `entrysize' parameter
1763 82 jeremybenn
          in its simulation of the MMUs.  Thus setting this value does
1764 19 jeremybenn
          not seem to matter.
1765
 
1766
`ustates = VALUE'
1767
     The number of instruction usage states for the data or instruction
1768
     (as appropriate) MMU is set to VALUE, which must be 2, 3 or 4.
1769 82 jeremybenn
     Values outside this range are ignored with a warning.  The default
1770 19 jeremybenn
     value is 2.
1771
 
1772
          Note: Or1ksim does not appear to use the `ustates' parameter
1773 82 jeremybenn
          in its simulation of the MMUs.  Thus setting this value does
1774 19 jeremybenn
          not seem to matter.
1775
 
1776
`hitdelay = VALUE'
1777
     Set the number of cycles a data or instruction (as appropriate) MMU
1778 82 jeremybenn
     hit costs.  Default value 1.
1779 19 jeremybenn
 
1780
`missdelay = VALUE'
1781
     Set the number of cycles a data or instruction (as appropriate) MMU
1782 82 jeremybenn
     miss costs.  Default value 1.
1783 19 jeremybenn
 
1784
 
1785

1786
File: or1ksim.info,  Node: Cache Configuration,  Next: Interrupt Configuration,  Prev: Memory Management Configuration,  Up: Core OpenRISC Configuration
1787
 
1788
3.3.4 Cache Configuration
1789
-------------------------
1790
 
1791
Cache configuration is described in `section dc' (for the data cache)
1792 82 jeremybenn
and `seciton ic' (for the instruction cache).  Each section should
1793
appear at most once.  The following parameters may be specified.
1794 19 jeremybenn
 
1795
`enabled = 0|1'
1796
     If 1 (true), the data or instruction (as appropriate) cache is
1797 82 jeremybenn
     enabled.  If 0 (the default), it is disabled.
1798 19 jeremybenn
 
1799
`nsets = VALUE'
1800
     Sets the number of data or instruction (as appropriate) cache sets
1801
     to VALUE, which must be a power of two, not exceeding
1802
     `MAX_DC_SETS' (for the data cache) or `MAX_IC_SETS' (for the
1803 82 jeremybenn
     instruction cache).  At the time of writing, these constants are
1804
     both defined in the code to be 1024).  The default value is 1.
1805 19 jeremybenn
 
1806
`nways = VALUE'
1807
     Sets the number of data or instruction (as appropriate) cache ways
1808
     to VALUE, which must be a power of two, not exceeding
1809
     `MAX_DC_WAYS' (for the data cache) or `MAX_IC_WAYS' (for the
1810 82 jeremybenn
     instruction cache).  At the time of writing, these constants are
1811
     both defined in the code to be 32).  The default value is 1.
1812 19 jeremybenn
 
1813
`blocksize = VALUE'
1814
     The data or instruction (as appropriate) cache block size is set to
1815 82 jeremybenn
     VALUE bytes, which must be either 16 or 32.  The default is 16.
1816 19 jeremybenn
 
1817
`ustates = VALUE'
1818
     The number of instruction usage states for the data or instruction
1819
     (as appropriate) cache is set to VALUE, which must be 2, 3 or 4.
1820
     The default value is 2.
1821
 
1822
`hitdelay = VALUE'
1823 82 jeremybenn
     _Instruction cache only_.  Set the number of cycles an instruction
1824
     cache hit costs.  Default value 1.
1825 19 jeremybenn
 
1826
`missdelay = VALUE'
1827 82 jeremybenn
     _Instruction cache only_.  Set the number of cycles an instruction
1828
     cache miss costs.  Default value 1.
1829 19 jeremybenn
 
1830
`load_hitdelay = VALUE'
1831 82 jeremybenn
     _Data cache only_.  Set the number of cycles a data load cache hit
1832
     costs.  Default value 2.
1833 19 jeremybenn
 
1834
`load_missdelay = VALUE'
1835 82 jeremybenn
     _Data cache only_.  Set the number of cycles a data load cache
1836
     miss costs.  Default value 2.
1837 19 jeremybenn
 
1838
`store_hitdelay = VALUE'
1839 82 jeremybenn
     _Data cache only_.  Set the number of cycles a data store cache hit
1840
     costs.  Default value 0.
1841 19 jeremybenn
 
1842
`store_missdelay = VALUE'
1843 82 jeremybenn
     _Data cache only_.  Set the number of cycles a data store cache
1844
     miss costs.  Default value 0.
1845 19 jeremybenn
 
1846
 
1847

1848
File: or1ksim.info,  Node: Interrupt Configuration,  Next: Power Management Configuration,  Prev: Cache Configuration,  Up: Core OpenRISC Configuration
1849
 
1850
3.3.5 Interrupt Configuration
1851
-----------------------------
1852
 
1853
Programmable Interrupt Controller (PIC) configuration is described in
1854 82 jeremybenn
`section pic'.  This section may appear at most once--Or1ksim has no
1855
mechanism for handling multiple interrupt controllers.  The following
1856 19 jeremybenn
parameters may be specified.
1857
 
1858
`enabled = 0|1'
1859 82 jeremybenn
     If 1 (true), the programmable interrupt controller is enabled.  If
1860
 
1861 19 jeremybenn
 
1862
`edge_trigger = 0|1'
1863
     If 1 (true, the default), the programmable interrupt controller is
1864 82 jeremybenn
     edge triggered.  If 0 (false), it is level triggered.
1865 19 jeremybenn
 
1866 432 jeremybenn
     The library interface (*note Simulator Library: Simulator Library.)
1867
     provides different functions for setting the different types of
1868
     interrupt, and a function to clear level sensitive interrupts. Edge
1869
     sensitive interrupts must be cleared by clearing the corresponding
1870
     bit in the PICSR SPR.
1871 19 jeremybenn
 
1872 432 jeremybenn
     Internal functions to set and clear interrupts are also provided
1873
     for peripherals implemented within Or1ksim. *Note Interrupts
1874
     Internal: Interrupts Internal for more details.
1875 430 julius
 
1876 432 jeremybenn
`use_nmi = 0|1'
1877
     If 1 (true, the default), interrupt lines 0 and 1 are
1878
     non-maskable. In other words the least significant 2 bits of the
1879
     PICMR SPR are hard-wired to 1.  If 0 (false), all interrupt lines
1880
     are treated as equivalent.
1881 430 julius
 
1882 432 jeremybenn
          Note: These are not non-maskable in the true sense that they
1883
          will pre-empt other interrupts.  Rather they can never be
1884
          masked out using the PICMR register. It is up the interrupt
1885
          exception handler to give these interrupt lines priority, and
1886
          indeed to decide on the priority order in general.
1887 430 julius
 
1888 432 jeremybenn
 
1889 19 jeremybenn

1890
File: or1ksim.info,  Node: Power Management Configuration,  Next: Branch Prediction Configuration,  Prev: Interrupt Configuration,  Up: Core OpenRISC Configuration
1891
 
1892
3.3.6 Power Management Configuration
1893
------------------------------------
1894
 
1895 82 jeremybenn
Power management implementation is incomplete.  At present the effect
1896 19 jeremybenn
(which only happens when the power management unit is enabled) of
1897
setting the different bits in the power management Special Purpose
1898
Register (PMR, SPR 0x4000) is
1899
 
1900
`SDF (bit mask 0x0000000f)'
1901
     No effect - these bits are ignored
1902
 
1903
`DME (bit mask 0x00000010)'
1904
`SME (bit mask 0x00000020)'
1905
     Both these bits cause the processor to stop executing
1906 82 jeremybenn
     instructions.  However all other functions (debug interaction, CLI,
1907 19 jeremybenn
     VAPI etc) carry on as normal.
1908
 
1909
`DCGE (bit mask 0x00000004)'
1910
     No effect - this bit is ignored
1911
 
1912
`SUME (bit mask 0x00000008)'
1913
     Enabling this bit causes a message to be printed, advising that the
1914
     processor is suspending and the simulator exits.
1915
 
1916
 
1917
On reset all bits are cleared.
1918
 
1919 82 jeremybenn
Power management configuration is described in `section pm'.  This
1920
section may appear at most once.  The following parameter may be
1921 19 jeremybenn
specified.
1922
 
1923
`enabled = 0|1'
1924 82 jeremybenn
     If 1 (true), power management is enabled.  If 0 (the default), it
1925
     is disabled.
1926 19 jeremybenn
 
1927
 
1928

1929
File: or1ksim.info,  Node: Branch Prediction Configuration,  Next: Debug Interface Configuration,  Prev: Power Management Configuration,  Up: Core OpenRISC Configuration
1930
 
1931
3.3.7 Branch Prediction Configuration
1932
-------------------------------------
1933
 
1934
From examining the code base, it seems the branch prediction function
1935 82 jeremybenn
is not fully implemented.  At present the functionality seems
1936
restricted to collection of statistics.
1937 19 jeremybenn
 
1938 82 jeremybenn
Branch prediction configuration is described in `section bpb'.  This
1939
section may appear at most once.  The following parameters may be
1940 19 jeremybenn
specified.
1941
 
1942
`enabled = 0|1'
1943 82 jeremybenn
     If 1 (true), branch prediction is enabled.  If 0 (the default), it
1944 19 jeremybenn
     is disabled.
1945
 
1946
`btic = 0|1'
1947
     If 1 (true), the branch target instruction cache model is enabled.
1948
     If 0 (the default), it is disabled.
1949
 
1950
`sbp_bf_fwd = 0|1'
1951 82 jeremybenn
     If 1 (true), use forward prediction for the `l.bf' instruction.  If
1952 19 jeremybenn
 
1953
     instruction.
1954
 
1955
`sbp_bnf_fwd = 0|1'
1956 82 jeremybenn
     If 1 (true), use forward prediction for the `l.bnf' instruction.
1957
     If 0 (the default), do not use forward prediction for this
1958 19 jeremybenn
     instruction.
1959
 
1960
`hitdelay = VALUE'
1961 82 jeremybenn
     Set the number of cycles a branch prediction hit costs.  Default
1962 19 jeremybenn
     value 0.
1963
 
1964
`missdelay = VALUE'
1965 82 jeremybenn
     Set the number of cycles a branch prediction miss costs.  Default
1966 19 jeremybenn
     value 0.
1967
 
1968
 
1969

1970
File: or1ksim.info,  Node: Debug Interface Configuration,  Prev: Branch Prediction Configuration,  Up: Core OpenRISC Configuration
1971
 
1972
3.3.8 Debug Interface Configuration
1973
-----------------------------------
1974
 
1975
The debug unit and debug interface configuration is described in
1976 82 jeremybenn
`section debug'.  This section may appear at most once.  The following
1977 19 jeremybenn
parameters may be specified.
1978
 
1979
`enabled = 0|1'
1980 82 jeremybenn
     If 1 (true), the debug unit is enabled.  If 0 (the default), it is
1981 19 jeremybenn
     disabled.
1982
 
1983
          Note: This enables the functionality of the debug unit (its
1984 82 jeremybenn
          registers etc) within the mode.  It does not provide any
1985
          external interface to the debug unit.  For that, see
1986 235 jeremybenn
          `rsp_enabled' below.
1987 19 jeremybenn
 
1988
`rsp_enabled = 0|1'
1989
     If 1 (true), the GDB "Remote Serial Protocol" server is started,
1990
     provding an interface to an external GNU debugger, using the port
1991
     specified in the `rsp_port' field (see below), or the
1992 82 jeremybenn
     `or1ksim-rsp' TCP/IP service.  If 0 (the default), the server is
1993 19 jeremybenn
     not started, and no external interface is provided.
1994
 
1995
     For more detailed information on the interface to the GNU Debugger
1996
     see Embecosm Application Note 2, `Howto: Porting the GNU Debugger
1997
     Practical Experience with the OpenRISC 1000 Architecture', by
1998
     Jeremy Bennett, published by Embecosm Limited (`www.embecosm.com').
1999
 
2000
`rsp_port = VALUE'
2001
     VALUE specifies the port to be used for the GDB "Remote Serial
2002 82 jeremybenn
     Protocol" interface to the GNU Debugger (GDB).  Default value
2003
     51000.  If the value 0 is specified, Or1ksim will instead look for
2004 19 jeremybenn
     a TCP/IP service named `or1ksim-rsp'.
2005
 
2006
          Tip: There is no registered port for Or1ksim "Remote Serial
2007 82 jeremybenn
          Protocol" service `or1ksim-rsp'.  Good practice suggests
2008
          users should adopt port values in the "Dynamic" or "Private"
2009
          port range, i.e.  49152-65535.
2010 19 jeremybenn
 
2011
`vapi_id = VALUE'
2012
     VALUE specifies the value of the Verification API (VAPI) base
2013 82 jeremybenn
     address to be used with the debug unit.  *Note Verification API:
2014 19 jeremybenn
     Verification API, for more details.
2015
 
2016
     If this is specified and VALUE is non-zero, all OpenRISC Remote
2017
     JTAG protocol transactions will be logged to the VAPI log file, if
2018 82 jeremybenn
     enabled.  This is the only functionality associated with VAPI for
2019
     the debug unit.  No VAPI commands are sent, nor requests handled.
2020 19 jeremybenn
 
2021
 
2022

2023
File: or1ksim.info,  Node: Peripheral Configuration,  Prev: Core OpenRISC Configuration,  Up: Configuration
2024
 
2025
3.4 Configuring Memory Mapped Peripherals
2026
=========================================
2027
 
2028 82 jeremybenn
All peripheral components are optional.  If they are specified, then
2029 19 jeremybenn
(unlike other components) by default they are enabled.
2030
 
2031
* Menu:
2032
 
2033
* Memory Controller Configuration::
2034
* UART Configuration::
2035
* DMA Configuration::
2036
* Ethernet Configuration::
2037
* GPIO Configuration::
2038
* Display Interface Configuration::
2039
* Frame Buffer Configuration::
2040
* Keyboard Configuration::
2041
* Disc Interface Configuration::
2042
* Generic Peripheral Configuration::
2043
 
2044

2045
File: or1ksim.info,  Node: Memory Controller Configuration,  Next: UART Configuration,  Up: Peripheral Configuration
2046
 
2047
3.4.1 Memory Controller Configuration
2048
-------------------------------------
2049
 
2050
The memory controller used in Or1ksim is the component implemented at
2051 98 jeremybenn
OpenCores, and found in the top level SVN directory, `mem_ctrl'.  It is
2052 19 jeremybenn
described in the document `Memory Controller IP Core' by Rudolf
2053 82 jeremybenn
Usselmann, which can be found in the `doc' subdirectory.  It is a
2054
memory mapped component, which resides on the main OpenRISC Wishbone
2055
data bus.
2056 19 jeremybenn
 
2057 82 jeremybenn
The memory controller configuration is described in `section mc'.  This
2058 19 jeremybenn
section may appear multiple times, specifying multiple memory
2059 98 jeremybenn
controllers.
2060 19 jeremybenn
 
2061 385 jeremybenn
     Warning: There are known to be problems with the current memory
2062
     controller, which currently is not included in the regression test
2063
     suite. Users are advised not to use the memory controller in the
2064
     current release.
2065 98 jeremybenn
 
2066 385 jeremybenn
     Caution: There is no initialization code in the standard "newlib"
2067
     library.
2068
 
2069
     The standard "uClibc" library assumes a memory controller mapped
2070
     at 0x93000000 and will initialize the memory controller to expect
2071
     64MB memory blocks, and any memory declarations _must_ reflect
2072
     this.
2073
 
2074 98 jeremybenn
     If smaller memory blocks are declared with a memory controller,
2075
     then sufficient memory will not be allocated by Or1ksim, but out of
2076 346 jeremybenn
     range memory accesses will not be trapped.  For example declaring a
2077 98 jeremybenn
     memory section from 0-4MB with a memory controller enabled would
2078
     mean that accesses between 4MB and 64MB would be permitted, but
2079
     having no allocated memory would likely cause a segmentation fault.
2080
 
2081
     If the user is determined to use smaller memories with the memory
2082
     controller, then custom initialization code must be provided, to
2083
     ensure the memory controller traps out-of-memory accesses.
2084
 
2085
The following parameters may be specified.
2086
 
2087 19 jeremybenn
`enabled = 0|1'
2088 82 jeremybenn
     If 1 (true, the default), this memory controller is enabled.  If
2089
     0, it is disabled.
2090 19 jeremybenn
 
2091
          Note: The memory controller can effectively also be disabled
2092
          by setting an appropriate power on control register value
2093 82 jeremybenn
          (see below).  However this should only be used if it is
2094 19 jeremybenn
          desired to specifically model this behavior of the memory
2095
          controller, not as a way of disabling the memory controller
2096
          in general.
2097
 
2098
`baseaddr = VALUE'
2099
     Set the base address of the memory controller's memory mapped
2100 82 jeremybenn
     registers to VALUE.  The default is 0, which is probably not a
2101 19 jeremybenn
     sensible value.
2102
 
2103
     The memory controller has a 7 bit address bus, with a total of 19
2104
     32-bit registers, at addresses 0x00 through 0x4c (address 0x0c and
2105
     addresses 0x50 through 0x7c are not used).
2106
 
2107
`poc = VALUE'
2108
     Specifies the value of the power on control register, The least
2109
     signficant two bits specify the bus width (use 0 for an 8-bit bus,
2110
     1 for a 16-bit bus and 2 for a 32-bit bus) and the next two bits
2111
     the type of memory connected (use 0 for a disabled interface, 1
2112
     for SSRAM, 2 for asyncrhonous devices and 3 for synchronous
2113
     devices).
2114
 
2115
     If other bits are specified, they are ignored with a warning.
2116
 
2117
          Caution: The default value, 0, corresponds to a disabled
2118
          8-bit bus, and is likely not the most suitable value
2119
 
2120
`index = VALUE'
2121
     Specify the index of this memory controller amongst all the memory
2122 82 jeremybenn
     controllers.  This value should be unique for each memory
2123 19 jeremybenn
     controller, and is used to associate specific memories with the
2124
     controller, through the `mc' field in the `section memory'
2125
     configuration (*note Memory Configuration: Memory Configuration.).
2126
 
2127
     The default value, 0, is suitable when there is only one memory
2128
     controller.
2129
 
2130
 
2131

2132
File: or1ksim.info,  Node: UART Configuration,  Next: DMA Configuration,  Prev: Memory Controller Configuration,  Up: Peripheral Configuration
2133
 
2134
3.4.2 UART Configuration
2135
------------------------
2136
 
2137
The UART implemented in Or1ksim follows the specification of the
2138 82 jeremybenn
National Semiconductor 16450 and 16550 parts.  It is a memory mapped
2139 19 jeremybenn
component, which resides on the main OpenRISC Wishbone data bus.
2140
 
2141
The component provides a number of interfaces to emulate the behavior
2142
of an external terminal connected to the UART.
2143
 
2144 82 jeremybenn
UART configuration is described in `section uart'.  This section may
2145
appear multiple times, specifying multiple UARTs.  The following
2146 19 jeremybenn
parameters may be specified.
2147
 
2148
`enabled = 0|1'
2149 82 jeremybenn
     If 1 (true, the default), this UART is enabled.  If 0, it is
2150 19 jeremybenn
     disabled.
2151
 
2152
`baseaddr = VALUE'
2153
     Set the base address of the UART's memory mapped registers to
2154 82 jeremybenn
     VALUE.  The default is 0, which is probably not a sensible value.
2155 19 jeremybenn
 
2156
     The UART has a 3 bit address bus, with a total of 8 8-bit
2157
     registers, at addresses 0x0 through 0x7.
2158
 
2159
`channel = "TYPE:ARGS"'
2160
     Specify the channel representing the terminal connected to the UART
2161
     Rx & Tx pins.
2162
 
2163
    `channel="file:`rxfile',`txfile'"'
2164
          Read input characters from the file `rxfile' and write output
2165
          characters to the file `txfile' (which will be created if
2166
          required).
2167
 
2168
    `channel="xterm:ARGS"'
2169
          Create an xterm on startup, write UART Tx traffic to the
2170
          xterm and take Rx traffic from the keyboard when the xterm
2171 82 jeremybenn
          window is selected.  Additional arguments to the xterm
2172
          command (for example specifying window size may be specified
2173
          in ARGS, or this may be left blank.
2174 19 jeremybenn
 
2175
    `channel="tcp:VALUE"'
2176
          Open the TCP/IP port specified by VALUE and read and write
2177
          UART traffic from and to it.
2178
 
2179
          Typically a telnet session is connected to the other end of
2180
          this port.
2181
 
2182
               Tip: There is no registered port for Or1ksim telnet UART
2183 82 jeremybenn
               connection.  Priviledged access is required to read
2184 19 jeremybenn
               traffic on the registered "well-known" telnet port (23).
2185 346 jeremybenn
               Instead users should use port values in the "Dynamic" or
2186
               "Private" port range, i.e.  49152-65535.
2187 19 jeremybenn
 
2188
    `channel="fd:`rxfd',`txfd'"'
2189
          Read and write characters from and to the existing open
2190
          numerical file descriptors, file `rxfd' and `txfd'.
2191
 
2192
    `channel="tty:device=/dev/ttyS0,baud=9600"'
2193
          Read and write characters from and to a physical serial port.
2194 346 jeremybenn
          The precise device (shown here as `/dev/ttyS0') may vary from
2195
          machine to machine.
2196 19 jeremybenn
 
2197
 
2198
     The default value for this field is `"xterm:"'.
2199
 
2200
`irq = VALUE'
2201 82 jeremybenn
     Use VALUE as the IRQ number of this UART.  Default value 0.
2202 19 jeremybenn
 
2203
`16550 = 0|1'
2204 82 jeremybenn
     If 1 (true), the UART has the functionality of a 16550.  If 0 (the
2205
     default), it has the functionality of a 16450.  The principal
2206 19 jeremybenn
     difference is that the 16550 can buffer multiple characters.
2207
 
2208
`jitter = VALUE'
2209
     Set the jitter, modeled as a time to block, to VALUE milliseconds.
2210 82 jeremybenn
     Set to -1 to disable jitter modeling.  Default value 0.
2211 19 jeremybenn
 
2212
          Note: This functionality has yet to be implemented, so this
2213
          parameter has no effect.
2214
 
2215
`vapi_id = VALUE'
2216
     VALUE specifies the value of the Verification API (VAPI) base
2217 82 jeremybenn
     address to be used with the UART.  *Note Verification API:
2218 19 jeremybenn
     Verification API, for more details, which details the use of the
2219
     VAPI with the UART.
2220
 
2221
 
2222

2223
File: or1ksim.info,  Node: DMA Configuration,  Next: Ethernet Configuration,  Prev: UART Configuration,  Up: Peripheral Configuration
2224
 
2225
3.4.3 DMA Configuration
2226
-----------------------
2227
 
2228
The DMA controller used in Or1ksim is the component implemented at
2229 98 jeremybenn
OpenCores, and found in the top level SVN directory, `wb_dma'.  It is
2230 19 jeremybenn
described in the document `Wishbone DMA/Bridge IP Core' by Rudolf
2231 82 jeremybenn
Usselmann, which can be found in the `doc' subdirectory.  It is a
2232
memory mapped component, which resides on the main OpenRISC Wishbone
2233
data bus.  The present implementation is incomplete, intended only to
2234
support the Ethernet interface (*note Ethernet Configuration::),
2235
although the Ethernet interface is not yet completed.
2236 19 jeremybenn
 
2237 82 jeremybenn
DMA configuration is described in `section dma'.  This section may
2238
appear multiple times, specifying multiple DMA controllers.  The
2239 19 jeremybenn
following parameters may be specified.
2240
 
2241
`enabled = 0|1'
2242 82 jeremybenn
     If 1 (true, the default), this DMA controller is enabled.  If 0,
2243
     it is disabled.
2244 19 jeremybenn
 
2245
`baseaddr = VALUE'
2246
     Set the base address of the DMA's memory mapped registers to
2247 82 jeremybenn
     VALUE.  The default is 0, which is probably not a sensible value.
2248 19 jeremybenn
 
2249
     The DMA controller has a 10 bit address bus, with a total of 253
2250 82 jeremybenn
     32-bit registers.  The first 5 registers at addresses 0x000 through
2251
     0x010 control the overall behavior of the DMA controller.  There
2252
     are then 31 blocks of 8 registers, controlling each of the 31 DMA
2253
     channels available.  Addresses 0x014 through 0x01c are not used.
2254 19 jeremybenn
 
2255
`irq = VALUE'
2256 82 jeremybenn
     Use VALUE as the IRQ number of this DMA controller.  Default value
2257 19 jeremybenn
     0.
2258
 
2259
`vapi_id = VALUE'
2260
     VALUE specifies the value of the Verification API (VAPI) base
2261 82 jeremybenn
     address to be used with the DMA controller.  *Note Verification
2262 19 jeremybenn
     API: Verification API, for more details, which details the use of
2263
     the VAPI with the DMA controller.
2264
 
2265
 
2266

2267
File: or1ksim.info,  Node: Ethernet Configuration,  Next: GPIO Configuration,  Prev: DMA Configuration,  Up: Peripheral Configuration
2268
 
2269
3.4.4 Ethernet Configuration
2270
----------------------------
2271
 
2272 82 jeremybenn
Ethernet configuration is described in `section ethernet'.  This
2273
section may appear multiple times, specifying multiple Ethernet
2274
interfaces.  The following parameters may be specified.
2275 19 jeremybenn
 
2276 440 jeremybenn
The Ethernet MAC used in Or1ksim corresponds to the Verilog
2277
implementation in project "ethmac". It's source code can be found in
2278
the top level SVN directory, `ethmac'.  It also forms part of the
2279
OpenRISC reference SoC, ORPSoC.  It is described in the document
2280
`Ethernet IP Core Specification' by Igor Mohor, which can be found in
2281
the `doc' subdirectory.  It is a memory mapped component, which resides
2282
on the main OpenRISC Wishbone data bus.
2283
 
2284 19 jeremybenn
`enabled = 0|1'
2285 82 jeremybenn
     If 1 (true, the default), this Ethernet MAC is enabled.  If 0, it
2286
     is disabled.
2287 19 jeremybenn
 
2288
`baseaddr = VALUE'
2289
     Set the base address of the MAC's memory mapped registers to
2290 82 jeremybenn
     VALUE.  The default is 0, which is probably not a sensible value.
2291 19 jeremybenn
 
2292
     The Ethernet MAC has a 7-bit address bus, with a total of 21
2293 82 jeremybenn
     32-bit registers.  Addresses 0x54 through 0x7c are not used.
2294 19 jeremybenn
 
2295
          Note: The Ethernet specification describes a Tx control
2296 82 jeremybenn
          register, `TXCTRL', at address 0x50.  However this register
2297
          is not implemented in the Or1ksim model.
2298 19 jeremybenn
 
2299
`dma = VALUE'
2300
     VALUE specifies the DMA controller with which this Ethernet is
2301 82 jeremybenn
     associated.  The default value is 0.
2302 19 jeremybenn
 
2303
          Note: Support for external DMA is not provided in the current
2304 82 jeremybenn
          implementation, and this value is ignored.  In any case there
2305 19 jeremybenn
          is no equivalent field to which this can be matched in the
2306
          current DMA component implementation (*note DMA
2307
          Configuration: DMA Configuration.).
2308
 
2309
`irq = VALUE'
2310 82 jeremybenn
     Use VALUE as the IRQ number of this Ethernet MAC.  Default value 0.
2311 19 jeremybenn
 
2312 440 jeremybenn
`rtx_type = "file"|"tap"'
2313
     Specifies whether to use a TUN/TAP interface or file interface
2314
     (the default) to model the external connection of the Ethernet.
2315 19 jeremybenn
 
2316 440 jeremybenn
     If a TUN/TAP interface is requested, Ethernet packets will be sent
2317
     and received through the pesistent TAP interface specified in
2318
     parameter `tap_dev' (see below).
2319 19 jeremybenn
 
2320 440 jeremybenn
     More details on configuring the TUN/TAP interface are given in the
2321
     Usage section (*note Ethernet TUN/TAP Interface: Ethernet TUN/TAP
2322
     Interface.).
2323 19 jeremybenn
 
2324 440 jeremybenn
     If a file interface (the default), is requested, the Ethernet will
2325
     be modelled by reading and writing from and to the files specified
2326
     in the `rxfile' and `txfile' parameters (see below).
2327
 
2328
          Caution: If a file interface is specified, Or1ksim will
2329
          terminate once the receive file specified by `rxfile' is
2330
          exhausted.
2331
 
2332 19 jeremybenn
`rx_channel = RXVALUE'
2333
`tx_channel = TXVALUE'
2334
     RXVALUE specifies the DMA channel to use for receive and TXVALUE
2335 82 jeremybenn
     the DMA channel to use for transmit.  Both default to 0.
2336 19 jeremybenn
 
2337
          Note: As noted above, support for external DMA is not
2338
          provided in the current implementation, and so these values
2339
          are ignored.
2340
 
2341
`rxfile = "RXFILE"'
2342
`txfile = "TXFILE"'
2343
     When `rtx_type' is 0 (see above), RXFILE specifies the file to use
2344
     as input and TXFILE specifies the fie to use as output.
2345
 
2346 82 jeremybenn
     The file contains a sequence of packets.  Each packet consists of a
2347
     packet length (32 bits), followed by that many bytes of data.
2348
     Once the input file is empty, the Ethernet MAC behaves as though
2349
     there were no data on the Ethernet.  The default values of these
2350 19 jeremybenn
     parameters are `"eth_rx"' and `"eth_tx"' respectively.
2351
 
2352 82 jeremybenn
     The input file must exist and be readable.  The output file must be
2353
     writable and will be created if necessary.  If either of these
2354 19 jeremybenn
     conditions is not met, a warning will be given.
2355
 
2356 440 jeremybenn
          Caution: Or1ksim will terminate once the RXFILE is exhausted.
2357 19 jeremybenn
 
2358 440 jeremybenn
`tap_dev = "TAP"'
2359
     When `rtx_type' is `"tap"' (see above), TAP_DEV specifies the TAP
2360
     device to use for communication.  This should be a persistent TAP
2361
     device configured for the system (*note Ethernet TUN/TAP
2362
     Interface: Ethernet TUN/TAP Interface.)
2363
 
2364 451 jeremybenn
`phy_addr = VALUE'
2365
     VALUE specifies the address for emulated ethernet PHY (default 0).
2366
     If there are multiple Ethernet peripherals, they should each have a
2367
     different PHY value.
2368
 
2369
`dummy_crc = 0|1'
2370
     If 1 (true, the default), the length of the data transferred to
2371
     the core will be increased by 4 bytes, as though the CRC were
2372
     included.
2373
 
2374
          Note: This is for historical consistency with the OpenRISC
2375
          Ethernet hardware MAC, which passes on the CRC in the data
2376
          packet. This is unusual behavior for a MAC, but the OpenRISC
2377
          Linux device drivers have been written to expect it.
2378
 
2379
`phy_addr = VALUE'
2380
     VALUE specifies the address for emulated ethernet PHY (default 0).
2381
     If there are multiple Ethernet peripherals, they should each have a
2382
     different PHY value.
2383
 
2384 19 jeremybenn
`vapi_id = VALUE'
2385
     VALUE specifies the value of the Verification API (VAPI) base
2386 82 jeremybenn
     address to be used with the Ethernet PHY.  *Note Verification API:
2387 19 jeremybenn
     Verification API, for more details, which details the use of the
2388
     VAPI with the DMA controller.
2389
 
2390
 
2391

2392
File: or1ksim.info,  Node: GPIO Configuration,  Next: Display Interface Configuration,  Prev: Ethernet Configuration,  Up: Peripheral Configuration
2393
 
2394
3.4.5 GPIO Configuration
2395
------------------------
2396
 
2397
The GPIO used in Or1ksim is the component implemented at OpenCores, and
2398 98 jeremybenn
found in the top level SVN directory, `gpio'.  It is described in the
2399 19 jeremybenn
document `GPIO IP Core Specification' by Damjan Lampret and Goran
2400 82 jeremybenn
Djakovic, which can be found in the `doc' subdirectory.  It is a memory
2401 19 jeremybenn
mapped component, which resides on the main OpenRISC Wishbone data bus.
2402
 
2403 82 jeremybenn
GPIO configuration is described in `section gpio'.  This section may
2404
appear multiple times, specifying multiple GPIO devices.  The following
2405 19 jeremybenn
parameters may be specified.
2406
 
2407
`enabled = 0|1'
2408 82 jeremybenn
     If 1 (true, the default), this GPIO is enabled.  If 0, it is
2409 19 jeremybenn
     disabled.
2410
 
2411
`baseaddr = VALUE'
2412
     Set the base address of the GPIO's memory mapped registers to
2413 82 jeremybenn
     VALUE.  The default is 0, which is probably not a sensible value.
2414 19 jeremybenn
 
2415
     The GPIO has a 6 bit address bus, with a total of 10 32-bit
2416
     registers, although the number of bits that are actively used
2417 82 jeremybenn
     varies.  Addresses 0x28 through 0x3c are not used.
2418 19 jeremybenn
 
2419
`irq = VALUE'
2420 82 jeremybenn
     Use VALUE as the IRQ number of this GPIO.  Default value 0.
2421 19 jeremybenn
 
2422
`vapi_id = VALUE'
2423
     VALUE specifies the value of the Verification API (VAPI) base
2424 82 jeremybenn
     address to be used with the GPIO.  *Note Verification API:
2425 19 jeremybenn
     Verification API, for more details, which details the use of the
2426 82 jeremybenn
     VAPI with the GPIO controller.  For backwards compatibility, the
2427 19 jeremybenn
     alternative name `base_vapi_id' is supported for this parameter,
2428
     but deprecated.
2429
 
2430
 
2431

2432
File: or1ksim.info,  Node: Display Interface Configuration,  Next: Frame Buffer Configuration,  Prev: GPIO Configuration,  Up: Peripheral Configuration
2433
 
2434
3.4.6 Display Interface Configuration
2435
-------------------------------------
2436
 
2437
Or1ksim models a VGA interface to an external monitor.  The VGA
2438
controller used in Or1ksim is the component implemented at OpenCores,
2439 98 jeremybenn
and found in the top level SVN directory, `vga_lcd', with no support
2440 82 jeremybenn
for the optional hardware cursors.  It is described in the document
2441 19 jeremybenn
`VGA/LCD Core v2.0 Specifications' by Richard Herveille, which can be
2442 82 jeremybenn
found in the `doc' subdirectory.  It is a memory mapped component,
2443
which resides on the main OpenRISC Wishbone data bus.
2444 19 jeremybenn
 
2445
The current implementation provides only functionality to dump the
2446
screen to a file at intervals.
2447
 
2448 82 jeremybenn
VGA controller configuration is described in `section vga'.  This
2449 19 jeremybenn
section may appear multiple times, specifying multiple VGA controllers.
2450
The following parameters may be specified.
2451
 
2452
`enabled = 0|1'
2453 82 jeremybenn
     If 1 (true, the default), this VGA is enabled.  If 0, it is
2454 19 jeremybenn
     disabled.
2455
 
2456
`baseaddr = VALUE'
2457
     Set the base address of the VGA controller's memory mapped
2458 82 jeremybenn
     registers to VALUE.  The default is 0, which is probably not a
2459 19 jeremybenn
     sensible value.
2460
 
2461
     The VGA controller has a 12-bit address bus, with 7 32-bit
2462
     registers, at addresses 0x000 through 0x018, and two color lookup
2463 82 jeremybenn
     tables at addresses 0x800 through 0xfff.  The hardware cursor
2464 19 jeremybenn
     registers are not implemented, so addresses 0x01c through 0x7fc
2465
     are not used.
2466
 
2467
`irq = VALUE'
2468 82 jeremybenn
     Use VALUE as the IRQ number of this VGA controller.  Default value
2469 19 jeremybenn
     0.
2470
 
2471
`refresh_rate = VALUE'
2472 82 jeremybenn
     VALUE specifies number of cycles between screen dumps.  Default
2473 19 jeremybenn
     value is derived from the simulation clock cycle time (*note
2474
     Simulator Behavior: Simulator Behavior.), to correspond to dumping
2475
     50 times per simulated second.
2476
 
2477
`txfile = "FILE"'
2478
     FILE specifies the base of the filename for screen dumps.
2479
     Successive screen dumps will be in BMP format, in files with the
2480
     name `FILENNNN.bmp', where NNNN is a sequential count of the
2481 82 jeremybenn
     screen dumps starting at zero.  The default value is `"vga_out"'.
2482 19 jeremybenn
     For backwards compatibility, the alternative name `filename' is
2483
     supported for this parameter, but deprecated.
2484
 
2485
 
2486

2487
File: or1ksim.info,  Node: Frame Buffer Configuration,  Next: Keyboard Configuration,  Prev: Display Interface Configuration,  Up: Peripheral Configuration
2488
 
2489
3.4.7 Frame Buffer Configuration
2490
--------------------------------
2491
 
2492 82 jeremybenn
     Caution: The frame buffer is only partially implemented.  Its
2493 19 jeremybenn
     configuration fields are described here, but the component should
2494 82 jeremybenn
     not be used at this time.  Like the VGA controller, it is designed
2495 19 jeremybenn
     to make screen dumps to file.
2496
 
2497 82 jeremybenn
Frame buffer configuration is described in `section fb'.  This section
2498
may appear multiple times, specifying multiple frame buffers.  The
2499 19 jeremybenn
following parameters may be specified.
2500
 
2501
`enabled = 0|1'
2502 82 jeremybenn
     If 1 (true, the default), this frame buffer is enabled.  If 0, it
2503 19 jeremybenn
     is disabled.
2504
 
2505
`baseaddr = VALUE'
2506
     Set the base address of the frame buffer's memory mapped registers
2507 82 jeremybenn
     to VALUE.  The default is 0, which is probably not a sensible
2508
     value.
2509 19 jeremybenn
 
2510
     The frame buffer has an 121-bit address bus, with 4 32-bit
2511
     registers, at addresses 0x000 through 0x00c, and a PAL lookup
2512 82 jeremybenn
     table at addresses 0x400 through 0x4ff.  Addresses 0x010 through
2513 19 jeremybenn
     0x3fc and addresses 0x500 through 0x7ff are not used.
2514
 
2515
`refresh_rate = VALUE'
2516 82 jeremybenn
     VALUE specifies number of cycles between screen dumps.  Default
2517 19 jeremybenn
     value is derived from the simulation clock cycle time (*note
2518
     Simulator Behavior: Simulator Behavior.), to correspond to dumping
2519
     50 times per simulated second.
2520
 
2521
`txfile = "FILE"'
2522
     FILE specifies the base of the filename for screen dumps.
2523
     Successive screen dumps will be in BMP format, in files with the
2524
     name `FILENNNN.bmp', where NNNN is a sequential count of the
2525 82 jeremybenn
     screen dumps starting at zero.  The default value is `"fb_out"'.
2526 19 jeremybenn
     For backwards compatibility, the alternative name `filename' is
2527
     supported for this parameter, but deprecated.
2528
 
2529
 
2530

2531
File: or1ksim.info,  Node: Keyboard Configuration,  Next: Disc Interface Configuration,  Prev: Frame Buffer Configuration,  Up: Peripheral Configuration
2532
 
2533
3.4.8 Keyboard Configuration (PS2)
2534
----------------------------------
2535
 
2536 82 jeremybenn
The PS2 interface provided by Or1ksim is not documented.  It may be
2537 98 jeremybenn
based on the PS2 project at OpenCores, and found in the top level SVN
2538 82 jeremybenn
directory, `ps2'.  However this project lacks any documentation beyond
2539
its project webpage.  Since most PS2 interfaces follow the Intel i8042
2540 19 jeremybenn
standard, this is presumably what is expected with this device.
2541
 
2542
The implementation only provides for keyboard support, which is
2543 82 jeremybenn
modelled as a file of keystrokes.  There is no mouse support.
2544 19 jeremybenn
 
2545
     Caution: A standard i8042 device has two registers at addresses
2546 82 jeremybenn
     0x60 (command) and 0x64 (status).  Inspection of the code,
2547
     suggests that the Or1ksim component places these registers at
2548
     addresses 0x00 and 0x04.
2549 19 jeremybenn
 
2550
     The port of Linux for the OpenRISC 1000, which runs on Or1ksim
2551
     implements the i8042 device driver, anticipating these registers
2552 82 jeremybenn
     reside at their conventional address.  It seems unlikel that this
2553 19 jeremybenn
     code will work.
2554
 
2555
     This component should be used with caution.
2556
 
2557 82 jeremybenn
Keyboard configuration is described in `section kbd'.  This section may
2558
appear multiple times, specifying multiple keyboard interfaces.  The
2559 19 jeremybenn
following parameters may be specified.
2560
 
2561
`enabled = 0|1'
2562 82 jeremybenn
     If 1 (true, the default), this keyboard is enabled.  If 0, it is
2563 19 jeremybenn
     disabled.
2564
 
2565
`baseaddr = VALUE'
2566
     Set the base address of the keyboard's memory mapped registers to
2567 82 jeremybenn
     VALUE.  The default is 0, which is probably not a sensible value.
2568 19 jeremybenn
 
2569
     The keyboard PS/2 interface has an 3-bit address bus, with 2 8-bit
2570
     registers, at addresses 0x000 and 0x004.
2571
 
2572
          Caution: As noted above, a standard Intel 8042 interface
2573
          would expect to find these registers at locations 0x60 and
2574
          0x64, thus requiring at least a 7-bit bus.
2575
 
2576
`irq = VALUE'
2577 82 jeremybenn
     Use VALUE as the IRQ number of this Keyboard interface.  Default
2578 19 jeremybenn
     value 0.
2579
 
2580
`rxfile = "FILE"'
2581
     `file' specifies a file containing raw key stroke data, which
2582 82 jeremybenn
     models the input from a physical keyboard.  The default value is
2583 19 jeremybenn
     `"kbd_in"'.
2584
 
2585
 
2586

2587
File: or1ksim.info,  Node: Disc Interface Configuration,  Next: Generic Peripheral Configuration,  Prev: Keyboard Configuration,  Up: Peripheral Configuration
2588
 
2589
3.4.9 Disc Interface Configuration
2590
----------------------------------
2591
 
2592
The ATA/ATAPI disc controller used in Or1ksim is the OCIDEC (OpenCores
2593
IDE Controller) component implemented at OpenCores, and found in the
2594 98 jeremybenn
top level SVN directory, `ata'.  It is described in the document
2595 19 jeremybenn
`ATA/ATAPI-5 Core Specification' by Richard Herveille, which can be
2596 82 jeremybenn
found in the `doc' subdirectory.  It is a memory mapped component,
2597
which resides on the main OpenRISC Wishbone data bus.
2598 19 jeremybenn
 
2599 385 jeremybenn
     Warning: In the current release of Or1ksim, parsing of the ATA
2600
     section is broken. Users should not configure the disc interface
2601
     in this release.
2602
 
2603 82 jeremybenn
ATA/ATAPI configuration is described in `section ata'.  This section
2604
may appear multiple times, specifying multiple disc controllers.  The
2605 19 jeremybenn
following parameters may be specified.
2606
 
2607
`enabled = 0|1'
2608 82 jeremybenn
     If 1 (true, the default), this ATA/ATAPI interface is enabled.  If
2609 19 jeremybenn
     0, it is disabled.
2610
 
2611
`baseaddr = VALUE'
2612
     Set the base address of the ATA/ATAPI interface's memory mapped
2613 82 jeremybenn
     registers to VALUE.  The default is 0, which is probably not a
2614 19 jeremybenn
     sensible value.
2615
 
2616
     The ATA/ATAPI PS/2 interface has an 5-bit address bus, with 8
2617 82 jeremybenn
     32-bit registers.  Depending on the version of the OCIDEC
2618
     ATA/ATAPI interface selected (see `dev_id' below), not all
2619
     registers will be available.
2620 19 jeremybenn
 
2621
`irq = VALUE'
2622 82 jeremybenn
     Use VALUE as the IRQ number of this ATA/ATAPI interface.  Default
2623 19 jeremybenn
     value 0.
2624
 
2625
`dev_id = 1|2|3'
2626
     This parameter specifies which version of the OCIDEC ATA/ATAPI
2627 82 jeremybenn
     interface to model.  The default value is 1.
2628 19 jeremybenn
 
2629
     Version 1 supports only the `CTRL', `STAT' and `PCTR' registers.
2630
     Versions 2 & 3 add the `FCTR' registers, Version 3 adds the `DTR'
2631
     registers and the `RXD'/`TXD' registers.
2632
 
2633
`rev = VALUE'
2634
     Set the VALUE as the revision of the OCIDEC ATA/ATAPI interface.
2635 82 jeremybenn
     The default value is 1.  The default value is 0.  Its value should
2636
     be in the range 0-15.  Larger values are truncated with a warning.
2637 346 jeremybenn
     This only affects the reset value of the `STAT' register, where it
2638
     forms bits 24-27.
2639 19 jeremybenn
 
2640
`pio_mode0_t1 = VALUE'
2641
`pio_mode0_t2 = VALUE'
2642
`pio_mode0_t4 = VALUE'
2643
`pio_mode0_teoc = VALUE'
2644
     These parameters specify the timings for use with Programmed
2645 82 jeremybenn
     Input/Output (PIO) transfers.  They are specified as the number of
2646 19 jeremybenn
     clock cycles - 2, rounded up to the next highest integer, or zero
2647 82 jeremybenn
     if that would be negative.  The values should not exceed 255.  If
2648 19 jeremybenn
     they do, they will be ignored with a warning.
2649
 
2650
     See the ATA/ATAPI-5 specification for explanations of each of these
2651 82 jeremybenn
     timing parameters.  The default values are:
2652 19 jeremybenn
 
2653
          pio_mode0_t1   =  6
2654
          pio_mode0_t2   = 28
2655
          pio_mode0_t4   =  2
2656
          pio_mode0_teoc = 23
2657
 
2658
`dma_mode0_tm = VALUE'
2659
`dma_mode0_td = VALUE'
2660
`dma_mode0_teoc = VALUE'
2661
     These parameters specify the timings for use with DMA transfers.
2662
     They are specified as the number of clock cycles - 2, rounded up
2663
     to the next highest integer, or zero if that would be negative.
2664 82 jeremybenn
     The values should not exceed 255.  If they do, they will be
2665
     ignored with a warning.
2666 19 jeremybenn
 
2667
     See the ATA/ATAPI-5 specification for explanations of each of these
2668 82 jeremybenn
     timing parameters.  The default values are:
2669 19 jeremybenn
 
2670
          dma_mode0_tm   =  4
2671
          dma_mode0_td   = 21
2672
          dma_mode0_teoc = 21
2673
 
2674
 
2675
3.4.9.1 ATA/ATAPI Device Configuration
2676
......................................
2677
 
2678 82 jeremybenn
Within the `section ata', each device is specified separately.  The
2679 19 jeremybenn
device subsection is introduced by
2680
 
2681
     device VALUE
2682
 
2683 82 jeremybenn
VALUE is the device number, which should be 0 or 1.  The subsection
2684
ends with `enddevice'.  Note that if the same device number is
2685
specified more than once, the previous values will be overwritten.
2686
Within the `device' subsection, the following parameters may appear:
2687 19 jeremybenn
 
2688
`type = VALUE'
2689
     VALUEspecifies the type of device: 0 (the default) for "not
2690
     connected", 1 for hard disk simulated in a file and 2 for local
2691
     system hard disk.
2692
 
2693
`file = "FILENAME"'
2694
     `filename' specifies the file to be used for a simulated ATA
2695 82 jeremybenn
     device if the file type (see `type' above) is 1.  Default value
2696 346 jeremybenn
     `"ata_fileN"', where N is the device number.
2697 19 jeremybenn
 
2698
`size = VALUE'
2699
     VALUE specifies the size of a simulated ATA device if the file
2700 82 jeremybenn
     type (see `type' above) is 1.  The default value is zero.
2701 19 jeremybenn
 
2702
`packet = 0|1'
2703 82 jeremybenn
     If 1 (true), implement the PACKET command feature set.  If 0 (the
2704 19 jeremybenn
     default), do not implement the PACKET command feature set.
2705
 
2706
`firmware = "STR"'
2707
     Firmware to report in response to the "Identify Device" command.
2708
     Default `"02207031"'.
2709
 
2710
`heads = VALUE'
2711 82 jeremybenn
     Number of heads in the device.  Default 7, use -1 to disable all
2712 19 jeremybenn
     heads.
2713
 
2714
`sectors = VALUE'
2715 82 jeremybenn
     Number of sectors per track in the device.  Default 32.
2716 19 jeremybenn
 
2717
`mwdma = 0|1|2|-1'
2718 82 jeremybenn
     Highest multi-word DMA mode supported.  Default 2, use -1 to
2719 19 jeremybenn
     disable.
2720
 
2721
`pio = 0|1|2|3|4'
2722 82 jeremybenn
     Highest PIO mode supported.  Default 4.
2723 19 jeremybenn
 
2724
 
2725

2726
File: or1ksim.info,  Node: Generic Peripheral Configuration,  Prev: Disc Interface Configuration,  Up: Peripheral Configuration
2727
 
2728
3.4.10 Generic Peripheral Configuration
2729
---------------------------------------
2730
 
2731
When used as a library (*note Simulator Library: Simulator Library.),
2732
Or1ksim makes provision for any additional peripheral to be implemented
2733 82 jeremybenn
externally.  Any read or write access to this peripheral's memory map
2734
generates "upcall"s to an external handler.  This interface can support
2735 19 jeremybenn
either C or C++, and was particularly designed to facilitate support
2736
for OSCI SystemC (see `http://www.systemc.org').
2737
 
2738
Generic peripheral configuration is described in `section generic'.
2739
This section may appear multiple times, specifying multiple external
2740 82 jeremybenn
peripherals.  The following parameters may be specified.
2741 19 jeremybenn
 
2742
`enabled = 0|1'
2743 82 jeremybenn
     If 1 (true, the default), this ATA/ATAPI interface is enabled.  If
2744 19 jeremybenn
     0, it is disabled.
2745
 
2746
`baseaddr = VALUE'
2747
     Set the base address of the generic peripheral's memory mapped
2748 82 jeremybenn
     registers to VALUE.  The default is 0, which is probably not a
2749 19 jeremybenn
     sensible value.
2750
 
2751
     The size of the memory mapped register space is controlled by the
2752
     `size' paramter, described below.
2753
 
2754
`size = VALUE'
2755
     Set the size of the generic peripheral's memory mapped register
2756 82 jeremybenn
     space to VALUE bytes.  Any read or write accesses to addresses with
2757 19 jeremybenn
     offsets of 0 to VALUE-1 bytes from the base address specified in
2758
     parameter `baseaddr' (see above) will be directed to the external
2759
     interface.
2760
 
2761 82 jeremybenn
     VALUE will be rounded up the nearest power of 2.  It's default
2762
     value is zero.  If VALUE is not an exact power of two, accesses to
2763 19 jeremybenn
     address offsets of VALUE or above up to the next power of 2 will
2764
     generate a warning, and have no effect (reads will return zero).
2765
 
2766
`name = "STR"'
2767 82 jeremybenn
     This gives the peripheral the name `"STR"'.  This is used to
2768 19 jeremybenn
     identify the peripheral in error messages and warnings, and when
2769 82 jeremybenn
     reporting its status.  The default value is
2770 19 jeremybenn
     `"anonymous external peripheral"'.
2771
 
2772
`byte_enabled = 0|1'
2773
`hw_enabled = 0|1'
2774
`word_enabled = 0|1'
2775
     If 1 (true, the default), these parameters respectively enable the
2776 82 jeremybenn
     device for byte wide, half-word wide and word wide accesses.  If 0,
2777 19 jeremybenn
     accesses of that width will fail.
2778
 
2779
 
2780

2781
File: or1ksim.info,  Node: Interactive Command Line,  Next: Verification API,  Prev: Configuration,  Up: Top
2782
 
2783
4 Interactive Command Line
2784
**************************
2785
 
2786
If started with the `-f' flag, or if interrupted with `ctrl-C', Or1ksim
2787 82 jeremybenn
provides the user with an interactive command line.  The commands
2788 19 jeremybenn
available, which may not be abbreviated, are:
2789
 
2790
`q'
2791
     Exit the simulator
2792
 
2793
`r'
2794 82 jeremybenn
     Display all the General Purpose Registers (GPRs).  Also shows the
2795 19 jeremybenn
     just executed and next to be executed instructions symbolically
2796
     and the state of the flag in the Supervision Register.
2797
 
2798
`t'
2799
     Execute the next instruction and then display register/instruction
2800
     information as with the `r' command (see above).
2801
 
2802
`run NUM [ hush ]'
2803 82 jeremybenn
     Execute NUM instructions.  The register/instruction information is
2804 19 jeremybenn
     displayed after each instruction, as with the `r' command (see
2805
     above) _unless_ `hush' is specified.
2806
 
2807
`pr REG VALUE'
2808
     Patch register REG with VALUE.
2809
 
2810
`dm FROMADDR [ TOADDR ]'
2811 82 jeremybenn
     Display memory bytes between FROMADDR and TOADDR.  If TOADDR is
2812
     not given, 64 bytes are displayed, starting at FROMADDR.
2813 19 jeremybenn
 
2814
          Caution: The output from this command is broken (a bug).
2815 82 jeremybenn
          Or1ksim attempts to print out 16 bytes per row.  However,
2816 19 jeremybenn
          instead of printing out the address at the start of each row,
2817
          it prints the address (of the first of the 16 bytes) before
2818
          _each_ byte.
2819
 
2820
`de FROMADDR [ TOADDR ]'
2821 82 jeremybenn
     Disassemble code between FROMADDR and TOADDR.  If TOADDR is not
2822 19 jeremybenn
     given, 16 instructions are disassembled.
2823
 
2824
     The disassembly is entirely numerical, and gives no symbolic
2825
     information.
2826
 
2827
`pm ADDR VALUE'
2828
     Patch the 4 bytes in memory starting at ADDR with the 32-bit VALUE.
2829
 
2830
`pc VALUE'
2831
     Patch the program counter with VALUE.
2832
 
2833
`cm FROMADDR TOADDR SIZE'
2834
     Copy SIZE bytes in memory from FROMADDR to TOADDR.
2835
 
2836
`break ADDR'
2837
     Toggle the breakpoint set at ADDR.
2838
 
2839
`breaks'
2840
     List all set breakpoints
2841
 
2842
`reset'
2843 82 jeremybenn
     Reset the simulator.  Includes modeling a reset of the processor,
2844
     so execution will restart from the reset vector location, 0x100.
2845 19 jeremybenn
 
2846
`hist'
2847
     If saving the execution history has been configured (*note
2848
     Simulator Behavior: Simulator Behavior.), display the execution
2849
     history.
2850
 
2851
`stall'
2852
     Stall the processor, so that control is passed to the debug unit.
2853 82 jeremybenn
     When stalled, the processor can execute no instructions.  This
2854 19 jeremybenn
     command is useful when debugging the JTAG interface, used by
2855
     debuggers such as GDB.
2856
 
2857
`unstall'
2858 82 jeremybenn
     Unstall the processor, so that normal execution can continue.
2859
     This command is useful when debugging the JTAG interface, used by
2860 19 jeremybenn
     debuggers such as GDB.
2861
 
2862
`stats CATEGORY | clear'
2863
     Print the statistics for the given CATEGORY, if available, or
2864 82 jeremybenn
     clear if `clear' is specified.  The categories are:
2865 19 jeremybenn
 
2866
    1
2867
          Miscellaneous statistics: branch predictions (if branch
2868
          predictions are enabled), branch target cache model (if
2869
          enabled), cache (if enbaled), MMU (if enabled) and number of
2870
          addtional load & store cycles.
2871
 
2872
          *Note Configuring the OpenRisc Achitectural Components: Core
2873
          OpenRISC Configuration, for details of how to enable these
2874
          various features.
2875
 
2876
    2
2877 82 jeremybenn
          Instruction usage statistics.  Requires hazard analysis to be
2878 19 jeremybenn
          enabled (*note CPU Configuration: CPU Configuration.).
2879
 
2880
    3
2881 82 jeremybenn
          Instruction dependency statistics.  Requires hazard analysis
2882 19 jeremybenn
          to be enabled (*note CPU Configuration: CPU Configuration.).
2883
 
2884
    4
2885 82 jeremybenn
          Functional unit dependency statistics.  Requires hazard
2886 19 jeremybenn
          analysis to be enabled (*note CPU Configuration: CPU
2887
          Configuration.).
2888
 
2889
    5
2890 82 jeremybenn
          Raw register usage over time.  Requires hazard analysis to be
2891 19 jeremybenn
          enabled (*note CPU Configuration: CPU Configuration.).
2892
 
2893
    6
2894 82 jeremybenn
          Store buffer statistics.  Requires the store buffer to be
2895 19 jeremybenn
          enabled (*note CPU Configuration: CPU Configuration.).
2896
 
2897
 
2898
`info'
2899
     Display detailed information about the simulator configuration.
2900
     This is quite a lengthy about, because all MMU TLB information is
2901
     displayed.
2902
 
2903
`dv FROMADDR [ TOADDR ] [ MODULE ]'
2904
     Dump the area of memory between FROMADDR and TOADDR as Verilog
2905 82 jeremybenn
     code for a synchronous, 23-bit wide SRAM module, named MODULE.  If
2906 19 jeremybenn
     TOADDR is not specified, then 64 bytes are dumped (as 16 32-bit
2907 82 jeremybenn
     words).  If MODULE is not specified, `or1k_mem' is used.
2908 19 jeremybenn
 
2909
     To save to a file, use the redirection function (described after
2910
     this table, below).
2911
 
2912
`dh FROMADDR [ TOADDR ]'
2913
     Dump the area of memory between FROMADDR and TOADDR as 32-bit hex
2914 82 jeremybenn
     numbers (no `0x', or `32'h' prefix).  If TOADDR is not specified,
2915 19 jeremybenn
     then 64 bytes are dumped (as 16 32-bit words).
2916
 
2917
     To save to a file, use the redirection function (described after
2918
     this table, below).
2919
 
2920
`setdbch'
2921 82 jeremybenn
     Toggle debug channels on/off.  *Note Standalone Simulator:
2922 19 jeremybenn
     Standalone Simulator, for a description of specifying debug
2923
     channels on the command line.
2924
 
2925
`set SECTION PARAM = VALUE'
2926
     Set the configuration parameter PARA in section SECTION to VALUE.
2927
     *Note Configuration: Configuration, for details of configuration
2928
     parameters and their settings.
2929
 
2930
`debug'
2931 82 jeremybenn
     Toggle the simulator debug mode.  *Note Debug Interface
2932 19 jeremybenn
     Configuration: Debug Interface Configuration, for information on
2933
     this parameter.
2934
 
2935
          Caution: This is effectively enabling or disabling the debug
2936 82 jeremybenn
          unit.  It does not effect the remote GDB debug interface.
2937 19 jeremybenn
          However using the remote debug interface while the debug unit
2938
          is disabled will lead to undefined behavior and likely crash
2939
          Or1ksim
2940
 
2941
`cuc'
2942
     Enter the the Custom Unit Compiler command prompt (*note CUC
2943
     Configuration: CUC Configuration.).
2944
 
2945
          Caution: The CUC must be properly configured, for this to
2946 82 jeremybenn
          succeed.  In particular a timing file must be available and
2947
          readable.  Otherwise Or1ksim will crash.
2948 19 jeremybenn
 
2949
`help'
2950
     Print out brief information about each command available.
2951
 
2952
`mprofile [-vh] [-m M] [-g N] [-f FILE] FROM TO'
2953 82 jeremybenn
     Run the memory profiling utility.  This follows the same usage as
2954 19 jeremybenn
     the standalone command (*note Memory Profiling Utility: Memory
2955
     Profiling Utility.).
2956
 
2957
`profile [-vhcq] [-g FILE]'
2958 82 jeremybenn
     Run the instruction profiling utility.  This follows the same
2959
     usage as the standalone command (*note Profiling Utility:
2960
     Profiling Utility.).
2961 19 jeremybenn
 
2962
 
2963
For all commands, it is possible to redirect the output to a file, by
2964
using the redirection operator, `>'.
2965
 
2966
     COMMAND > FILENAME
2967
 
2968
This is particularly useful for commands dumping a large amount of
2969
output, such as `dv'.
2970
 
2971
     Caution: Unfortunately there is a serious bug with the redirection
2972 82 jeremybenn
     operator.  It does not return output to standard output after the
2973
     command completes.  Until this bug is fixed, file redirection
2974 19 jeremybenn
     should not be used.
2975
 
2976

2977
File: or1ksim.info,  Node: Verification API,  Next: Code Internals,  Prev: Interactive Command Line,  Up: Top
2978
 
2979
5 Verification API (VAPI)
2980
*************************
2981
 
2982
The Verification API (VAPI) provides a TCP/IP interface to allow
2983 82 jeremybenn
components of the simulation to be controlled externally.  The
2984
interface is polled for new requests on each simulated clock cycle.
2985
Components within the simulator may send responses to such requests.
2986 19 jeremybenn
 
2987 82 jeremybenn
The inteface is an asynchronous duplex protocol.  On the request side
2988
it provides for simple commands, known as VAPI IDs (a 32 bit integer),
2989
with a single piece of data (also a 32 bit integer).  On the send side,
2990
it provides for sending a single VAPI ID and data.  However there is no
2991
explicit command-response structure.  Some components just accept
2992
requests (e.g.  to set values), some just generate sends (to report
2993 19 jeremybenn
values), and some do both.
2994
 
2995
Each component has a base ID (32 bit) and its commands will start from
2996 82 jeremybenn
that base ID.  This provides a simple partitioning of the command space
2997
amongst components.  Request commands will be directed to the component
2998 19 jeremybenn
with the closest base ID lower than the VAPI ID of the command.
2999
 
3000
Thus if there are two components with base IDs of 0x200 and 0x300, and
3001
a request with VAPI ID of 0x203 is received, it will be directed to the
3002
first component as its command #3.
3003
 
3004
The results of VAPI interactions are logged (by default in `vapi.log'
3005
unless an alternative is specified in `section vapi').
3006
 
3007
Currently the following components support VAPI:
3008
 
3009
Debug Unit
3010
     Although the Debug Unit can specify a base VAPI ID, it is not used
3011
     to send commands or receive requests.
3012
 
3013
     Instead, if the base VAPI ID is set, all remote JTAG protocol
3014
     exchanges are logged in the VAPI log file.
3015
 
3016
UART
3017
     If a base VAPI ID is specified, the UART sends details of any
3018
     chars or break characters sent, with dteails of the line control
3019
     register etc encoded in the data packet sent.
3020
 
3021
     This supports a single VAPI command request, but encodes a
3022
     sub-command in the top 8 bits of the associated data.
3023
 
3024
    `0x00'
3025
          This stuffs the least significant 8 bits of the data into the
3026
          serial register of the UART and the next 8 bits into the line
3027
          control register, effectively providing control of the next
3028
          character to be sent or received.
3029
 
3030
    `0x01'
3031
          The divisor latch bytes are set from the least significant 16
3032
          bits of the data.
3033
 
3034
    `0x02'
3035
          The line control register is set from bits 15-8 of the data.
3036
 
3037
    `0x03'
3038
          The UART skew is set from the least significant 16 bits of
3039
          the data
3040
 
3041
    `0x04'
3042
          If the 16th most significant bit of the data is 1, start
3043 82 jeremybenn
          sending breaks, otherwise stop sending breaks.  The breaks
3044
          are sent or cleared after the number of UART clock divider
3045
          ticks specified by the data (immediately if the data is zero).
3046 19 jeremybenn
 
3047
 
3048
DMA
3049
     Although the DMA unit supports a base VAPI ID in its configuration
3050
     (`section dma'), no VAPI data is sent, nor VAPI requests currently
3051
     implemented.
3052
 
3053
Ethernet
3054 82 jeremybenn
     The following requests are handled by the Ethernet.  Specified
3055 19 jeremybenn
     symbolically, these are the increments from the base VAPI ID of the
3056 82 jeremybenn
     Ethernet.  At present no implementation is provided behind these
3057 19 jeremybenn
     VAPI requests.
3058
 
3059
    `ETH_VAPI_DATA (0)'
3060
 
3061
    `ETH_VAPI_CTRL (0)'
3062
 
3063
GPIO
3064
     If a base VAPI ID is specified, the GPIO sends out on its base
3065
     VAPI ID (symbolically, GPIO_VAPI_DATA (0) offset from the base
3066
     VAPI ID) any changes in outputs.
3067
 
3068 82 jeremybenn
     The following requests are handled by the GPIO.  Specified
3069 19 jeremybenn
     symbolically, these are the increments from the VAPI base ID of the
3070
     GPIO.
3071
 
3072
    `GPIO_VAPI_DATA (0)'
3073
          Set the next input to the commands data field
3074
 
3075
    `GPIO_VAPI_AUX (1)'
3076
          Set the GPIO auxiliary inputs to the data field
3077
 
3078
    `GPIO_VAPI_CLOCK (2)'
3079
          Add an external GPIO clock trigger of period specified in the
3080
          data field.
3081
 
3082
    `GPIO_VAPI_RGPIO_OE (3)'
3083
          Set the GPIO output enable to the data field
3084
 
3085
    `GPIO_VAPI_RGPIO_INTE (4)'
3086
          Set the next interrupt to the data field
3087
 
3088
    `GPIO_VAPI_RGPIO_PTRIG (5)'
3089
          Set the next trigger to the data field
3090
 
3091
    `GPIO_VAPI_RGPIO_AUX (6)'
3092
          Set the next auxiliary input to the data field
3093
 
3094
    `GPIO_VAPI_RGPIO_CTRL (7)'
3095
          Set th next control input to the data field
3096
 
3097
 
3098
 
3099

3100
File: or1ksim.info,  Node: Code Internals,  Next: GNU Free Documentation License,  Prev: Verification API,  Up: Top
3101
 
3102
6 A Guide to Or1ksim Internals
3103
******************************
3104
 
3105 82 jeremybenn
These are notes to help those wanting to extend Or1ksim.  This section
3106 19 jeremybenn
assumes the use of a tag file, so file locations of entities'
3107 82 jeremybenn
definitions are not in general provided.  For more on tags, see the
3108
Linux manual page for `etags'.  A tag file can be created with:
3109 19 jeremybenn
 
3110
     make tags
3111
 
3112
* Menu:
3113
 
3114
* Coding Conventions::
3115
* Global Data Structures::
3116
* Concepts::
3117
* Internal Debugging::
3118 104 jeremybenn
* Regression Testing::
3119 19 jeremybenn
 
3120

3121
File: or1ksim.info,  Node: Coding Conventions,  Next: Global Data Structures,  Up: Code Internals
3122
 
3123
6.1 Coding Conventions for Or1ksim
3124
==================================
3125
 
3126
This chapter provides some guidelines for coding, to facilitate
3127
extensions to Or1ksim
3128
 
3129
_GNU Coding Standard_
3130
     Code should follow the GNU coding standard for C
3131 82 jeremybenn
     (`http://www.gnu.org/prep/standards/'.  If in doubt, put your code
3132 19 jeremybenn
     through the `indent' program.
3133
 
3134
_`#include' headers_
3135
     All C source code files should include `config.h' before any other
3136
     file.
3137
 
3138
     This should be followed by inclusion of any system headers (but see
3139
     the comments about portability and `port.h' below) and then by any
3140
     Or1ksim package headers.
3141
 
3142
     If `port.h' is required, it should be the first package header to
3143
     be included after the system headers.
3144
 
3145
     All C source code and header files should directly include any
3146 82 jeremybenn
     system or package header they depend on, i.e.  not rely on any
3147
     other header having already included it.  The two exceptions are
3148 19 jeremybenn
 
3149
       1. All header files may assume that `config.h' has already been
3150
          included.
3151
 
3152
       2. System headers which impose portability problems should be
3153
          included by using the package header `port.h', rather than
3154 82 jeremybenn
          the system headers themselves.  This is the case for code
3155 19 jeremybenn
          requiring
3156
 
3157
             * `strndup' (from `string.h')
3158
 
3159
             * Integer types (`intN_t', `uintN_t') (from `inttypes.h').
3160
 
3161
             * `isblank' (from `ctype.h')
3162
 
3163
 
3164
 
3165
_`#include' files once only_
3166
     All include files should be protected by `#ifndef' to ensure their
3167 82 jeremybenn
     definitions are only included once.  For instance a header file
3168 19 jeremybenn
     `X-Y.H' should surround its contents with:
3169
 
3170
          #ifndef X_Y__H
3171
          #define X_Y__H
3172
 
3173
          
3174
 
3175
          #endif  /* X_Y__H */
3176
 
3177
_Avoid `typedef'_
3178
     The GNU coding style for C does not have a clear way to distinguish
3179 82 jeremybenn
     between user type name and user variables.  For this reason
3180 19 jeremybenn
     `typedef' should be avoided except for the most ubiquitous user
3181 82 jeremybenn
     defined types.  This makes the code much easier to read.
3182 19 jeremybenn
 
3183
     There are some `typedef' declarations in the `argtable2' library
3184
     and the ELF and COFF headers, because this code is taken from
3185
     other places.
3186
 
3187
     Within Or1ksim legacy uses of `typedef' have largely been purged,
3188
     except in the Custom Unit Compiler (*note Custom Unit Compiler
3189
     (CUC) Configuration: CUC Configuration.).
3190
 
3191
     The remaining uses of `typedef' occur in two places:
3192
 
3193
        * `port/port.h' defines types to replace those in header files
3194
          that are not available (character functions, string
3195
          duplication, integer types).
3196
 
3197
          `cpu/or1k/arch.h' defines types for the key Or1ksim entities:
3198
          addresses (`oraddr_t'), unsigned register values (`uorreg_t')
3199
          and signed register (`orreg_t') values.
3200
 
3201
 
3202
     Where new types are defined, they should appear in one of these two
3203 82 jeremybenn
     files as appropriate.  Or1ksim specific types appearing in
3204
     `arch.h' should always have the suffix `_h'.
3205 19 jeremybenn
 
3206
_Don't begin names with underscore_
3207
     Names beginning with `_' are intended to be part of the C
3208 82 jeremybenn
     infrastructure.  They should not be used in the simulator code.
3209 19 jeremybenn
 
3210
_Keep Non-global top level entities static_
3211
     All top level entities (functions, variables), which are not
3212
     explicitly part of a global interface should be declared static.
3213
     This ensures that unwanted connections are not inadvertently built
3214
     across the program.
3215
 
3216
_Use of `inline'_
3217 82 jeremybenn
     Code should not be declared `inline'.  Modern compilers can work
3218 19 jeremybenn
     out for themselves what is best in this respect.
3219
 
3220
_Initialization_
3221 82 jeremybenn
     All data structures should be explicitly initialized.  In
3222
     particular code should not rely on static data structures being
3223
     initialized to zero.
3224 19 jeremybenn
 
3225
     The rationale is that in future static data structures may become
3226 82 jeremybenn
     dynamic.  This has been a particular source of bugs in Or1ksim
3227 19 jeremybenn
     historically.
3228
 
3229
     A specific case is with new peripherals, which should always
3230
     include a `start' function to pre-initialize all configuration
3231
     parameters to sensible defaults
3232
 
3233
_Configuration Validation_
3234
     All configuration values should be validated, preferably when
3235
     encountered, if not when the `section' is closed, or otherwise at
3236
     run time when the parameter is first used.
3237
 
3238
 
3239

3240
File: or1ksim.info,  Node: Global Data Structures,  Next: Concepts,  Prev: Coding Conventions,  Up: Code Internals
3241
 
3242
6.2 Global Data Structures
3243
==========================
3244
 
3245
`config'
3246
     The global variable `config' of type `struct config' holds the
3247
     configuration data for some of the Or1ksim components which are
3248 82 jeremybenn
     always present.  At present the components are:
3249 19 jeremybenn
 
3250
        * The simulator defined in `section sim' (*note Simulator
3251
          Configuration: Simulator Configuration.).
3252
 
3253
        * The Verification API (VAPI) defined  in `section vapi' (*note
3254
          Verification API (VAPI) Configuration: Verification API
3255
          Configuration.).
3256
 
3257
        * The Custom Unit Compiler (CUC), defined in `section cuc'
3258
          (*note Custom Unit Compiler (CUC) Configuration: CUC
3259
          Configuration.).
3260
 
3261
        * The CPU, defined in `section cpu' (*note CPU Configuration:
3262
          CPU Configuration.).
3263
 
3264
        * The data cache (but not the instruction cache), defined in
3265
          `section dc' (*note Cache Configuration: Cache
3266
          Configuration.).
3267
 
3268
        * The power management unit, defined in `section pm' (*note
3269
          Power Management Configuration: Power Management
3270
          Configuration.).
3271
 
3272
        * The programmable interrupt controller, defined in
3273
          `section pic' (*note Interrupt Configuration: Interrupt
3274
          Configuration.).
3275
 
3276
        * Branch prediciton, defined in `section bpb' (*note Branch
3277
          Prediction Configuration: Branch Prediction Configuration.).
3278
 
3279
        * The debug unit, defined in `section debug' (*note Debug
3280
          Interface Configuration: Debug Interface Configuration.).
3281
 
3282
 
3283
     This struct is made of a collection of structs, one for each
3284 82 jeremybenn
     component.  For example the simulator configuration is held in
3285 19 jeremybenn
     `config.sim'.
3286
 
3287
`config'
3288
     This is a linked list of data structures holding configuration data
3289
     for all sections which are not held in the main `config' data
3290 82 jeremybenn
     structure.  In general these are components (such as peripherals
3291
     and memory) which may occur multiple times.  However it also
3292
     handles some architectural components which may occur only once,
3293
     such as the memory management units, the instruction cache, the
3294
     interrupt controller and branch prediction.
3295 19 jeremybenn
 
3296
`runtime'
3297
     The global variable `runtime' of type `struct runtime' holds all
3298 82 jeremybenn
     the runtime information about the simulation.  To access this
3299 19 jeremybenn
     variable, `sim-config.h' must be included.
3300
 
3301
     This struct is itself made of 3 other structs, `cpu' (for CPU run
3302
     time state), `vapi' (for Verification API state) and `cuc' (for
3303
     Custom Unit Compiler state).
3304
 
3305
 
3306

3307
File: or1ksim.info,  Node: Concepts,  Next: Internal Debugging,  Prev: Global Data Structures,  Up: Code Internals
3308
 
3309
6.3 Concepts
3310
============
3311
 
3312
_Output Redirection_
3313 82 jeremybenn
     The current output stream is held in `runtime.cpu.fout'.  Output
3314 19 jeremybenn
     should be explicitly written to this stream, or may use the
3315
     `PRINTF' macro, which will write its arguments to this output
3316
     stream.
3317
 
3318
_Reset Hooks_
3319
     Any peripheral may register a routine to be called when the the
3320
     processor is reset by calling `reg_sim_reset', providing a
3321 82 jeremybenn
     function and pointer to a data structure as arguments.  On reset
3322 19 jeremybenn
     that function will be called with the data stucture pointer as
3323
     argument.
3324
 
3325 432 jeremybenn
_Interrupts_
3326
     An internal peripheral can model the effect of an interrupt being
3327
     asserted by calling `report_interrupt'.  This is used for both edge
3328
     and level sensitive interrupts.
3329 19 jeremybenn
 
3330 432 jeremybenn
     The effect is to set the corresponding bit in the PICSR SPR and to
3331
     queue an interrupt exception to take place after the current
3332
     instruction completes execution.
3333
 
3334
     Externally, the different interrupts require different mechanisms
3335
     for clearing.  Level sensitive interrupts should be cleared by
3336
     deasserting the interrupt line, edge sensitive interrupts by
3337
     clearing the corresponding bit in the PICSR SPR.
3338
 
3339
     Internally this amounts to the same thing (clearing the PICSPR
3340
     bit), so a single function is provided, `clear_interrupt'.  Note
3341
     however that when level sensitive interrupts are configured, PICSR
3342
     is read only, and can only be cleared by calling
3343
     `clear_interrupt'.  Using the two functions provided will ensure
3344
     the peripheral works correctly whichever type of interrupt is used.
3345
 
3346
          Note: Until an interrupt is cleared, all subsequent
3347
          interrupts are ignored with a warning.
3348
 
3349
 
3350 19 jeremybenn

3351 104 jeremybenn
File: or1ksim.info,  Node: Internal Debugging,  Next: Regression Testing,  Prev: Concepts,  Up: Code Internals
3352 19 jeremybenn
 
3353
6.4 Internal Debugging
3354
======================
3355
 
3356
The function `debug' is like `printf', but with an extra first
3357 82 jeremybenn
argument, which is the debug level.  If the debug level specified in
3358
the simulator configuration (*note Simulator Behavior: Simulator
3359
Behavior.) is greater than or equal to this value, the remaining
3360
arguments are printed to the current output stream (*note Output
3361
Redirection: Output Redirection.).
3362 19 jeremybenn
 
3363

3364 104 jeremybenn
File: or1ksim.info,  Node: Regression Testing,  Prev: Internal Debugging,  Up: Code Internals
3365
 
3366
6.5 Regression Testing
3367
======================
3368
 
3369
Or1ksim now includes a regression test suite for both standalone and
3370
library usage as described earlier (*note Building and Installing:
3371
Build and Install.).  Running the tests requires that the OpenRISC
3372
toolchain and DejaGNU are both installed.
3373
 
3374
Tests are written using `expect', a derivative of TCL.  Documentation
3375
of DejaGnu, `expect' and TCL are freely available on the Web.  The
3376
Embecosm Application Note 8, `Howto: Using DejaGnu for Testing: A
3377
Simple Introduction' (`http://www.embecosm.com/download/ean8.html')
3378
provides a concise introduction.
3379
 
3380
All test code is found in the `testsuite' directory.  The key files and
3381
directories used are as follows.
3382
 
3383
`global-conf.exp'
3384
     This is the global DejaGNU configuration file used to set up
3385
     parameters common to all tests.  If the user has the environment
3386
     varialbe `DEJAGNU' defined, it will be used instead, but this is
3387
     not recommended.
3388
 
3389
`Makefile.am'
3390
     This is the top level `automake' file for the testsuite.  The only
3391
     changes likely to be needed here is additional local cleanup of
3392
     files created by new tests.
3393
 
3394
`README'
3395
     This contains details of all the tests
3396
 
3397
`config'
3398
     This contains DejaGnu board configurations.  Since the tests are
3399
     generally run on a Unix host, this should just contain `Unix.exp'.
3400
 
3401
`lib'
3402
     This contains DejaGnu tool specific configurations.  "Tool" has a
3403
     specific meaning in DejaGNU, referring just to a grouping of
3404
     tests.  In this case there are two such "tools", "or1ksim" and
3405
     "libsim" for tests of the standalone tool and tests of the library.
3406
 
3407
     Corresponding to this, there are two tool specific configuration
3408
     files, `or1ksim.exp' and `libsim.exp'.  These contain `expect'/TCL
3409
     procedures for common use among the tests.
3410
 
3411
`libsim.tests'
3412
`or1ksim.tests'
3413
     These are the directories of tests of the Or1ksim library.  They
3414
     also include Or1ksim configuration files and each has a
3415
     `Makefile.am' file.  `Makefile.am' should be updated whenever
3416
     files are added to this directory, to ensure they are included in
3417
     the distribution.
3418
 
3419
`test-code'
3420
     These are all the test programs to be compiled on the host (each
3421
     in its own directory).  In general these are programs to support
3422
     testing of the library, and build various programs linking in the
3423
     library.
3424
 
3425
`test-code'
3426
     These are all the test programs to be compiled with the OpenRISC
3427
     tool chain to run with either standalone Or1ksim or the library.
3428
     This directory includes its own `configure.ac', since it must set
3429
     up a separate tool chain based on the target, not the host.
3430
 
3431
 
3432
To add a new test needs the following steps.
3433
 
3434 346 jeremybenn
   * Put new host C code in its own directory within `test-code'.  Add
3435 104 jeremybenn
     the directory to the existing `Makefile.am' in the `test-code'
3436
     directory and create a `Makefile.am' in the new directory to drive
3437 346 jeremybenn
     building the test program(s).  Don't forget to add the new
3438 104 jeremybenn
     `Makefile' to the top level `configure.ac' so it gets generated.
3439
     Not all tests require code here.
3440
 
3441 346 jeremybenn
   * Put new target C code in its own directory within `test-code-or1k'.
3442
     Once again modify & create `Makefile.am'.  This time modify the
3443
     `configure.ac' in the `test-code-or1k' so the `Makefile' gets
3444
     generated.  The existing programs provide examples to start from,
3445
     including custom linker scripts where needed.
3446 104 jeremybenn
 
3447
   * Add one or more tests and configuration files to the relevant
3448 346 jeremybenn
     "tool" test directory.  Use the existing tests as templates.  They
3449 104 jeremybenn
     make heavy use of the `expect'/TCL procedures in the `config'
3450
     directory to facilitate driving the tests.
3451
 
3452
 
3453

3454 19 jeremybenn
File: or1ksim.info,  Node: GNU Free Documentation License,  Next: Index,  Prev: Code Internals,  Up: Top
3455
 
3456
7 GNU Free Documentation License
3457
********************************
3458
 
3459
                      Version 1.2, November 2002
3460
 
3461
     Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
3462
     51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA
3463
 
3464
     Everyone is permitted to copy and distribute verbatim copies
3465
     of this license document, but changing it is not allowed.
3466
 
3467
  0. PREAMBLE
3468
 
3469
     The purpose of this License is to make a manual, textbook, or other
3470
     functional and useful document "free" in the sense of freedom: to
3471
     assure everyone the effective freedom to copy and redistribute it,
3472
     with or without modifying it, either commercially or
3473
     noncommercially.  Secondarily, this License preserves for the
3474
     author and publisher a way to get credit for their work, while not
3475
     being considered responsible for modifications made by others.
3476
 
3477
     This License is a kind of "copyleft", which means that derivative
3478
     works of the document must themselves be free in the same sense.
3479
     It complements the GNU General Public License, which is a copyleft
3480
     license designed for free software.
3481
 
3482
     We have designed this License in order to use it for manuals for
3483
     free software, because free software needs free documentation: a
3484
     free program should come with manuals providing the same freedoms
3485
     that the software does.  But this License is not limited to
3486
     software manuals; it can be used for any textual work, regardless
3487
     of subject matter or whether it is published as a printed book.
3488
     We recommend this License principally for works whose purpose is
3489
     instruction or reference.
3490
 
3491
  1. APPLICABILITY AND DEFINITIONS
3492
 
3493
     This License applies to any manual or other work, in any medium,
3494
     that contains a notice placed by the copyright holder saying it
3495
     can be distributed under the terms of this License.  Such a notice
3496
     grants a world-wide, royalty-free license, unlimited in duration,
3497
     to use that work under the conditions stated herein.  The
3498
     "Document", below, refers to any such manual or work.  Any member
3499
     of the public is a licensee, and is addressed as "you".  You
3500
     accept the license if you copy, modify or distribute the work in a
3501
     way requiring permission under copyright law.
3502
 
3503
     A "Modified Version" of the Document means any work containing the
3504
     Document or a portion of it, either copied verbatim, or with
3505
     modifications and/or translated into another language.
3506
 
3507
     A "Secondary Section" is a named appendix or a front-matter section
3508
     of the Document that deals exclusively with the relationship of the
3509
     publishers or authors of the Document to the Document's overall
3510
     subject (or to related matters) and contains nothing that could
3511
     fall directly within that overall subject.  (Thus, if the Document
3512
     is in part a textbook of mathematics, a Secondary Section may not
3513
     explain any mathematics.)  The relationship could be a matter of
3514
     historical connection with the subject or with related matters, or
3515
     of legal, commercial, philosophical, ethical or political position
3516
     regarding them.
3517
 
3518
     The "Invariant Sections" are certain Secondary Sections whose
3519
     titles are designated, as being those of Invariant Sections, in
3520
     the notice that says that the Document is released under this
3521
     License.  If a section does not fit the above definition of
3522
     Secondary then it is not allowed to be designated as Invariant.
3523
     The Document may contain zero Invariant Sections.  If the Document
3524
     does not identify any Invariant Sections then there are none.
3525
 
3526
     The "Cover Texts" are certain short passages of text that are
3527
     listed, as Front-Cover Texts or Back-Cover Texts, in the notice
3528
     that says that the Document is released under this License.  A
3529
     Front-Cover Text may be at most 5 words, and a Back-Cover Text may
3530
     be at most 25 words.
3531
 
3532
     A "Transparent" copy of the Document means a machine-readable copy,
3533
     represented in a format whose specification is available to the
3534
     general public, that is suitable for revising the document
3535
     straightforwardly with generic text editors or (for images
3536
     composed of pixels) generic paint programs or (for drawings) some
3537
     widely available drawing editor, and that is suitable for input to
3538
     text formatters or for automatic translation to a variety of
3539
     formats suitable for input to text formatters.  A copy made in an
3540
     otherwise Transparent file format whose markup, or absence of
3541
     markup, has been arranged to thwart or discourage subsequent
3542
     modification by readers is not Transparent.  An image format is
3543
     not Transparent if used for any substantial amount of text.  A
3544
     copy that is not "Transparent" is called "Opaque".
3545
 
3546
     Examples of suitable formats for Transparent copies include plain
3547
     ASCII without markup, Texinfo input format, LaTeX input format,
3548
     SGML or XML using a publicly available DTD, and
3549
     standard-conforming simple HTML, PostScript or PDF designed for
3550
     human modification.  Examples of transparent image formats include
3551
     PNG, XCF and JPG.  Opaque formats include proprietary formats that
3552
     can be read and edited only by proprietary word processors, SGML or
3553
     XML for which the DTD and/or processing tools are not generally
3554
     available, and the machine-generated HTML, PostScript or PDF
3555
     produced by some word processors for output purposes only.
3556
 
3557
     The "Title Page" means, for a printed book, the title page itself,
3558
     plus such following pages as are needed to hold, legibly, the
3559
     material this License requires to appear in the title page.  For
3560
     works in formats which do not have any title page as such, "Title
3561
     Page" means the text near the most prominent appearance of the
3562
     work's title, preceding the beginning of the body of the text.
3563
 
3564
     A section "Entitled XYZ" means a named subunit of the Document
3565
     whose title either is precisely XYZ or contains XYZ in parentheses
3566
     following text that translates XYZ in another language.  (Here XYZ
3567
     stands for a specific section name mentioned below, such as
3568
     "Acknowledgements", "Dedications", "Endorsements", or "History".)
3569
     To "Preserve the Title" of such a section when you modify the
3570
     Document means that it remains a section "Entitled XYZ" according
3571
     to this definition.
3572
 
3573
     The Document may include Warranty Disclaimers next to the notice
3574
     which states that this License applies to the Document.  These
3575
     Warranty Disclaimers are considered to be included by reference in
3576
     this License, but only as regards disclaiming warranties: any other
3577
     implication that these Warranty Disclaimers may have is void and
3578
     has no effect on the meaning of this License.
3579
 
3580
  2. VERBATIM COPYING
3581
 
3582
     You may copy and distribute the Document in any medium, either
3583
     commercially or noncommercially, provided that this License, the
3584
     copyright notices, and the license notice saying this License
3585
     applies to the Document are reproduced in all copies, and that you
3586
     add no other conditions whatsoever to those of this License.  You
3587
     may not use technical measures to obstruct or control the reading
3588
     or further copying of the copies you make or distribute.  However,
3589
     you may accept compensation in exchange for copies.  If you
3590
     distribute a large enough number of copies you must also follow
3591
     the conditions in section 3.
3592
 
3593
     You may also lend copies, under the same conditions stated above,
3594
     and you may publicly display copies.
3595
 
3596
  3. COPYING IN QUANTITY
3597
 
3598
     If you publish printed copies (or copies in media that commonly
3599
     have printed covers) of the Document, numbering more than 100, and
3600
     the Document's license notice requires Cover Texts, you must
3601
     enclose the copies in covers that carry, clearly and legibly, all
3602
     these Cover Texts: Front-Cover Texts on the front cover, and
3603
     Back-Cover Texts on the back cover.  Both covers must also clearly
3604
     and legibly identify you as the publisher of these copies.  The
3605
     front cover must present the full title with all words of the
3606
     title equally prominent and visible.  You may add other material
3607
     on the covers in addition.  Copying with changes limited to the
3608
     covers, as long as they preserve the title of the Document and
3609
     satisfy these conditions, can be treated as verbatim copying in
3610
     other respects.
3611
 
3612
     If the required texts for either cover are too voluminous to fit
3613
     legibly, you should put the first ones listed (as many as fit
3614
     reasonably) on the actual cover, and continue the rest onto
3615
     adjacent pages.
3616
 
3617
     If you publish or distribute Opaque copies of the Document
3618
     numbering more than 100, you must either include a
3619
     machine-readable Transparent copy along with each Opaque copy, or
3620
     state in or with each Opaque copy a computer-network location from
3621
     which the general network-using public has access to download
3622
     using public-standard network protocols a complete Transparent
3623
     copy of the Document, free of added material.  If you use the
3624
     latter option, you must take reasonably prudent steps, when you
3625
     begin distribution of Opaque copies in quantity, to ensure that
3626
     this Transparent copy will remain thus accessible at the stated
3627
     location until at least one year after the last time you
3628
     distribute an Opaque copy (directly or through your agents or
3629
     retailers) of that edition to the public.
3630
 
3631
     It is requested, but not required, that you contact the authors of
3632
     the Document well before redistributing any large number of
3633
     copies, to give them a chance to provide you with an updated
3634
     version of the Document.
3635
 
3636
  4. MODIFICATIONS
3637
 
3638
     You may copy and distribute a Modified Version of the Document
3639
     under the conditions of sections 2 and 3 above, provided that you
3640
     release the Modified Version under precisely this License, with
3641
     the Modified Version filling the role of the Document, thus
3642
     licensing distribution and modification of the Modified Version to
3643
     whoever possesses a copy of it.  In addition, you must do these
3644
     things in the Modified Version:
3645
 
3646
       A. Use in the Title Page (and on the covers, if any) a title
3647
          distinct from that of the Document, and from those of
3648
          previous versions (which should, if there were any, be listed
3649
          in the History section of the Document).  You may use the
3650
          same title as a previous version if the original publisher of
3651
          that version gives permission.
3652
 
3653
       B. List on the Title Page, as authors, one or more persons or
3654
          entities responsible for authorship of the modifications in
3655
          the Modified Version, together with at least five of the
3656
          principal authors of the Document (all of its principal
3657
          authors, if it has fewer than five), unless they release you
3658
          from this requirement.
3659
 
3660
       C. State on the Title page the name of the publisher of the
3661
          Modified Version, as the publisher.
3662
 
3663
       D. Preserve all the copyright notices of the Document.
3664
 
3665
       E. Add an appropriate copyright notice for your modifications
3666
          adjacent to the other copyright notices.
3667
 
3668
       F. Include, immediately after the copyright notices, a license
3669
          notice giving the public permission to use the Modified
3670
          Version under the terms of this License, in the form shown in
3671
          the Addendum below.
3672
 
3673
       G. Preserve in that license notice the full lists of Invariant
3674
          Sections and required Cover Texts given in the Document's
3675
          license notice.
3676
 
3677
       H. Include an unaltered copy of this License.
3678
 
3679
       I. Preserve the section Entitled "History", Preserve its Title,
3680
          and add to it an item stating at least the title, year, new
3681
          authors, and publisher of the Modified Version as given on
3682
          the Title Page.  If there is no section Entitled "History" in
3683
          the Document, create one stating the title, year, authors,
3684
          and publisher of the Document as given on its Title Page,
3685
          then add an item describing the Modified Version as stated in
3686
          the previous sentence.
3687
 
3688
       J. Preserve the network location, if any, given in the Document
3689
          for public access to a Transparent copy of the Document, and
3690
          likewise the network locations given in the Document for
3691
          previous versions it was based on.  These may be placed in
3692
          the "History" section.  You may omit a network location for a
3693
          work that was published at least four years before the
3694
          Document itself, or if the original publisher of the version
3695
          it refers to gives permission.
3696
 
3697
       K. For any section Entitled "Acknowledgements" or "Dedications",
3698
          Preserve the Title of the section, and preserve in the
3699
          section all the substance and tone of each of the contributor
3700
          acknowledgements and/or dedications given therein.
3701
 
3702
       L. Preserve all the Invariant Sections of the Document,
3703
          unaltered in their text and in their titles.  Section numbers
3704
          or the equivalent are not considered part of the section
3705
          titles.
3706
 
3707
       M. Delete any section Entitled "Endorsements".  Such a section
3708
          may not be included in the Modified Version.
3709
 
3710
       N. Do not retitle any existing section to be Entitled
3711
          "Endorsements" or to conflict in title with any Invariant
3712
          Section.
3713
 
3714
       O. Preserve any Warranty Disclaimers.
3715
 
3716
     If the Modified Version includes new front-matter sections or
3717
     appendices that qualify as Secondary Sections and contain no
3718
     material copied from the Document, you may at your option
3719
     designate some or all of these sections as invariant.  To do this,
3720
     add their titles to the list of Invariant Sections in the Modified
3721
     Version's license notice.  These titles must be distinct from any
3722
     other section titles.
3723
 
3724
     You may add a section Entitled "Endorsements", provided it contains
3725
     nothing but endorsements of your Modified Version by various
3726
     parties--for example, statements of peer review or that the text
3727
     has been approved by an organization as the authoritative
3728
     definition of a standard.
3729
 
3730
     You may add a passage of up to five words as a Front-Cover Text,
3731
     and a passage of up to 25 words as a Back-Cover Text, to the end
3732
     of the list of Cover Texts in the Modified Version.  Only one
3733
     passage of Front-Cover Text and one of Back-Cover Text may be
3734
     added by (or through arrangements made by) any one entity.  If the
3735
     Document already includes a cover text for the same cover,
3736
     previously added by you or by arrangement made by the same entity
3737
     you are acting on behalf of, you may not add another; but you may
3738
     replace the old one, on explicit permission from the previous
3739
     publisher that added the old one.
3740
 
3741
     The author(s) and publisher(s) of the Document do not by this
3742
     License give permission to use their names for publicity for or to
3743
     assert or imply endorsement of any Modified Version.
3744
 
3745
  5. COMBINING DOCUMENTS
3746
 
3747
     You may combine the Document with other documents released under
3748
     this License, under the terms defined in section 4 above for
3749
     modified versions, provided that you include in the combination
3750
     all of the Invariant Sections of all of the original documents,
3751
     unmodified, and list them all as Invariant Sections of your
3752
     combined work in its license notice, and that you preserve all
3753
     their Warranty Disclaimers.
3754
 
3755
     The combined work need only contain one copy of this License, and
3756
     multiple identical Invariant Sections may be replaced with a single
3757
     copy.  If there are multiple Invariant Sections with the same name
3758
     but different contents, make the title of each such section unique
3759
     by adding at the end of it, in parentheses, the name of the
3760
     original author or publisher of that section if known, or else a
3761
     unique number.  Make the same adjustment to the section titles in
3762
     the list of Invariant Sections in the license notice of the
3763
     combined work.
3764
 
3765
     In the combination, you must combine any sections Entitled
3766
     "History" in the various original documents, forming one section
3767
     Entitled "History"; likewise combine any sections Entitled
3768
     "Acknowledgements", and any sections Entitled "Dedications".  You
3769
     must delete all sections Entitled "Endorsements."
3770
 
3771
  6. COLLECTIONS OF DOCUMENTS
3772
 
3773
     You may make a collection consisting of the Document and other
3774
     documents released under this License, and replace the individual
3775
     copies of this License in the various documents with a single copy
3776
     that is included in the collection, provided that you follow the
3777
     rules of this License for verbatim copying of each of the
3778
     documents in all other respects.
3779
 
3780
     You may extract a single document from such a collection, and
3781
     distribute it individually under this License, provided you insert
3782
     a copy of this License into the extracted document, and follow
3783
     this License in all other respects regarding verbatim copying of
3784
     that document.
3785
 
3786
  7. AGGREGATION WITH INDEPENDENT WORKS
3787
 
3788
     A compilation of the Document or its derivatives with other
3789
     separate and independent documents or works, in or on a volume of
3790
     a storage or distribution medium, is called an "aggregate" if the
3791
     copyright resulting from the compilation is not used to limit the
3792
     legal rights of the compilation's users beyond what the individual
3793
     works permit.  When the Document is included in an aggregate, this
3794
     License does not apply to the other works in the aggregate which
3795
     are not themselves derivative works of the Document.
3796
 
3797
     If the Cover Text requirement of section 3 is applicable to these
3798
     copies of the Document, then if the Document is less than one half
3799
     of the entire aggregate, the Document's Cover Texts may be placed
3800
     on covers that bracket the Document within the aggregate, or the
3801
     electronic equivalent of covers if the Document is in electronic
3802
     form.  Otherwise they must appear on printed covers that bracket
3803
     the whole aggregate.
3804
 
3805
  8. TRANSLATION
3806
 
3807
     Translation is considered a kind of modification, so you may
3808
     distribute translations of the Document under the terms of section
3809
     4.  Replacing Invariant Sections with translations requires special
3810
     permission from their copyright holders, but you may include
3811
     translations of some or all Invariant Sections in addition to the
3812
     original versions of these Invariant Sections.  You may include a
3813
     translation of this License, and all the license notices in the
3814
     Document, and any Warranty Disclaimers, provided that you also
3815
     include the original English version of this License and the
3816
     original versions of those notices and disclaimers.  In case of a
3817
     disagreement between the translation and the original version of
3818
     this License or a notice or disclaimer, the original version will
3819
     prevail.
3820
 
3821
     If a section in the Document is Entitled "Acknowledgements",
3822
     "Dedications", or "History", the requirement (section 4) to
3823
     Preserve its Title (section 1) will typically require changing the
3824
     actual title.
3825
 
3826
  9. TERMINATION
3827
 
3828
     You may not copy, modify, sublicense, or distribute the Document
3829
     except as expressly provided for under this License.  Any other
3830
     attempt to copy, modify, sublicense or distribute the Document is
3831
     void, and will automatically terminate your rights under this
3832
     License.  However, parties who have received copies, or rights,
3833
     from you under this License will not have their licenses
3834
     terminated so long as such parties remain in full compliance.
3835
 
3836
 10. FUTURE REVISIONS OF THIS LICENSE
3837
 
3838
     The Free Software Foundation may publish new, revised versions of
3839
     the GNU Free Documentation License from time to time.  Such new
3840
     versions will be similar in spirit to the present version, but may
3841
     differ in detail to address new problems or concerns.  See
3842
     `http://www.gnu.org/copyleft/'.
3843
 
3844
     Each version of the License is given a distinguishing version
3845
     number.  If the Document specifies that a particular numbered
3846
     version of this License "or any later version" applies to it, you
3847
     have the option of following the terms and conditions either of
3848
     that specified version or of any later version that has been
3849
     published (not as a draft) by the Free Software Foundation.  If
3850
     the Document does not specify a version number of this License,
3851
     you may choose any version ever published (not as a draft) by the
3852
     Free Software Foundation.
3853
 
3854
ADDENDUM: How to use this License for your documents
3855
====================================================
3856
 
3857
To use this License in a document you have written, include a copy of
3858
the License in the document and put the following copyright and license
3859
notices just after the title page:
3860
 
3861
       Copyright (C)  YEAR  YOUR NAME.
3862
       Permission is granted to copy, distribute and/or modify this document
3863
       under the terms of the GNU Free Documentation License, Version 1.2
3864
       or any later version published by the Free Software Foundation;
3865
       with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
3866
       Texts.  A copy of the license is included in the section entitled ``GNU
3867
       Free Documentation License''.
3868
 
3869
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
3870
replace the "with...Texts." line with this:
3871
 
3872
         with the Invariant Sections being LIST THEIR TITLES, with
3873
         the Front-Cover Texts being LIST, and with the Back-Cover Texts
3874
         being LIST.
3875
 
3876
If you have Invariant Sections without Cover Texts, or some other
3877
combination of the three, merge those two alternatives to suit the
3878
situation.
3879
 
3880
If your document contains nontrivial examples of program code, we
3881
recommend releasing these examples in parallel under your choice of
3882
free software license, such as the GNU General Public License, to
3883
permit their use in free software.
3884
 
3885

3886
File: or1ksim.info,  Node: Index,  Prev: GNU Free Documentation License,  Up: Top
3887
 
3888
Index
3889
*****
3890
 
3891
 
3892
* Menu:
3893
3894
* --cumulative:                          Profiling Utility.   (line  26)
3895
* --debug-config:                        Standalone Simulator.
3896 472 jeremybenn
                                                              (line  99)
3897 82 jeremybenn
* --disable-all-tests:                   Configuring the Build.
3898 127 jeremybenn
                                                              (line 105)
3899 19 jeremybenn
* --disable-arith-flag:                  Configuring the Build.
3900 127 jeremybenn
                                                              (line 118)
3901 124 jeremybenn
* --disable-debug:                       Configuring the Build.
3902 127 jeremybenn
                                                              (line  98)
3903 19 jeremybenn
* --disable-ethphy:                      Configuring the Build.
3904 104 jeremybenn
                                                              (line  59)
3905 19 jeremybenn
* --disable-ov-flag:                     Configuring the Build.
3906 127 jeremybenn
                                                              (line 133)
3907 19 jeremybenn
* --disable-profiling:                   Configuring the Build.
3908 104 jeremybenn
                                                              (line  30)
3909 19 jeremybenn
* --disable-range-stats:                 Configuring the Build.
3910 127 jeremybenn
                                                              (line  92)
3911
* --disable-unsigned-xori:               Configuring the Build.
3912 104 jeremybenn
                                                              (line  69)
3913 82 jeremybenn
* --enable-all-tests:                    Configuring the Build.
3914 127 jeremybenn
                                                              (line 104)
3915 19 jeremybenn
* --enable-arith-flag:                   Configuring the Build.
3916 127 jeremybenn
                                                              (line 117)
3917 124 jeremybenn
* --enable-debug:                        Configuring the Build.
3918 127 jeremybenn
                                                              (line  97)
3919 19 jeremybenn
* --enable-ethphy:                       Configuring the Build.
3920 104 jeremybenn
                                                              (line  58)
3921 19 jeremybenn
* --enable-execution:                    Configuring the Build.
3922 104 jeremybenn
                                                              (line  37)
3923 19 jeremybenn
* --enable-mprofile:                     Standalone Simulator.
3924 472 jeremybenn
                                                              (line 133)
3925 19 jeremybenn
* --enable-ov-flag:                      Configuring the Build.
3926 127 jeremybenn
                                                              (line 132)
3927 19 jeremybenn
* --enable-profile:                      Standalone Simulator.
3928 472 jeremybenn
                                                              (line 130)
3929 19 jeremybenn
* --enable-profiling:                    Configuring the Build.
3930 104 jeremybenn
                                                              (line  29)
3931 19 jeremybenn
* --enable-range-stats:                  Configuring the Build.
3932 127 jeremybenn
                                                              (line  91)
3933
* --enable-unsigned-xori:                Configuring the Build.
3934 104 jeremybenn
                                                              (line  68)
3935 19 jeremybenn
* --file:                                Standalone Simulator.
3936 472 jeremybenn
                                                              (line  57)
3937 19 jeremybenn
* --filename:                            Memory Profiling Utility.
3938
                                                              (line  51)
3939
* --generate:                            Profiling Utility.   (line  34)
3940
* --group:                               Memory Profiling Utility.
3941
                                                              (line  47)
3942
* --help:                                Standalone Simulator.
3943 346 jeremybenn
                                                              (line  21)
3944 19 jeremybenn
* --help (memory profiling utility):     Memory Profiling Utility.
3945
                                                              (line  22)
3946
* --help (profiling utility):            Profiling Utility.   (line  22)
3947
* --interactive:                         Standalone Simulator.
3948 346 jeremybenn
                                                              (line  25)
3949
* --memory:                              Standalone Simulator.
3950 472 jeremybenn
                                                              (line  83)
3951 19 jeremybenn
* --mode:                                Memory Profiling Utility.
3952
                                                              (line  26)
3953
* --nosrv:                               Standalone Simulator.
3954 472 jeremybenn
                                                              (line  65)
3955 346 jeremybenn
* --quiet <1>:                           Profiling Utility.   (line  30)
3956
* --quiet:                               Standalone Simulator.
3957
                                                              (line  29)
3958
* --report-memory-errors:                Standalone Simulator.
3959 472 jeremybenn
                                                              (line 104)
3960 19 jeremybenn
* --srv:                                 Standalone Simulator.
3961 472 jeremybenn
                                                              (line  73)
3962 19 jeremybenn
* --strict-npc:                          Standalone Simulator.
3963 472 jeremybenn
                                                              (line 113)
3964
* --trace <1>:                           Trace Generation.    (line  14)
3965 420 jeremybenn
* --trace:                               Standalone Simulator.
3966
                                                              (line  39)
3967 472 jeremybenn
* --trace-physical <1>:                  Trace Generation.    (line  44)
3968
* --trace-physical:                      Standalone Simulator.
3969
                                                              (line  44)
3970
* --trace-virtual <1>:                   Trace Generation.    (line  44)
3971
* --trace-virtual:                       Standalone Simulator.
3972
                                                              (line  44)
3973 346 jeremybenn
* --verbose:                             Standalone Simulator.
3974
                                                              (line  33)
3975 19 jeremybenn
* --version:                             Standalone Simulator.
3976 346 jeremybenn
                                                              (line  17)
3977 19 jeremybenn
* --version (memory profiling utility):  Memory Profiling Utility.
3978
                                                              (line  17)
3979
* --version (profiling utility):         Profiling Utility.   (line  17)
3980
* -c:                                    Profiling Utility.   (line  26)
3981
* -d:                                    Standalone Simulator.
3982 472 jeremybenn
                                                              (line  99)
3983 19 jeremybenn
* -f <1>:                                Memory Profiling Utility.
3984
                                                              (line  51)
3985
* -f:                                    Standalone Simulator.
3986 472 jeremybenn
                                                              (line  57)
3987 346 jeremybenn
* -g <1>:                                Memory Profiling Utility.
3988 19 jeremybenn
                                                              (line  47)
3989 346 jeremybenn
* -g:                                    Profiling Utility.   (line  34)
3990 19 jeremybenn
* -h:                                    Standalone Simulator.
3991 346 jeremybenn
                                                              (line  21)
3992 19 jeremybenn
* -h (memory profiling utility):         Memory Profiling Utility.
3993
                                                              (line  22)
3994
* -h (profiling utility):                Profiling Utility.   (line  22)
3995
* -i:                                    Standalone Simulator.
3996 346 jeremybenn
                                                              (line  25)
3997
* -m <1>:                                Memory Profiling Utility.
3998 19 jeremybenn
                                                              (line  26)
3999 346 jeremybenn
* -m:                                    Standalone Simulator.
4000 472 jeremybenn
                                                              (line  83)
4001 346 jeremybenn
* -q <1>:                                Profiling Utility.   (line  30)
4002
* -q:                                    Standalone Simulator.
4003
                                                              (line  29)
4004 472 jeremybenn
* -t <1>:                                Trace Generation.    (line  14)
4005 420 jeremybenn
* -t:                                    Standalone Simulator.
4006
                                                              (line  39)
4007 346 jeremybenn
* -V:                                    Standalone Simulator.
4008
                                                              (line  33)
4009 19 jeremybenn
* -v:                                    Standalone Simulator.
4010 346 jeremybenn
                                                              (line  17)
4011 19 jeremybenn
* -v (memory profiling utility):         Memory Profiling Utility.
4012
                                                              (line  17)
4013
* -v (profiling utility):                Profiling Utility.   (line  17)
4014
* 0x00 UART VAPI sub-command (UART verification): Verification API.
4015
                                                              (line  49)
4016
* 0x01 UART VAPI sub-command (UART verification): Verification API.
4017
                                                              (line  55)
4018
* 0x02 UART VAPI sub-command (UART verification): Verification API.
4019
                                                              (line  59)
4020
* 0x03 UART VAPI sub-command (UART verification): Verification API.
4021
                                                              (line  62)
4022
* 0x04 UART VAPI sub-command (UART verification): Verification API.
4023
                                                              (line  66)
4024
* 16550 (UART configuration):            UART Configuration.  (line  73)
4025 82 jeremybenn
* all tests enabled:                     Configuring the Build.
4026 127 jeremybenn
                                                              (line 105)
4027 19 jeremybenn
* Argtable2 debugging:                   Configuring the Build.
4028 127 jeremybenn
                                                              (line  98)
4029 19 jeremybenn
* ATA/ATAPI configuration:               Disc Interface Configuration.
4030
                                                              (line   6)
4031
* ATA/ATAPI device configuration:        Disc Interface Configuration.
4032 385 jeremybenn
                                                              (line  92)
4033 19 jeremybenn
* base_vapi_id (GPIO configuration - deprecated): GPIO Configuration.
4034
                                                              (line  32)
4035
* baseaddr (ATA/ATAPI configuration):    Disc Interface Configuration.
4036 385 jeremybenn
                                                              (line  26)
4037 19 jeremybenn
* baseaddr (DMA configuration):          DMA Configuration.   (line  24)
4038
* baseaddr (Ethernet configuration):     Ethernet Configuration.
4039 440 jeremybenn
                                                              (line  23)
4040 19 jeremybenn
* baseaddr (frame buffer configuration): Frame Buffer Configuration.
4041
                                                              (line  20)
4042
* baseaddr (generic peripheral configuration): Generic Peripheral Configuration.
4043
                                                              (line  22)
4044
* baseaddr (GPIO configuration):         GPIO Configuration.  (line  21)
4045
* baseaddr (keyboard configuration):     Keyboard Configuration.
4046
                                                              (line  36)
4047
* baseaddr (memory configuration):       Memory Configuration.
4048 418 julius
                                                              (line  94)
4049 19 jeremybenn
* baseaddr (memory controller configuration): Memory Controller Configuration.
4050 385 jeremybenn
                                                              (line  55)
4051 19 jeremybenn
* baseaddr (UART configuration):         UART Configuration.  (line  22)
4052
* baseaddr (VGA configuration):          Display Interface Configuration.
4053
                                                              (line  26)
4054
* blocksize (cache configuration):       Cache Configuration. (line  29)
4055
* BPB configuration:                     Branch Prediction Configuration.
4056
                                                              (line   6)
4057
* branch prediction configuration:       Branch Prediction Configuration.
4058
                                                              (line   6)
4059
* break (Interactive CLI):               Interactive Command Line.
4060
                                                              (line  57)
4061
* breakpoint list (Interactive CLI):     Interactive Command Line.
4062
                                                              (line  60)
4063
* breakpoint set/clear (Interactive CLI): Interactive Command Line.
4064
                                                              (line  57)
4065
* breaks (Interactive CLI):              Interactive Command Line.
4066
                                                              (line  60)
4067 440 jeremybenn
* bridge setup:                          Establishing a Bridge.
4068
                                                              (line   6)
4069 19 jeremybenn
* btic (branch prediction configuration): Branch Prediction Configuration.
4070
                                                              (line  19)
4071 440 jeremybenn
* BusyBox and Ethernet:                  Networking from OpenRISC Linux and BusyBox.
4072
                                                              (line   6)
4073 19 jeremybenn
* byte_enabled (generic peripheral configuration): Generic Peripheral Configuration.
4074
                                                              (line  48)
4075
* cache configuration:                   Cache Configuration. (line   6)
4076 346 jeremybenn
* calling_convention (CUC configuration): CUC Configuration.  (line  37)
4077 19 jeremybenn
* ce (memory configuration):             Memory Configuration.
4078 418 julius
                                                              (line 124)
4079 19 jeremybenn
* cfgr (CPU configuration):              CPU Configuration.   (line  47)
4080
* channel (UART configuration):          UART Configuration.  (line  29)
4081
* clear breakpoint (Interactive CLI):    Interactive Command Line.
4082
                                                              (line  57)
4083 432 jeremybenn
* clear_interrupt:                       Concepts.            (line  20)
4084 202 julius
* clkcycle (simulator configuration):    Simulator Behavior.  (line 115)
4085 19 jeremybenn
* cm (Interactive CLI):                  Interactive Command Line.
4086
                                                              (line  54)
4087
* command line for Or1ksim standalone use: Standalone Simulator.
4088
                                                              (line   6)
4089
* complex model:                         Configuring the Build.
4090 104 jeremybenn
                                                              (line  37)
4091 19 jeremybenn
* config:                                Global Data Structures.
4092
                                                              (line   7)
4093
* config.bpb:                            Global Data Structures.
4094
                                                              (line  37)
4095
* config.cpu:                            Global Data Structures.
4096
                                                              (line  22)
4097
* config.cuc:                            Global Data Structures.
4098
                                                              (line  18)
4099
* config.dc:                             Global Data Structures.
4100
                                                              (line  25)
4101
* config.debug:                          Global Data Structures.
4102
                                                              (line  40)
4103
* config.pic:                            Global Data Structures.
4104
                                                              (line  33)
4105
* config.pm:                             Global Data Structures.
4106
                                                              (line  29)
4107
* config.sim:                            Global Data Structures.
4108
                                                              (line  11)
4109
* config.vapi:                           Global Data Structures.
4110
                                                              (line  14)
4111
* configuration dynamic structure:       Global Data Structures.
4112
                                                              (line  49)
4113
* configuration file structure:          Configuration File Format.
4114
                                                              (line   6)
4115
* configuration global structure:        Global Data Structures.
4116
                                                              (line   7)
4117
* configuration info (Interactive CLI):  Interactive Command Line.
4118
                                                              (line 119)
4119
* configuration of generic peripherals:  Generic Peripheral Configuration.
4120
                                                              (line   6)
4121
* configuration parameter setting (Interactive CLI): Interactive Command Line.
4122
                                                              (line 146)
4123
* configuring branch prediction:         Branch Prediction Configuration.
4124
                                                              (line   6)
4125
* configuring data & instruction caches: Cache Configuration. (line   6)
4126
* configuring data & instruction MMUs:   Memory Management Configuration.
4127
                                                              (line   6)
4128
* configuring DMA:                       DMA Configuration.   (line   6)
4129
* configuring memory:                    Memory Configuration.
4130
                                                              (line   6)
4131
* configuring Or1ksim:                   Configuration.       (line   6)
4132
* configuring power management:          Power Management Configuration.
4133
                                                              (line   6)
4134
* configuring the ATA/ATAPI interfaces:  Disc Interface Configuration.
4135
                                                              (line   6)
4136
* configuring the behavior of Or1ksim:   Simulator Behavior.  (line   6)
4137
* configuring the CPU:                   CPU Configuration.   (line   6)
4138
* configuring the Custom Unit Compiler (CUC): CUC Configuration.
4139
                                                              (line   6)
4140
* configuring the debug unit and interface to external debuggers: Debug Interface Configuration.
4141
                                                              (line   6)
4142
* configuring the Ethernet interface:    Ethernet Configuration.
4143
                                                              (line   6)
4144 440 jeremybenn
* configuring the Ethernet TUN/TAP interface: Ethernet TUN/TAP Interface.
4145
                                                              (line   6)
4146 19 jeremybenn
* configuring the frame buffer:          Frame Buffer Configuration.
4147
                                                              (line   6)
4148
* configuring the GPIO:                  GPIO Configuration.  (line   6)
4149
* configuring the interrupt controller:  Interrupt Configuration.
4150
                                                              (line   6)
4151
* configuring the keyboard interface:    Keyboard Configuration.
4152
                                                              (line   6)
4153
* configuring the memory controller:     Memory Controller Configuration.
4154
                                                              (line   6)
4155
* configuring the processor:             CPU Configuration.   (line   6)
4156
* configuring the PS2 interface:         Keyboard Configuration.
4157
                                                              (line   6)
4158
* configuring the UART:                  UART Configuration.  (line   6)
4159
* configuring the Verification API (VAPI): Verification API Configuration.
4160
                                                              (line   6)
4161
* configuring the VGA interface:         Display Interface Configuration.
4162
                                                              (line   6)
4163
* copying memory (Interactive CLI):      Interactive Command Line.
4164
                                                              (line  54)
4165
* CPU configuration:                     CPU Configuration.   (line   6)
4166
* CUC configuration:                     CUC Configuration.   (line   6)
4167
* Custom Unit Compiler (Interactive CLI): Interactive Command Line.
4168
                                                              (line 162)
4169
* Custom Unit Compiler Configuration:    CUC Configuration.   (line   6)
4170
* data cache configuration:              Cache Configuration. (line   6)
4171
* data MMU configuration:                Memory Management Configuration.
4172
                                                              (line   6)
4173
* DCGE (power management register):      Power Management Configuration.
4174
                                                              (line  21)
4175
* debug (Interactive CLI):               Interactive Command Line.
4176 346 jeremybenn
                                                              (line 151)
4177 19 jeremybenn
* debug (simulator configuration):       Simulator Behavior.  (line  13)
4178
* debug channel toggle (Interactive CLI): Interactive Command Line.
4179
                                                              (line 141)
4180
* debug interface configuration:         Debug Interface Configuration.
4181
                                                              (line   6)
4182
* debug mode toggle (Interactive CLI):   Interactive Command Line.
4183
                                                              (line 151)
4184
* debug unit configuration:              Debug Interface Configuration.
4185
                                                              (line   6)
4186
* Debug Unit verification (VAPI):        Verification API.    (line  34)
4187
* debugging enabled (Argtable2):         Configuring the Build.
4188 127 jeremybenn
                                                              (line  98)
4189 104 jeremybenn
* DejaGnu board configurations:          Regression Testing.  (line  35)
4190
* DejaGnu configuration:                 Regression Testing.  (line  21)
4191
* DejaGNU tests directories:             Regression Testing.  (line  50)
4192
* DejaGnu tool specific configuration:   Regression Testing.  (line  39)
4193 19 jeremybenn
* delayr (memory configuration):         Memory Configuration.
4194 418 julius
                                                              (line 144)
4195 19 jeremybenn
* delayw (memory configuration):         Memory Configuration.
4196 418 julius
                                                              (line 150)
4197 98 jeremybenn
* dependstats (CPU configuration):       CPU Configuration.   (line  89)
4198 19 jeremybenn
* dev_id (ATA/ATAPI configuration):      Disc Interface Configuration.
4199 385 jeremybenn
                                                              (line  40)
4200 19 jeremybenn
* disassemble (Interactive CLI):         Interactive Command Line.
4201
                                                              (line  41)
4202
* disc interface configuration:          Disc Interface Configuration.
4203
                                                              (line   6)
4204
* disc interface device configuration:   Disc Interface Configuration.
4205 385 jeremybenn
                                                              (line  92)
4206 19 jeremybenn
* display interface configuration:       Display Interface Configuration.
4207
                                                              (line   6)
4208
* displaying memory (Interactive CLI):   Interactive Command Line.
4209
                                                              (line  31)
4210
* displaying registers (Interactive CLI): Interactive Command Line.
4211
                                                              (line  14)
4212
* dm (Interactive CLI):                  Interactive Command Line.
4213
                                                              (line  31)
4214
* dma (Ethernet configuration):          Ethernet Configuration.
4215 440 jeremybenn
                                                              (line  34)
4216 19 jeremybenn
* DMA configuration:                     DMA Configuration.   (line   6)
4217
* DMA verification (VAPI):               Verification API.    (line  73)
4218
* dma_mode0_td (ATA/ATAPI configuration): Disc Interface Configuration.
4219 385 jeremybenn
                                                              (line  74)
4220 19 jeremybenn
* dma_mode0_teoc (ATA/ATAPI configuration): Disc Interface Configuration.
4221 385 jeremybenn
                                                              (line  75)
4222 19 jeremybenn
* dma_mode0_tm (ATA/ATAPI configuration): Disc Interface Configuration.
4223 385 jeremybenn
                                                              (line  73)
4224 19 jeremybenn
* DME (power management register):       Power Management Configuration.
4225
                                                              (line  15)
4226
* DMMU configuration:                    Memory Management Configuration.
4227
                                                              (line   6)
4228
* doze mode (power management register): Power Management Configuration.
4229
                                                              (line  15)
4230 451 jeremybenn
* dummy_crc (Ethernet configuration):    Ethernet Configuration.
4231
                                                              (line 104)
4232 19 jeremybenn
* dv (Interactive CLI):                  Interactive Command Line.
4233
                                                              (line 124)
4234
* dynamic clock gating (power management register): Power Management Configuration.
4235
                                                              (line  21)
4236
* dynamic model:                         Configuring the Build.
4237 104 jeremybenn
                                                              (line  37)
4238 19 jeremybenn
* dynamic ports, use of:                 Verification API Configuration.
4239
                                                              (line  23)
4240
* edge_trigger (interrupt controller):   Interrupt Configuration.
4241
                                                              (line  16)
4242 346 jeremybenn
* enable_bursts (CUC configuration):     CUC Configuration.   (line  41)
4243 19 jeremybenn
* enabled (ATA/ATAPI configuration):     Disc Interface Configuration.
4244 385 jeremybenn
                                                              (line  22)
4245 19 jeremybenn
* enabled (branch prediction configuration): Branch Prediction Configuration.
4246
                                                              (line  15)
4247
* enabled (cache configuration):         Cache Configuration. (line  11)
4248
* enabled (debug interface configuration): Debug Interface Configuration.
4249
                                                              (line  11)
4250
* enabled (DMA configuration):           DMA Configuration.   (line  20)
4251
* enabled (Ethernet configuration):      Ethernet Configuration.
4252 440 jeremybenn
                                                              (line  19)
4253 19 jeremybenn
* enabled (frame buffer configuration):  Frame Buffer Configuration.
4254
                                                              (line  16)
4255
* enabled (generic peripheral configuration): Generic Peripheral Configuration.
4256
                                                              (line  18)
4257
* enabled (GPIO configuration):          GPIO Configuration.  (line  17)
4258
* enabled (interrupt controller):        Interrupt Configuration.
4259
                                                              (line  12)
4260
* enabled (keyboard configuration):      Keyboard Configuration.
4261
                                                              (line  32)
4262
* enabled (memory controller configuration): Memory Controller Configuration.
4263 385 jeremybenn
                                                              (line  44)
4264 19 jeremybenn
* enabled (MMU configuration):           Memory Management Configuration.
4265
                                                              (line  12)
4266
* enabled (power management configuration): Power Management Configuration.
4267
                                                              (line  35)
4268
* enabled (UART configuration):          UART Configuration.  (line  18)
4269
* enabled (verification API configuration): Verification API Configuration.
4270
                                                              (line  15)
4271
* enabled (VGA configuration):           Display Interface Configuration.
4272
                                                              (line  22)
4273
* enabling Ethernet via socket:          Configuring the Build.
4274 104 jeremybenn
                                                              (line  59)
4275 19 jeremybenn
* entrysize (MMU configuration):         Memory Management Configuration.
4276
                                                              (line  32)
4277
* ETH_VAPI_CTRL (Ethernet verification): Verification API.    (line  86)
4278
* ETH_VAPI_DATA (Ethernet verification): Verification API.    (line  84)
4279 440 jeremybenn
* Ethernet bridge setup:                 Establishing a Bridge.
4280
                                                              (line   6)
4281 19 jeremybenn
* Ethernet configuration:                Ethernet Configuration.
4282
                                                              (line   6)
4283
* Ethernet verification (VAPI):          Verification API.    (line  78)
4284
* Ethernet via socket, enabling:         Configuring the Build.
4285 104 jeremybenn
                                                              (line  59)
4286 127 jeremybenn
* exclusive-OR immediate operand:        Configuring the Build.
4287
                                                              (line  69)
4288 202 julius
* exe_bin_insn_log (simulator configuration): Simulator Behavior.
4289
                                                              (line 103)
4290
* exe_bin_insn_log_file (simulator configuration): Simulator Behavior.
4291
                                                              (line 111)
4292 82 jeremybenn
* exe_log (simulator configuration):     Simulator Behavior.  (line  49)
4293
* exe_log_end (simulator configuration): Simulator Behavior.  (line  89)
4294
* exe_log_file (simulator configuration): Simulator Behavior. (line  97)
4295 19 jeremybenn
* exe_log_fn (simulator configuration - deprecated): Simulator Behavior.
4296 82 jeremybenn
                                                              (line  97)
4297 19 jeremybenn
* exe_log_marker (simulator configuration): Simulator Behavior.
4298 82 jeremybenn
                                                              (line  93)
4299 19 jeremybenn
* exe_log_start (simulator configuration): Simulator Behavior.
4300 82 jeremybenn
                                                              (line  86)
4301
* exe_log_type (simulator configuration): Simulator Behavior. (line  55)
4302 19 jeremybenn
* exe_log_type=default (simulator configuration): Simulator Behavior.
4303 82 jeremybenn
                                                              (line  58)
4304 19 jeremybenn
* exe_log_type=hardware (simulator configuration): Simulator Behavior.
4305 82 jeremybenn
                                                              (line  62)
4306 19 jeremybenn
* exe_log_type=simple (simulator configuration): Simulator Behavior.
4307 82 jeremybenn
                                                              (line  69)
4308 19 jeremybenn
* exe_log_type=software (simulator configuration): Simulator Behavior.
4309 82 jeremybenn
                                                              (line  74)
4310 19 jeremybenn
* executing code (Interactive CLI):      Interactive Command Line.
4311
                                                              (line  23)
4312
* execution history (Interactive CLI):   Interactive Command Line.
4313
                                                              (line  67)
4314
* file (ATA/ATAPI device configuration): Disc Interface Configuration.
4315 385 jeremybenn
                                                              (line 108)
4316 19 jeremybenn
* file (keyboard configuration):         Keyboard Configuration.
4317
                                                              (line  51)
4318
* filename (frame buffer configuration - deprecated): Frame Buffer Configuration.
4319 82 jeremybenn
                                                              (line  36)
4320 19 jeremybenn
* filename (VGA configuration - deprecated): Display Interface Configuration.
4321
                                                              (line  47)
4322 440 jeremybenn
* firewall with Ethernet bridge and TAP/TUN: Opening the Firewall.
4323
                                                              (line   6)
4324 19 jeremybenn
* firmware (ATA/ATAPI device configuration): Disc Interface Configuration.
4325 385 jeremybenn
                                                              (line 121)
4326 19 jeremybenn
* flag setting by instructions:          Configuring the Build.
4327 127 jeremybenn
                                                              (line 118)
4328 19 jeremybenn
* frame buffer configuration:            Frame Buffer Configuration.
4329
                                                              (line   6)
4330
* generic peripheral configuration:      Generic Peripheral Configuration.
4331
                                                              (line   6)
4332
* GPIO configuration:                    GPIO Configuration.  (line   6)
4333
* GPIO verification (VAPI):              Verification API.    (line  88)
4334
* GPIO_VAPI_AUX (GPIO verification):     Verification API.    (line 100)
4335
* GPIO_VAPI_CLOCK (GPIO verification):   Verification API.    (line 103)
4336
* GPIO_VAPI_CTRL (GPIO verification):    Verification API.    (line 119)
4337
* GPIO_VAPI_DATA (GPIO verification):    Verification API.    (line  97)
4338
* GPIO_VAPI_INTE (GPIO verification):    Verification API.    (line 110)
4339
* GPIO_VAPI_PTRIG (GPIO verification):   Verification API.    (line 113)
4340
* GPIO_VAPI_RGPIO (GPIO verification):   Verification API.    (line 107)
4341 100 julius
* hardfloat (CPU configuration):         CPU Configuration.   (line 110)
4342 98 jeremybenn
* hazards (CPU configuration):           CPU Configuration.   (line  74)
4343 19 jeremybenn
* heads (ATA/ATAPI device configuration): Disc Interface Configuration.
4344 385 jeremybenn
                                                              (line 125)
4345 19 jeremybenn
* help (Interactive CLI):                Interactive Command Line.
4346
                                                              (line 170)
4347
* hexadecimal memory dump (Interactive CLI): Interactive Command Line.
4348
                                                              (line 133)
4349
* hide_device_id (verification API configuration): Verification API Configuration.
4350
                                                              (line  36)
4351
* hist (Interactive CLI):                Interactive Command Line.
4352
                                                              (line  67)
4353 82 jeremybenn
* history (simulator configuration):     Simulator Behavior.  (line  40)
4354 19 jeremybenn
* history of execution (Interactive CLI): Interactive Command Line.
4355
                                                              (line  67)
4356
* hitdelay (branch prediction configuration): Branch Prediction Configuration.
4357
                                                              (line  33)
4358
* hitdelay (instruction cache configuration): Cache Configuration.
4359
                                                              (line  38)
4360
* hitdelay (MMU configuration):          Memory Management Configuration.
4361
                                                              (line  51)
4362 104 jeremybenn
* host test code:                        Regression Testing.  (line  57)
4363 19 jeremybenn
* hw_enabled (generic peripheral configuration): Generic Peripheral Configuration.
4364
                                                              (line  49)
4365
* IMMU configuration:                    Memory Management Configuration.
4366
                                                              (line   6)
4367
* index (memory controller configuration): Memory Controller Configuration.
4368 385 jeremybenn
                                                              (line  77)
4369 19 jeremybenn
* info (Interactive CLI):                Interactive Command Line.
4370
                                                              (line 119)
4371
* installing Or1ksim:                    Installation.        (line   6)
4372
* instruction cache configuration:       Cache Configuration. (line   6)
4373
* instruction MMU configuration:         Memory Management Configuration.
4374
                                                              (line   6)
4375
* instruction profiling for Or1ksim:     Profiling Utility.   (line   6)
4376
* instruction profiling utility (Interactive CLI): Interactive Command Line.
4377
                                                              (line 178)
4378
* internal debugging:                    Internal Debugging.  (line   6)
4379
* interrupt controller configuration:    Interrupt Configuration.
4380
                                                              (line   6)
4381 432 jeremybenn
* interrupts:                            Concepts.            (line  20)
4382 19 jeremybenn
* irq (ATA/ATAPI configuration):         Disc Interface Configuration.
4383 385 jeremybenn
                                                              (line  36)
4384 19 jeremybenn
* irq (DMA configuration):               DMA Configuration.   (line  34)
4385
* irq (GPIO configuration):              GPIO Configuration.  (line  29)
4386
* irq (keyboard configuration):          Keyboard Configuration.
4387
                                                              (line  47)
4388
* irq (UART configuration):              UART Configuration.  (line  70)
4389
* irq (VGA configuration):               Display Interface Configuration.
4390
                                                              (line  37)
4391
* jitter (UART configuration):           UART Configuration.  (line  78)
4392
* keyboard configuration:                Keyboard Configuration.
4393
                                                              (line   6)
4394 460 jeremybenn
* l.nop 0:                               l.nop Support.       (line  12)
4395
* l.nop 1 (end simulation):              l.nop Support.       (line  15)
4396 483 jeremybenn
* l.nop 10 (return a random number):     l.nop Support.       (line  51)
4397
* l.nop 11 (return a non-zero value):    l.nop Support.       (line  62)
4398 460 jeremybenn
* l.nop 2 (report):                      l.nop Support.       (line  19)
4399
* l.nop 3 (printf, now obsolete):        l.nop Support.       (line  22)
4400
* l.nop 4 (putc):                        l.nop Support.       (line  29)
4401
* l.nop 5 (reset statistics counters):   l.nop Support.       (line  34)
4402
* l.nop 6 (get clock ticks):             l.nop Support.       (line  37)
4403
* l.nop 7 (get picoseconds per cycle):   l.nop Support.       (line  41)
4404 472 jeremybenn
* l.nop 8 (turn off tracing):            Trace Generation.    (line  40)
4405
* l.nop 8 (turn on tracing) <1>:         l.nop Support.       (line  45)
4406
* l.nop 8 (turn on tracing):             Trace Generation.    (line  40)
4407 460 jeremybenn
* l.nop 9 (turn off tracing):            l.nop Support.       (line  48)
4408
* l.nop opcode effects:                  l.nop Support.       (line   6)
4409 19 jeremybenn
* library version of Or1ksim:            Simulator Library.   (line   6)
4410
* license for Or1ksim:                   GNU Free Documentation License.
4411
                                                              (line   6)
4412 440 jeremybenn
* Linux (OpenRISC) and Ethernet:         Networking from OpenRISC Linux and BusyBox.
4413
                                                              (line   6)
4414 19 jeremybenn
* list breakpoints (Interactive CLI):    Interactive Command Line.
4415
                                                              (line  60)
4416
* load_hitdelay (data cache configuration): Cache Configuration.
4417
                                                              (line  46)
4418
* load_missdelay (data cache configuration): Cache Configuration.
4419
                                                              (line  50)
4420
* log (memory configuration):            Memory Configuration.
4421 418 julius
                                                              (line 156)
4422 19 jeremybenn
* log_enabled (verification API configuration): Verification API Configuration.
4423
                                                              (line  28)
4424 432 jeremybenn
* long:                                  Simulator Library.   (line  94)
4425 104 jeremybenn
* make file for tests:                   Regression Testing.  (line  27)
4426 19 jeremybenn
* mc (memory configuration):             Memory Configuration.
4427 418 julius
                                                              (line 133)
4428 19 jeremybenn
* memory configuration:                  Memory Configuration.
4429
                                                              (line   6)
4430
* memory controller configuration:       Memory Controller Configuration.
4431
                                                              (line   6)
4432
* memory copying (Interactive CLI):      Interactive Command Line.
4433
                                                              (line  54)
4434
* memory display (Interactive CLI):      Interactive Command Line.
4435
                                                              (line  31)
4436
* memory dump, hexadecimal (Interactive CLI): Interactive Command Line.
4437
                                                              (line 133)
4438
* memory dump, Verilog (Interactive CLI): Interactive Command Line.
4439
                                                              (line 124)
4440
* memory patching (Interactive CLI):     Interactive Command Line.
4441
                                                              (line  48)
4442
* memory profiling end address:          Memory Profiling Utility.
4443
                                                              (line  56)
4444
* memory profiling start address:        Memory Profiling Utility.
4445
                                                              (line  56)
4446
* memory profiling utility (Interactive CLI): Interactive Command Line.
4447
                                                              (line 173)
4448
* memory profiling version of Or1ksim:   Memory Profiling Utility.
4449
                                                              (line   6)
4450
* memory_order (CUC configuration):      CUC Configuration.   (line  15)
4451 346 jeremybenn
* memory_order=exact (CUC configuration): CUC Configuration.  (line  30)
4452 19 jeremybenn
* memory_order=none (CUC configuration): CUC Configuration.   (line  18)
4453 346 jeremybenn
* memory_order=strong (CUC configuration): CUC Configuration. (line  27)
4454
* memory_order=weak (CUC configuration): CUC Configuration.   (line  22)
4455 19 jeremybenn
* missdelay (branch prediction configuration): Branch Prediction Configuration.
4456
                                                              (line  37)
4457
* missdelay (instruction cache configuration): Cache Configuration.
4458
                                                              (line  42)
4459
* missdelay (MMU configuration):         Memory Management Configuration.
4460
                                                              (line  55)
4461
* MMU configuration:                     Memory Management Configuration.
4462
                                                              (line   6)
4463 82 jeremybenn
* mprof_file (simulator configuration):  Simulator Behavior.  (line  34)
4464 19 jeremybenn
* mprof_fn (simulator configuration - deprecated): Simulator Behavior.
4465 82 jeremybenn
                                                              (line  34)
4466 19 jeremybenn
* mprofile (Interactive CLI):            Interactive Command Line.
4467 346 jeremybenn
                                                              (line 173)
4468 82 jeremybenn
* mprofile (simulator configuration):    Simulator Behavior.  (line  29)
4469 432 jeremybenn
* mtspr:                                 Concepts.            (line  20)
4470 19 jeremybenn
* mwdma (ATA/ATAPI device configuration): Disc Interface Configuration.
4471 385 jeremybenn
                                                              (line 132)
4472 19 jeremybenn
* name (generic peripheral configuration): Generic Peripheral Configuration.
4473
                                                              (line  42)
4474
* name (memory configuration):           Memory Configuration.
4475 418 julius
                                                              (line 115)
4476 346 jeremybenn
* no_multicycle (CUC configuration):     CUC Configuration.   (line  45)
4477 19 jeremybenn
* nsets (cache configuration):           Cache Configuration. (line  15)
4478
* nsets (MMU configuration):             Memory Management Configuration.
4479
                                                              (line  16)
4480
* nways (cache configuration):           Cache Configuration. (line  22)
4481
* nways (MMU configuration):             Memory Management Configuration.
4482
                                                              (line  22)
4483 432 jeremybenn
* or1ksim_get_time_period:               Simulator Library.   (line  84)
4484
* or1ksim_init:                          Simulator Library.   (line  19)
4485
* or1ksim_interrupt:                     Simulator Library.   (line  99)
4486
* or1ksim_interrupt_clear:               Simulator Library.   (line 121)
4487
* or1ksim_interrupt_set:                 Simulator Library.   (line 110)
4488
* or1ksim_is_le:                         Simulator Library.   (line  89)
4489
* or1ksim_jtag_reset:                    Simulator Library.   (line 130)
4490
* or1ksim_jtag_shift_dr:                 Simulator Library.   (line 152)
4491
* or1ksim_jtag_shift_ir:                 Simulator Library.   (line 139)
4492
* or1ksim_read_mem:                      Simulator Library.   (line 165)
4493
* or1ksim_read_reg:                      Simulator Library.   (line 197)
4494 346 jeremybenn
* or1ksim_read_spr:                      Simulator Library.   (line 181)
4495 432 jeremybenn
* or1ksim_reset_duration:                Simulator Library.   (line  69)
4496
* or1ksim_run:                           Simulator Library.   (line  58)
4497
* or1ksim_set_stall_state:               Simulator Library.   (line 212)
4498
* or1ksim_set_time_point:                Simulator Library.   (line  80)
4499
* or1ksim_write_mem:                     Simulator Library.   (line 173)
4500
* or1ksim_write_reg:                     Simulator Library.   (line 205)
4501
* or1ksim_write_spr:                     Simulator Library.   (line 189)
4502 19 jeremybenn
* output rediretion:                     Concepts.            (line   7)
4503
* overflow flag setting by instructions: Configuring the Build.
4504 127 jeremybenn
                                                              (line 133)
4505 19 jeremybenn
* packet (ATA/ATAPI device configuration): Disc Interface Configuration.
4506 385 jeremybenn
                                                              (line 117)
4507 19 jeremybenn
* pagesize (MMU configuration):          Memory Management Configuration.
4508
                                                              (line  27)
4509
* patching memory (Interactive CLI):     Interactive Command Line.
4510
                                                              (line  48)
4511
* patching registers (Interactive CLI):  Interactive Command Line.
4512
                                                              (line  28)
4513
* patching the program counter (Interactive CLI): Interactive Command Line.
4514
                                                              (line  51)
4515
* pattern (memory configuration):        Memory Configuration.
4516 418 julius
                                                              (line  82)
4517 19 jeremybenn
* pc (Interactive CLI):                  Interactive Command Line.
4518
                                                              (line  51)
4519 440 jeremybenn
* persistent TAP device creation:        Setting Up a Persistent TAP device.
4520
                                                              (line   6)
4521 429 julius
* phy_addr:                              Ethernet Configuration.
4522 451 jeremybenn
                                                              (line  99)
4523 19 jeremybenn
* PIC configuration:                     Interrupt Configuration.
4524
                                                              (line   6)
4525
* pio (ATA/ATAPI device configuration):  Disc Interface Configuration.
4526 385 jeremybenn
                                                              (line 136)
4527 19 jeremybenn
* pio_mode0_t1 (ATA/ATAPI configuration): Disc Interface Configuration.
4528 385 jeremybenn
                                                              (line  55)
4529 19 jeremybenn
* pio_mode0_t2 (ATA/ATAPI configuration): Disc Interface Configuration.
4530 385 jeremybenn
                                                              (line  56)
4531 19 jeremybenn
* pio_mode0_t4 (ATA/ATAPI configuration): Disc Interface Configuration.
4532 385 jeremybenn
                                                              (line  57)
4533 19 jeremybenn
* pio_mode0_teoc (ATA/ATAPI configuration): Disc Interface Configuration.
4534 385 jeremybenn
                                                              (line  58)
4535 19 jeremybenn
* pm (Interactive CLI):                  Interactive Command Line.
4536
                                                              (line  48)
4537
* PMR - DGCE:                            Power Management Configuration.
4538
                                                              (line  21)
4539
* PMR - DME:                             Power Management Configuration.
4540
                                                              (line  15)
4541
* PMR - SDF:                             Power Management Configuration.
4542
                                                              (line  12)
4543
* PMR - SME:                             Power Management Configuration.
4544
                                                              (line  16)
4545
* PMR - SUME:                            Power Management Configuration.
4546
                                                              (line  24)
4547
* PMU configuration:                     Power Management Configuration.
4548
                                                              (line   6)
4549
* poc (memory controller configuration): Memory Controller Configuration.
4550 385 jeremybenn
                                                              (line  64)
4551 19 jeremybenn
* port range for TCP/IP:                 Verification API Configuration.
4552
                                                              (line  23)
4553
* power management configuration:        Power Management Configuration.
4554
                                                              (line   6)
4555
* power management register, DGCE:       Power Management Configuration.
4556
                                                              (line  21)
4557
* power management register, DME:        Power Management Configuration.
4558
                                                              (line  15)
4559
* power management register, SDF:        Power Management Configuration.
4560
                                                              (line  12)
4561
* power management register, SME:        Power Management Configuration.
4562
                                                              (line  16)
4563
* power management register, SUME:       Power Management Configuration.
4564
                                                              (line  24)
4565
* pr (Interactive CLI):                  Interactive Command Line.
4566
                                                              (line  28)
4567
* private ports, use of:                 Verification API Configuration.
4568
                                                              (line  23)
4569
* processor configuration:               CPU Configuration.   (line   6)
4570
* processor stall (Interactive CLI):     Interactive Command Line.
4571
                                                              (line  72)
4572
* processor unstall (Interactive CLI):   Interactive Command Line.
4573
                                                              (line  78)
4574
* prof_file (simulator configuration):   Simulator Behavior.  (line  23)
4575
* prof_fn (simulator configuration - deprecated): Simulator Behavior.
4576
                                                              (line  23)
4577
* profile (simulator configuration):     Simulator Behavior.  (line  19)
4578
* profiling for Or1ksim:                 Profiling Utility.   (line   6)
4579
* profiling utility (Interactive CLI):   Interactive Command Line.
4580
                                                              (line 178)
4581
* program counter patching (Interactive CLI): Interactive Command Line.
4582
                                                              (line  51)
4583
* programmable interrupt controller configuration: Interrupt Configuration.
4584
                                                              (line   6)
4585
* PS2 configuration:                     Keyboard Configuration.
4586
                                                              (line   6)
4587
* q (Interactive CLI):                   Interactive Command Line.
4588
                                                              (line  11)
4589
* quitting (Interactive CLI):            Interactive Command Line.
4590
                                                              (line  11)
4591
* r (Interactive CLI):                   Interactive Command Line.
4592
                                                              (line  14)
4593
* random_seed (memory configuration):    Memory Configuration.
4594 418 julius
                                                              (line  72)
4595 19 jeremybenn
* refresh_rate (frame buffer configuration): Frame Buffer Configuration.
4596 82 jeremybenn
                                                              (line  30)
4597 19 jeremybenn
* refresh_rate (VGA configuration):      Display Interface Configuration.
4598
                                                              (line  41)
4599
* reg_sim_reset:                         Concepts.            (line  13)
4600
* register display (Interactive CLI):    Interactive Command Line.
4601
                                                              (line  14)
4602
* register over time statistics:         Configuring the Build.
4603 127 jeremybenn
                                                              (line  92)
4604 19 jeremybenn
* register patching (Interactive CLI):   Interactive Command Line.
4605
                                                              (line  28)
4606 104 jeremybenn
* regression testing:                    Regression Testing.  (line   6)
4607 19 jeremybenn
* Remote Serial Protocol:                Debug Interface Configuration.
4608
                                                              (line  20)
4609 235 jeremybenn
* Remote Serial Protocol, --nosrv:       Standalone Simulator.
4610 472 jeremybenn
                                                              (line  65)
4611 235 jeremybenn
* Remote Serial Protocol, --srv:         Standalone Simulator.
4612 472 jeremybenn
                                                              (line  73)
4613 432 jeremybenn
* report_interrupt:                      Concepts.            (line  20)
4614 19 jeremybenn
* reset (Interactive CLI):               Interactive Command Line.
4615
                                                              (line  63)
4616
* reset hooks:                           Concepts.            (line  13)
4617
* reset the simulator (Interactive CLI): Interactive Command Line.
4618
                                                              (line  63)
4619
* rev (ATA/ATAPI configuration):         Disc Interface Configuration.
4620 385 jeremybenn
                                                              (line  48)
4621 19 jeremybenn
* rev (CPU configuration):               CPU Configuration.   (line  15)
4622
* rsp_enabled (debug interface configuration): Debug Interface Configuration.
4623
                                                              (line  20)
4624
* rsp_port (debug interface configuration): Debug Interface Configuration.
4625 235 jeremybenn
                                                              (line  32)
4626 19 jeremybenn
* rtx_type (Ethernet configuration):     Ethernet Configuration.
4627 440 jeremybenn
                                                              (line  47)
4628 19 jeremybenn
* run (Interactive CLI):                 Interactive Command Line.
4629
                                                              (line  23)
4630
* running code (Interactive CLI):        Interactive Command Line.
4631
                                                              (line  23)
4632
* running Or1ksim:                       Usage.               (line   6)
4633
* runtime:                               Global Data Structures.
4634
                                                              (line  58)
4635
* runtime global structure:              Global Data Structures.
4636
                                                              (line  58)
4637
* runtime.cpu:                           Global Data Structures.
4638
                                                              (line  62)
4639
* runtime.cpu.fout:                      Concepts.            (line   7)
4640
* runtime.cuc:                           Global Data Structures.
4641
                                                              (line  62)
4642
* runtime.vapi:                          Global Data Structures.
4643
                                                              (line  62)
4644
* rx_channel (Ethernet configuration):   Ethernet Configuration.
4645 440 jeremybenn
                                                              (line  67)
4646 19 jeremybenn
* rxfile (Ethernet configuration):       Ethernet Configuration.
4647 440 jeremybenn
                                                              (line  76)
4648 19 jeremybenn
* sbp_bf_fwd (branch prediction configuration): Branch Prediction Configuration.
4649
                                                              (line  23)
4650
* sbp_bnf_fwd (branch prediction configuration): Branch Prediction Configuration.
4651
                                                              (line  28)
4652 98 jeremybenn
* sbuf_len (CPU configuration):          CPU Configuration.   (line 101)
4653 19 jeremybenn
* SDF (power management register):       Power Management Configuration.
4654
                                                              (line  12)
4655
* section ata:                           Disc Interface Configuration.
4656
                                                              (line   6)
4657
* section bpb:                           Branch Prediction Configuration.
4658
                                                              (line   6)
4659
* section cpio:                          GPIO Configuration.  (line   6)
4660
* section cpu:                           CPU Configuration.   (line   6)
4661
* section cuc:                           CUC Configuration.   (line   6)
4662
* section dc:                            Cache Configuration. (line   6)
4663
* section debug:                         Debug Interface Configuration.
4664
                                                              (line   6)
4665
* section dma:                           DMA Configuration.   (line   6)
4666
* section dmmu:                          Memory Management Configuration.
4667
                                                              (line   6)
4668
* section ethernet:                      Ethernet Configuration.
4669
                                                              (line   6)
4670
* section fb:                            Frame Buffer Configuration.
4671
                                                              (line   6)
4672
* section generic:                       Generic Peripheral Configuration.
4673
                                                              (line   6)
4674
* section ic:                            Cache Configuration. (line   6)
4675
* section immu:                          Memory Management Configuration.
4676
                                                              (line   6)
4677
* section kb:                            Keyboard Configuration.
4678
                                                              (line   6)
4679
* section mc:                            Memory Controller Configuration.
4680
                                                              (line   6)
4681
* section memory:                        Memory Configuration.
4682
                                                              (line   6)
4683
* section pic:                           Interrupt Configuration.
4684
                                                              (line   6)
4685
* section pmu:                           Power Management Configuration.
4686
                                                              (line   6)
4687
* section sim:                           Simulator Behavior.  (line   6)
4688
* section uart:                          UART Configuration.  (line   6)
4689
* section vapi:                          Verification API Configuration.
4690
                                                              (line   6)
4691
* section vga:                           Display Interface Configuration.
4692
                                                              (line   6)
4693
* sections:                              Global Data Structures.
4694
                                                              (line  49)
4695
* sectors (ATA/ATAPI device configuration): Disc Interface Configuration.
4696 385 jeremybenn
                                                              (line 129)
4697 19 jeremybenn
* server_port (verification API configuration): Verification API Configuration.
4698
                                                              (line  19)
4699
* set (Interactive CLI):                 Interactive Command Line.
4700
                                                              (line 146)
4701
* set breakpoint (Interactive CLI):      Interactive Command Line.
4702
                                                              (line  57)
4703
* setdbch (Interactive CLI):             Interactive Command Line.
4704
                                                              (line 141)
4705
* simple model:                          Configuring the Build.
4706 104 jeremybenn
                                                              (line  37)
4707 19 jeremybenn
* simulator configuration:               Simulator Behavior.  (line   6)
4708
* simulator configuration info (Interactive CLI): Interactive Command Line.
4709
                                                              (line 119)
4710
* simulator reset (Interactive CLI):     Interactive Command Line.
4711
                                                              (line  63)
4712
* simulator statistics (Interactive CLI): Interactive Command Line.
4713
                                                              (line  83)
4714
* size (ATA/ATAPI device configuration): Disc Interface Configuration.
4715 385 jeremybenn
                                                              (line 113)
4716 19 jeremybenn
* size (generic peripheral configuration): Generic Peripheral Configuration.
4717
                                                              (line  30)
4718
* size (memory configuration):           Memory Configuration.
4719 418 julius
                                                              (line  99)
4720 19 jeremybenn
* sleep mode (power management register): Power Management Configuration.
4721
                                                              (line  16)
4722
* slow down factor (power management register): Power Management Configuration.
4723
                                                              (line  12)
4724
* SME (power management register):       Power Management Configuration.
4725
                                                              (line  16)
4726
* sr (CPU configuration):                CPU Configuration.   (line  53)
4727
* stall (Interactive CLI):               Interactive Command Line.
4728
                                                              (line  72)
4729
* stall the processor (Interactive CLI): Interactive Command Line.
4730
                                                              (line  72)
4731
* statistics, register over time:        Configuring the Build.
4732 127 jeremybenn
                                                              (line  92)
4733 19 jeremybenn
* statistics, simulation (Interactive CLI): Interactive Command Line.
4734
                                                              (line  83)
4735
* stats (Interactive CLI):               Interactive Command Line.
4736
                                                              (line  83)
4737
* stepping code (Interactive CLI):       Interactive Command Line.
4738
                                                              (line  19)
4739
* store_hitdelay (data cache configuration): Cache Configuration.
4740
                                                              (line  54)
4741
* store_missdelay (data cache configuration): Cache Configuration.
4742
                                                              (line  58)
4743
* SUME (power management register):      Power Management Configuration.
4744
                                                              (line  24)
4745 98 jeremybenn
* superscalar (CPU configuration):       CPU Configuration.   (line  63)
4746 19 jeremybenn
* suspend mode (power management register): Power Management Configuration.
4747
                                                              (line  24)
4748
* t (Interactive CLI):                   Interactive Command Line.
4749
                                                              (line  19)
4750 440 jeremybenn
* TAP device creation:                   Setting Up a Persistent TAP device.
4751
                                                              (line   6)
4752
* tap_dev (Ethernet configuration):      Ethernet Configuration.
4753
                                                              (line  93)
4754 104 jeremybenn
* target test code:                      Regression Testing.  (line  63)
4755 19 jeremybenn
* TCP/IP port range:                     Verification API Configuration.
4756
                                                              (line  23)
4757
* TCP/IP port range for or1ksim-rsp service: Debug Interface Configuration.
4758 235 jeremybenn
                                                              (line  37)
4759 104 jeremybenn
* test code for host:                    Regression Testing.  (line  57)
4760
* test code for target:                  Regression Testing.  (line  63)
4761
* test make file:                        Regression Testing.  (line  27)
4762
* test README:                           Regression Testing.  (line  32)
4763
* testing:                               Regression Testing.  (line   6)
4764 82 jeremybenn
* tests, all enabled.:                   Configuring the Build.
4765 127 jeremybenn
                                                              (line 105)
4766 346 jeremybenn
* timings_file (CUC configuration):      CUC Configuration.   (line  49)
4767 19 jeremybenn
* timings_fn (CUC configuration - deprecated): CUC Configuration.
4768 346 jeremybenn
                                                              (line  49)
4769 19 jeremybenn
* toggle breakpoint (Interactive CLI):   Interactive Command Line.
4770
                                                              (line  57)
4771
* toggle debug channels (Interactive CLI): Interactive Command Line.
4772
                                                              (line 141)
4773
* toggle debug mode (Interactive CLI):   Interactive Command Line.
4774
                                                              (line 151)
4775 442 julius
* trace generation of Or1ksim:           Trace Generation.    (line   6)
4776 19 jeremybenn
* tx_channel (Ethernet configuration):   Ethernet Configuration.
4777 440 jeremybenn
                                                              (line  68)
4778 19 jeremybenn
* txfile (Ethernet configuration):       Ethernet Configuration.
4779 440 jeremybenn
                                                              (line  77)
4780 19 jeremybenn
* txfile (frame buffer configuration):   Frame Buffer Configuration.
4781 82 jeremybenn
                                                              (line  36)
4782 19 jeremybenn
* txfile (VGA configuration):            Display Interface Configuration.
4783
                                                              (line  47)
4784
* type (ATA/ATAPI device configuration): Disc Interface Configuration.
4785 385 jeremybenn
                                                              (line 103)
4786 19 jeremybenn
* type (memory configuration):           Memory Configuration.
4787 385 jeremybenn
                                                              (line  37)
4788 418 julius
* type=exitnops (memory configuration):  Memory Configuration.
4789 420 jeremybenn
                                                              (line  66)
4790 19 jeremybenn
* type=pattern (memory configuration):   Memory Configuration.
4791 385 jeremybenn
                                                              (line  47)
4792 19 jeremybenn
* type=random (memory configuration):    Memory Configuration.
4793 385 jeremybenn
                                                              (line  41)
4794 19 jeremybenn
* type=unknown (memory configuration):   Memory Configuration.
4795 385 jeremybenn
                                                              (line  51)
4796 19 jeremybenn
* type=zero (memory configuration):      Memory Configuration.
4797 385 jeremybenn
                                                              (line  56)
4798 19 jeremybenn
* UART configuration:                    UART Configuration.  (line   6)
4799
* UART I/O from/to a physical serial port: UART Configuration.
4800
                                                              (line  62)
4801
* UART I/O from/to an xterm:             UART Configuration.  (line  38)
4802
* UART I/O from/to files:                UART Configuration.  (line  33)
4803
* UART I/O from/to open file descriptors: UART Configuration. (line  58)
4804
* UART I/O from/to TCP/IP:               UART Configuration.  (line  45)
4805
* UART verification (VAPI):              Verification API.    (line  41)
4806
* unstall (Interactive CLI):             Interactive Command Line.
4807
                                                              (line  78)
4808
* unstall the processor (Interactive CLI): Interactive Command Line.
4809
                                                              (line  78)
4810
* upr (CPU configuration):               CPU Configuration.   (line  21)
4811 432 jeremybenn
* use_nmi (interrupt controller):        Interrupt Configuration.
4812
                                                              (line  30)
4813 19 jeremybenn
* ustates (cache configuration):         Cache Configuration. (line  33)
4814
* ustates (MMU configuration):           Memory Management Configuration.
4815
                                                              (line  41)
4816
* VAPI configuration:                    Verification API Configuration.
4817
                                                              (line   6)
4818
* VAPI for Debug Unit:                   Verification API.    (line  34)
4819
* VAPI for DMA:                          Verification API.    (line  73)
4820
* VAPI for Ethernet:                     Verification API.    (line  78)
4821
* VAPI for GPIO:                         Verification API.    (line  88)
4822
* VAPI for UART:                         Verification API.    (line  41)
4823
* vapi_id (debug interface configuration): Debug Interface Configuration.
4824 235 jeremybenn
                                                              (line  43)
4825 346 jeremybenn
* vapi_id (DMA configuration) <1>:       Ethernet Configuration.
4826 451 jeremybenn
                                                              (line 119)
4827 346 jeremybenn
* vapi_id (DMA configuration):           DMA Configuration.   (line  38)
4828 19 jeremybenn
* vapi_id (GPIO configuration):          GPIO Configuration.  (line  32)
4829
* vapi_id (UART configuration):          UART Configuration.  (line  85)
4830
* vapi_log_file (verification API configuration): Verification API Configuration.
4831
                                                              (line  41)
4832
* vapi_log_fn (verification API configuration - deprecated): Verification API Configuration.
4833
                                                              (line  41)
4834
* ver (CPU configuration):               CPU Configuration.   (line  15)
4835
* verbose (simulator configuration):     Simulator Behavior.  (line  10)
4836
* Verification API configuration:        Verification API Configuration.
4837
                                                              (line   6)
4838
* Verilog memory dump (Interactive CLI): Interactive Command Line.
4839
                                                              (line 124)
4840
* VGA configuration:                     Display Interface Configuration.
4841
 
4842
 
4843
                                                              (line  50)
4844
4845
4846

4847
Tag Table:
4848 450 jeremybenn
Node: Top810
4849
Node: Installation1220
4850
Node: Preparation1467
4851 508 jeremybenn
Node: Configuring the Build1760
4852
Node: Build and Install7898
4853
Node: Known Issues8664
4854
Node: Usage9719
4855
Node: Standalone Simulator10003
4856
Node: Profiling Utility15147
4857
Node: Memory Profiling Utility16053
4858
Node: Trace Generation17413
4859
Node: Simulator Library19598
4860
Node: Ethernet TUN/TAP Interface30030
4861
Node: Setting Up a Persistent TAP device31135
4862
Node: Establishing a Bridge31810
4863
Node: Opening the Firewall33493
4864
Node: Disabling Ethernet Filtering33984
4865
Node: Networking from OpenRISC Linux and BusyBox34609
4866
Node: Tearing Down a Bridge36271
4867
Node: l.nop Support37014
4868
Node: Configuration39176
4869
Node: Configuration File Format39788
4870
Node: Configuration File Preprocessing40173
4871
Node: Configuration File Syntax40470
4872
Node: Simulator Configuration43255
4873
Node: Simulator Behavior43546
4874
Node: Verification API Configuration48127
4875
Node: CUC Configuration50067
4876
Node: Core OpenRISC Configuration52059
4877
Node: CPU Configuration52561
4878
Node: Memory Configuration56680
4879
Node: Memory Management Configuration63402
4880
Node: Cache Configuration65779
4881
Node: Interrupt Configuration68165
4882
Node: Power Management Configuration69998
4883
Node: Branch Prediction Configuration71275
4884
Node: Debug Interface Configuration72635
4885
Node: Peripheral Configuration74978
4886
Node: Memory Controller Configuration75604
4887
Node: UART Configuration79384
4888
Node: DMA Configuration82903
4889
Node: Ethernet Configuration84770
4890
Node: GPIO Configuration90049
4891
Node: Display Interface Configuration91682
4892
Node: Frame Buffer Configuration93991
4893
Node: Keyboard Configuration95855
4894
Node: Disc Interface Configuration98093
4895
Node: Generic Peripheral Configuration103197
4896
Node: Interactive Command Line105492
4897
Node: Verification API112466
4898
Node: Code Internals116896
4899
Node: Coding Conventions117479
4900
Node: Global Data Structures121906
4901
Node: Concepts124563
4902
Ref: Output Redirection124708
4903
Ref: Interrupts Internal125246
4904
Node: Internal Debugging126399
4905
Node: Regression Testing126923
4906
Node: GNU Free Documentation License130712

powered by: WebSVN 2.1.0

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