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

Subversion Repositories openrisc

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

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

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

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

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

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

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

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

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

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

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

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

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

626
File: or1ksim.info,  Node: Configuration,  Next: Interactive Command Line,  Prev: Usage,  Up: Top
627
 
628
3 Configuration
629
***************
630
 
631 82 jeremybenn
Or1ksim is configured through a configuration file.  This is specified
632 19 jeremybenn
through the `-f' parameter to the Or1ksim command, or passed as a
633 82 jeremybenn
string when initializing the Or1ksim library.  If no file is specified,
634
the default `sim.cfg' is used.  The file is looked for first in the
635 19 jeremybenn
current directory, then in the `$HOME/.or1k' directory of the user.
636
 
637
* Menu:
638
 
639
* Configuration File Format::
640
* Simulator Configuration::
641
* Core OpenRISC Configuration::
642
* Peripheral Configuration::
643
 
644

645
File: or1ksim.info,  Node: Configuration File Format,  Next: Simulator Configuration,  Up: Configuration
646
 
647
3.1 Configuration File Format
648
=============================
649
 
650
The configuration file is a plain text file.
651
 
652
* Menu:
653
 
654
* Configuration File Preprocessing::
655
* Configuration File Syntax::
656
 
657

658
File: or1ksim.info,  Node: Configuration File Preprocessing,  Next: Configuration File Syntax,  Up: Configuration File Format
659
 
660
3.1.1 Configuration File Preprocessing
661
--------------------------------------
662
 
663 82 jeremybenn
The configuration file may include C style comments (i.e.  delimited by
664 19 jeremybenn
`/*' and `*/').
665
 
666
Configure files may be included, using
667
 
668
     include FILENAME_TO_INCLUDE
669
 
670

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

751
File: or1ksim.info,  Node: Simulator Configuration,  Next: Core OpenRISC Configuration,  Prev: Configuration File Format,  Up: Configuration
752
 
753
3.2 Simulator Configuration
754
===========================
755
 
756
* Menu:
757
 
758
* Simulator Behavior::
759
* Verification API Configuration::
760
* CUC Configuration::
761
 
762

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

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

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

969
File: or1ksim.info,  Node: Core OpenRISC Configuration,  Next: Peripheral Configuration,  Prev: Simulator Configuration,  Up: Configuration
970
 
971
3.3 Configuring the OpenRISC Architectural Components
972
=====================================================
973
 
974
* Menu:
975
 
976
* CPU Configuration::
977
* Memory Configuration::
978
* Memory Management Configuration::
979
* Cache Configuration::
980
* Interrupt Configuration::
981
* Power Management Configuration::
982
* Branch Prediction Configuration::
983
* Debug Interface Configuration::
984
 
985

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

1096
File: or1ksim.info,  Node: Memory Configuration,  Next: Memory Management Configuration,  Prev: CPU Configuration,  Up: Core OpenRISC Configuration
1097
 
1098
3.3.2 Memory Configuration
1099
--------------------------
1100
 
1101 82 jeremybenn
Memory configuration is described in `section memory'.  This section
1102 98 jeremybenn
may appear multiple times, specifying multiple blocks of memory.
1103 19 jeremybenn
 
1104 98 jeremybenn
     Caution: The user may choose whether or not to enable a memory
1105
     controller. If a memory controller is enabled, then the standard
1106
     OpenRISC C libraries will initialize it to expect 64MB memory
1107
     blocks, and any memory declarations _must_ reflect this.  The
1108
     section describing memory controller configuration describes the
1109
     steps necessary for using smaller or larger memory sections (*note
1110
     Memory Controller Configuration: Memory Controller Configuration.).
1111
 
1112
     If a memory controller is _not_ enabled, then the standard C
1113
     library code will generate memory access errors.  The solution is
1114
     to declare an additional writable memory block, mimicing the memory
1115
     controller's register bank as follows.
1116
 
1117
          section memory
1118
            pattern = 0x00
1119
            type = unknown
1120
            name = "MC shadow"
1121
            baseaddr = 0x93000000
1122
            size     = 0x00000080
1123
            delayr = 2
1124
            delayw = 4
1125
          end
1126
 
1127
 
1128
The following parameters may be specified.
1129
 
1130 19 jeremybenn
`type=random|pattern|unknown|zero'
1131 82 jeremybenn
     Specifies the values to which memory should be initialized.  The
1132 19 jeremybenn
     default value is `unknown'.
1133
 
1134
    `random'
1135 82 jeremybenn
          Set the memory values to be a random value.  A seed for the
1136 19 jeremybenn
          random generator may be set using the `random_seed' field in
1137
          this section (see below), thus ensuring the same "random"
1138
          values are used each time.
1139
 
1140
    `pattern'
1141
          Set the memory values to be a pattern value, which is set
1142
          using the `pattern' field in this section (see below).
1143
 
1144
    `unknown'
1145 82 jeremybenn
          The memory values are not initialized (i.e.  left "unknown").
1146 19 jeremybenn
          This option will yield faster initialization of the simulator.
1147
 
1148
    `zero'
1149 82 jeremybenn
          Set the memory values to be 0.  This is the equivalent of
1150 19 jeremybenn
          `type=pattern' and a `pattern' value of 0, and implemented as
1151
          such.
1152
 
1153
               Note: As a consequence, if the `pattern' field is
1154
               _subsequently_ specified in this section, the value in
1155
               that field will be used instead of zero to initialize
1156
               the memory.
1157
 
1158
 
1159
`random_seed = VALUE'
1160 82 jeremybenn
     Set the seed for the random number generator to VALUE.  This only
1161 19 jeremybenn
     has any effect for memory type `random'.
1162
 
1163
     The default value is -1, which means the seed will be set from a
1164
     call to the `time' function, thus ensuring different random values
1165 82 jeremybenn
     are used on each run.  The simulator prints out the seed used in
1166 19 jeremybenn
     this case, allowing repeat runs to regenerate the same random
1167
     values used in any particular run.
1168
 
1169
`pattern = VALUE'
1170 82 jeremybenn
     Set the pattern to be used when initializing memory to VALUE.  The
1171
     default value is 0.  This only has any effect for memory type
1172
     `pattern'.  The least significant 8 bits of this value is used to
1173
     initialize each byte.  More than 8 bits can be specified, but will
1174 19 jeremybenn
     ignored with a warning.
1175
 
1176
          Tip: The default value, is equivalent to setting the memory
1177 82 jeremybenn
          `type' to be `zero'.  If that is what is intended, then using
1178 19 jeremybenn
          `type=zero' explicitly is better than using `type=pattern'
1179
          and not specifying a value for `pattern'.
1180
 
1181
`baseaddr = VALUE'
1182 82 jeremybenn
     Set the base address of the memory to VALUE.  It should be aligned
1183 19 jeremybenn
     to a multiple of the memory size rounded up to the nearest 2^n.
1184
     The default value is 0.
1185
 
1186
`size = VALUE'
1187 82 jeremybenn
     Set the size of the memory block to be VALUE bytes.  This should
1188
     be a multiple of 4 (i.e.  word aligned).  The default value is
1189
     1024.
1190 19 jeremybenn
 
1191
          Note: When allocating memory, the simulator will allocate the
1192
          nearest 2^n bytes greater than or equal to VALUE, and will not
1193
          notice memory misses in any part of the memory between VALUE
1194
          and the amount allocated.
1195
 
1196
          As a consequence users are strongly recommended to specify
1197 82 jeremybenn
          memory sizes that are an exact power of 2.  If some other
1198 19 jeremybenn
          amount of memory is required, it should be specified as
1199
          separate, contiguous blocks, each of which is a power of 2 in
1200
          size.
1201
 
1202
`name = "TEXT"'
1203 82 jeremybenn
     Name the block.  Typically these describe the type of memory being
1204
     modeled (thus `"SRAM"' or `"Flash"'.  The default is
1205 19 jeremybenn
     `"anonymous memory block"'.
1206
 
1207
          Note: It is not clear that this information is currently ever
1208 82 jeremybenn
          used in normal operation of the simulator.  Even the `info'
1209 19 jeremybenn
          command of the simulator ignores it.
1210
 
1211
`ce = VALUE'
1212 82 jeremybenn
     Set the chip enable index of the memory instance.  Each memory
1213 19 jeremybenn
     instance should have a unique chip enable index, which should be
1214 82 jeremybenn
     greater than or equal to zero.  This is used by the memory
1215 19 jeremybenn
     controller when identifying different memory instances.
1216
 
1217 98 jeremybenn
     There is no requirement to set  `ce' if a memory controller is not
1218
     enabled. The default value is -1 (invalid).
1219 19 jeremybenn
 
1220
`mc = VALUE'
1221 82 jeremybenn
     Specifies the memory controller this memory is connected to.  It
1222 19 jeremybenn
     should correspond to the `index' field specified in a `section mc'
1223
     for a memory controller (*note Memory Controller Configuration:
1224
     Memory Controller Configuration.).
1225
 
1226 98 jeremybenn
     There is no requirement to set  `mc' if a memory controller is not
1227
     enabled. Default value is 0, which is also the default value of a
1228
     memory controller `index' field.  This is suitable therefore for
1229
     designs with just one memory controller.
1230 19 jeremybenn
 
1231
`delayr = VALUE'
1232 82 jeremybenn
     The number of cycles required for a read access.  Set to -1 if the
1233
     memory does not support reading.  Default value 1.  The simulator
1234 19 jeremybenn
     will add this number of cycles to the total instruction cycle
1235
     count when reading from main memory.
1236
 
1237
`delayw = VALUE'
1238 82 jeremybenn
     The number of cycles required for a write access.  Set to -1 if the
1239
     memory does not support writing.  Default value 1.  The simulator
1240 19 jeremybenn
     will add this number of cycles to the total instruction cycle
1241
     count when writing to main memory.
1242
 
1243
`log = "FILE"'
1244
     If specified, `file' names a file for all memory accesses to be
1245 82 jeremybenn
     logged.  If not specified, the default value, NULL is used, meaning
1246 19 jeremybenn
     that the memory is not logged.
1247
 
1248
 
1249

1250
File: or1ksim.info,  Node: Memory Management Configuration,  Next: Cache Configuration,  Prev: Memory Configuration,  Up: Core OpenRISC Configuration
1251
 
1252
3.3.3 Memory Management Configuration
1253
-------------------------------------
1254
 
1255
Memory Management Unit (MMU) configuration is described in `section
1256
dmmu' (for the data MMU) and `section immu' (for the instruction MMU).
1257 82 jeremybenn
Each section should appear at most once.  The following parameters may
1258 19 jeremybenn
be specified.
1259
 
1260
`enabled = 0|1'
1261
     If 1 (true), the data or instruction (as appropriate) MMU is
1262 82 jeremybenn
     enabled.  If 0 (the default), it is disabled.
1263 19 jeremybenn
 
1264
`nsets = VALUE'
1265
     Sets the number of data or instruction (as appropriate) TLB sets to
1266 82 jeremybenn
     VALUE, which must be a power of two, not exceeding 128.  Values
1267
     which do not fit these criteria are ignored with a warning.  The
1268 19 jeremybenn
     default value is 1.
1269
 
1270
`nways = VALUE'
1271
     Sets the number of data or instruction (as appropriate) TLB ways to
1272 82 jeremybenn
     VALUE.  The value must be in the range 1 to 4.  Values outside
1273
     this range are ignored with a warning.  The default value is 1.
1274 19 jeremybenn
 
1275
`pagesize = VALUE'
1276
     The data or instruction (as appropriate) MMU page size is set to
1277 82 jeremybenn
     VALUE, which must be a power of 2.  Values which are not a power
1278
     of 2 are ignored with a warning.  The default is 8192 (0x2000).
1279 19 jeremybenn
 
1280
`entrysize = VALUE'
1281
     The data or instruction (as appropriate) MMU entry size is set to
1282 82 jeremybenn
     VALUE, which must be a power of 2.  Values which are not a power
1283
     of 2 are ignored with a warning.  The default value is 1.
1284 19 jeremybenn
 
1285
          Note: Or1ksim does not appear to use the `entrysize' parameter
1286 82 jeremybenn
          in its simulation of the MMUs.  Thus setting this value does
1287 19 jeremybenn
          not seem to matter.
1288
 
1289
`ustates = VALUE'
1290
     The number of instruction usage states for the data or instruction
1291
     (as appropriate) MMU is set to VALUE, which must be 2, 3 or 4.
1292 82 jeremybenn
     Values outside this range are ignored with a warning.  The default
1293 19 jeremybenn
     value is 2.
1294
 
1295
          Note: Or1ksim does not appear to use the `ustates' parameter
1296 82 jeremybenn
          in its simulation of the MMUs.  Thus setting this value does
1297 19 jeremybenn
          not seem to matter.
1298
 
1299
`hitdelay = VALUE'
1300
     Set the number of cycles a data or instruction (as appropriate) MMU
1301 82 jeremybenn
     hit costs.  Default value 1.
1302 19 jeremybenn
 
1303
`missdelay = VALUE'
1304
     Set the number of cycles a data or instruction (as appropriate) MMU
1305 82 jeremybenn
     miss costs.  Default value 1.
1306 19 jeremybenn
 
1307
 
1308

1309
File: or1ksim.info,  Node: Cache Configuration,  Next: Interrupt Configuration,  Prev: Memory Management Configuration,  Up: Core OpenRISC Configuration
1310
 
1311
3.3.4 Cache Configuration
1312
-------------------------
1313
 
1314
Cache configuration is described in `section dc' (for the data cache)
1315 82 jeremybenn
and `seciton ic' (for the instruction cache).  Each section should
1316
appear at most once.  The following parameters may be specified.
1317 19 jeremybenn
 
1318
`enabled = 0|1'
1319
     If 1 (true), the data or instruction (as appropriate) cache is
1320 82 jeremybenn
     enabled.  If 0 (the default), it is disabled.
1321 19 jeremybenn
 
1322
`nsets = VALUE'
1323
     Sets the number of data or instruction (as appropriate) cache sets
1324
     to VALUE, which must be a power of two, not exceeding
1325
     `MAX_DC_SETS' (for the data cache) or `MAX_IC_SETS' (for the
1326 82 jeremybenn
     instruction cache).  At the time of writing, these constants are
1327
     both defined in the code to be 1024).  The default value is 1.
1328 19 jeremybenn
 
1329
`nways = VALUE'
1330
     Sets the number of data or instruction (as appropriate) cache ways
1331
     to VALUE, which must be a power of two, not exceeding
1332
     `MAX_DC_WAYS' (for the data cache) or `MAX_IC_WAYS' (for the
1333 82 jeremybenn
     instruction cache).  At the time of writing, these constants are
1334
     both defined in the code to be 32).  The default value is 1.
1335 19 jeremybenn
 
1336
`blocksize = VALUE'
1337
     The data or instruction (as appropriate) cache block size is set to
1338 82 jeremybenn
     VALUE bytes, which must be either 16 or 32.  The default is 16.
1339 19 jeremybenn
 
1340
`ustates = VALUE'
1341
     The number of instruction usage states for the data or instruction
1342
     (as appropriate) cache is set to VALUE, which must be 2, 3 or 4.
1343
     The default value is 2.
1344
 
1345
`hitdelay = VALUE'
1346 82 jeremybenn
     _Instruction cache only_.  Set the number of cycles an instruction
1347
     cache hit costs.  Default value 1.
1348 19 jeremybenn
 
1349
`missdelay = VALUE'
1350 82 jeremybenn
     _Instruction cache only_.  Set the number of cycles an instruction
1351
     cache miss costs.  Default value 1.
1352 19 jeremybenn
 
1353
`load_hitdelay = VALUE'
1354 82 jeremybenn
     _Data cache only_.  Set the number of cycles a data load cache hit
1355
     costs.  Default value 2.
1356 19 jeremybenn
 
1357
`load_missdelay = VALUE'
1358 82 jeremybenn
     _Data cache only_.  Set the number of cycles a data load cache
1359
     miss costs.  Default value 2.
1360 19 jeremybenn
 
1361
`store_hitdelay = VALUE'
1362 82 jeremybenn
     _Data cache only_.  Set the number of cycles a data store cache hit
1363
     costs.  Default value 0.
1364 19 jeremybenn
 
1365
`store_missdelay = VALUE'
1366 82 jeremybenn
     _Data cache only_.  Set the number of cycles a data store cache
1367
     miss costs.  Default value 0.
1368 19 jeremybenn
 
1369
 
1370

1371
File: or1ksim.info,  Node: Interrupt Configuration,  Next: Power Management Configuration,  Prev: Cache Configuration,  Up: Core OpenRISC Configuration
1372
 
1373
3.3.5 Interrupt Configuration
1374
-----------------------------
1375
 
1376
Programmable Interrupt Controller (PIC) configuration is described in
1377 82 jeremybenn
`section pic'.  This section may appear at most once--Or1ksim has no
1378
mechanism for handling multiple interrupt controllers.  The following
1379 19 jeremybenn
parameters may be specified.
1380
 
1381
`enabled = 0|1'
1382 82 jeremybenn
     If 1 (true), the programmable interrupt controller is enabled.  If
1383
 
1384 19 jeremybenn
 
1385
`edge_trigger = 0|1'
1386
     If 1 (true, the default), the programmable interrupt controller is
1387 82 jeremybenn
     edge triggered.  If 0 (false), it is level triggered.
1388 19 jeremybenn
 
1389
 
1390

1391
File: or1ksim.info,  Node: Power Management Configuration,  Next: Branch Prediction Configuration,  Prev: Interrupt Configuration,  Up: Core OpenRISC Configuration
1392
 
1393
3.3.6 Power Management Configuration
1394
------------------------------------
1395
 
1396 82 jeremybenn
Power management implementation is incomplete.  At present the effect
1397 19 jeremybenn
(which only happens when the power management unit is enabled) of
1398
setting the different bits in the power management Special Purpose
1399
Register (PMR, SPR 0x4000) is
1400
 
1401
`SDF (bit mask 0x0000000f)'
1402
     No effect - these bits are ignored
1403
 
1404
`DME (bit mask 0x00000010)'
1405
`SME (bit mask 0x00000020)'
1406
     Both these bits cause the processor to stop executing
1407 82 jeremybenn
     instructions.  However all other functions (debug interaction, CLI,
1408 19 jeremybenn
     VAPI etc) carry on as normal.
1409
 
1410
`DCGE (bit mask 0x00000004)'
1411
     No effect - this bit is ignored
1412
 
1413
`SUME (bit mask 0x00000008)'
1414
     Enabling this bit causes a message to be printed, advising that the
1415
     processor is suspending and the simulator exits.
1416
 
1417
 
1418
On reset all bits are cleared.
1419
 
1420 82 jeremybenn
Power management configuration is described in `section pm'.  This
1421
section may appear at most once.  The following parameter may be
1422 19 jeremybenn
specified.
1423
 
1424
`enabled = 0|1'
1425 82 jeremybenn
     If 1 (true), power management is enabled.  If 0 (the default), it
1426
     is disabled.
1427 19 jeremybenn
 
1428
 
1429

1430
File: or1ksim.info,  Node: Branch Prediction Configuration,  Next: Debug Interface Configuration,  Prev: Power Management Configuration,  Up: Core OpenRISC Configuration
1431
 
1432
3.3.7 Branch Prediction Configuration
1433
-------------------------------------
1434
 
1435
From examining the code base, it seems the branch prediction function
1436 82 jeremybenn
is not fully implemented.  At present the functionality seems
1437
restricted to collection of statistics.
1438 19 jeremybenn
 
1439 82 jeremybenn
Branch prediction configuration is described in `section bpb'.  This
1440
section may appear at most once.  The following parameters may be
1441 19 jeremybenn
specified.
1442
 
1443
`enabled = 0|1'
1444 82 jeremybenn
     If 1 (true), branch prediction is enabled.  If 0 (the default), it
1445 19 jeremybenn
     is disabled.
1446
 
1447
`btic = 0|1'
1448
     If 1 (true), the branch target instruction cache model is enabled.
1449
     If 0 (the default), it is disabled.
1450
 
1451
`sbp_bf_fwd = 0|1'
1452 82 jeremybenn
     If 1 (true), use forward prediction for the `l.bf' instruction.  If
1453 19 jeremybenn
 
1454
     instruction.
1455
 
1456
`sbp_bnf_fwd = 0|1'
1457 82 jeremybenn
     If 1 (true), use forward prediction for the `l.bnf' instruction.
1458
     If 0 (the default), do not use forward prediction for this
1459 19 jeremybenn
     instruction.
1460
 
1461
`hitdelay = VALUE'
1462 82 jeremybenn
     Set the number of cycles a branch prediction hit costs.  Default
1463 19 jeremybenn
     value 0.
1464
 
1465
`missdelay = VALUE'
1466 82 jeremybenn
     Set the number of cycles a branch prediction miss costs.  Default
1467 19 jeremybenn
     value 0.
1468
 
1469
 
1470

1471
File: or1ksim.info,  Node: Debug Interface Configuration,  Prev: Branch Prediction Configuration,  Up: Core OpenRISC Configuration
1472
 
1473
3.3.8 Debug Interface Configuration
1474
-----------------------------------
1475
 
1476
The debug unit and debug interface configuration is described in
1477 82 jeremybenn
`section debug'.  This section may appear at most once.  The following
1478 19 jeremybenn
parameters may be specified.
1479
 
1480
`enabled = 0|1'
1481 82 jeremybenn
     If 1 (true), the debug unit is enabled.  If 0 (the default), it is
1482 19 jeremybenn
     disabled.
1483
 
1484
          Note: This enables the functionality of the debug unit (its
1485 82 jeremybenn
          registers etc) within the mode.  It does not provide any
1486
          external interface to the debug unit.  For that, see
1487 19 jeremybenn
          `gdb_enabled' and `rsp_enabled' below.
1488
 
1489
`rsp_enabled = 0|1'
1490
     If 1 (true), the GDB "Remote Serial Protocol" server is started,
1491
     provding an interface to an external GNU debugger, using the port
1492
     specified in the `rsp_port' field (see below), or the
1493 82 jeremybenn
     `or1ksim-rsp' TCP/IP service.  If 0 (the default), the server is
1494 19 jeremybenn
     not started, and no external interface is provided.
1495
 
1496
     For more detailed information on the interface to the GNU Debugger
1497
     see Embecosm Application Note 2, `Howto: Porting the GNU Debugger
1498
     Practical Experience with the OpenRISC 1000 Architecture', by
1499
     Jeremy Bennett, published by Embecosm Limited (`www.embecosm.com').
1500
 
1501 82 jeremybenn
          Note: `rsp_enabled' may not be enabled with `gdb_enabled' (see
1502
          below).  If both are enabled, a warning is issued and only
1503
          the "Remote Serial Protocol" interface is enabled.
1504 19 jeremybenn
 
1505
`rsp_port = VALUE'
1506
     VALUE specifies the port to be used for the GDB "Remote Serial
1507 82 jeremybenn
     Protocol" interface to the GNU Debugger (GDB).  Default value
1508
     51000.  If the value 0 is specified, Or1ksim will instead look for
1509 19 jeremybenn
     a TCP/IP service named `or1ksim-rsp'.
1510
 
1511
          Tip: There is no registered port for Or1ksim "Remote Serial
1512 82 jeremybenn
          Protocol" service `or1ksim-rsp'.  Good practice suggests
1513
          users should adopt port values in the "Dynamic" or "Private"
1514
          port range, i.e.  49152-65535.
1515 19 jeremybenn
 
1516
`gdb_enabled = 0|1'
1517
     If 1 (true), the OpenRISC Remote JTAG protocol server is started,
1518
     provding an interface to an external GNU debugger, using the port
1519
     specified in the `server_port' field (see below), or the `or1ksim'
1520 82 jeremybenn
     TCP/IP service.  If 0 (the default), the server is not started,
1521
     and no external interface is provided.
1522 19 jeremybenn
 
1523
     For more detailed information on the interface to the GNU Debugger
1524
     see Embecosm Application Note 2, `Howto: Porting the GNU Debugger
1525
     Practical Experience with the OpenRISC 1000 Architecture', by
1526
     Jeremy Bennett, published by Embecosm Limited (`www.embecosm.com').
1527
 
1528
          Note: The OpenRISC Remote JTAG protocol is unique to
1529 82 jeremybenn
          OpenRISC, and remains only for backward compatibility.  New
1530 19 jeremybenn
          users should adopt the standard GDB "Remote Serial Protocol"
1531
          interface (see `rsp_enabled' above) providing access to a
1532
          wider range of GDB functionality.
1533
 
1534 82 jeremybenn
          Note: `gdb_enabled' may not be enabled with `rsp_enabled'.
1535
          If both are enabled, a warning is issued and only the "Remote
1536 19 jeremybenn
          Serial Protocol" interface is enabled.
1537
 
1538
`server_port = VALUE'
1539
     VALUE specifies the port to be used for the OpenRISC Rmote JTAG
1540 82 jeremybenn
     protocol interface to the GNU Debugger (GDB).  Default value
1541
     51000.  If the value 0 is specified, Or1ksim will instead look for
1542
     a TCP/IP service named `or1ksim'.
1543 19 jeremybenn
 
1544
          Tip: There is no registered port for Or1ksim Remote JTAG
1545 82 jeremybenn
          Interface or service `or1ksim'.  Good practice suggests users
1546 19 jeremybenn
          should adopt port values in the "Dynamic" or "Private" port
1547 82 jeremybenn
          range, i.e.  49152-65535.
1548 19 jeremybenn
 
1549
`vapi_id = VALUE'
1550
     VALUE specifies the value of the Verification API (VAPI) base
1551 82 jeremybenn
     address to be used with the debug unit.  *Note Verification API:
1552 19 jeremybenn
     Verification API, for more details.
1553
 
1554
     If this is specified and VALUE is non-zero, all OpenRISC Remote
1555
     JTAG protocol transactions will be logged to the VAPI log file, if
1556 82 jeremybenn
     enabled.  This is the only functionality associated with VAPI for
1557
     the debug unit.  No VAPI commands are sent, nor requests handled.
1558 19 jeremybenn
 
1559
 
1560

1561
File: or1ksim.info,  Node: Peripheral Configuration,  Prev: Core OpenRISC Configuration,  Up: Configuration
1562
 
1563
3.4 Configuring Memory Mapped Peripherals
1564
=========================================
1565
 
1566 82 jeremybenn
All peripheral components are optional.  If they are specified, then
1567 19 jeremybenn
(unlike other components) by default they are enabled.
1568
 
1569
* Menu:
1570
 
1571
* Memory Controller Configuration::
1572
* UART Configuration::
1573
* DMA Configuration::
1574
* Ethernet Configuration::
1575
* GPIO Configuration::
1576
* Display Interface Configuration::
1577
* Frame Buffer Configuration::
1578
* Keyboard Configuration::
1579
* Disc Interface Configuration::
1580
* Generic Peripheral Configuration::
1581
 
1582

1583
File: or1ksim.info,  Node: Memory Controller Configuration,  Next: UART Configuration,  Up: Peripheral Configuration
1584
 
1585
3.4.1 Memory Controller Configuration
1586
-------------------------------------
1587
 
1588
The memory controller used in Or1ksim is the component implemented at
1589 98 jeremybenn
OpenCores, and found in the top level SVN directory, `mem_ctrl'.  It is
1590 19 jeremybenn
described in the document `Memory Controller IP Core' by Rudolf
1591 82 jeremybenn
Usselmann, which can be found in the `doc' subdirectory.  It is a
1592
memory mapped component, which resides on the main OpenRISC Wishbone
1593
data bus.
1594 19 jeremybenn
 
1595 82 jeremybenn
The memory controller configuration is described in `section mc'.  This
1596 19 jeremybenn
section may appear multiple times, specifying multiple memory
1597 98 jeremybenn
controllers.
1598 19 jeremybenn
 
1599 98 jeremybenn
     Caution: The standard OpenRISC C libraries will initialize the
1600
     memory controller to expect 64MB memory blocks, and any memory
1601
     declarations _must_ reflect this.
1602
 
1603
     If smaller memory blocks are declared with a memory controller,
1604
     then sufficient memory will not be allocated by Or1ksim, but out of
1605
     range memory accesses will not be trapped. For example declaring a
1606
     memory section from 0-4MB with a memory controller enabled would
1607
     mean that accesses between 4MB and 64MB would be permitted, but
1608
     having no allocated memory would likely cause a segmentation fault.
1609
 
1610
     If the user is determined to use smaller memories with the memory
1611
     controller, then custom initialization code must be provided, to
1612
     ensure the memory controller traps out-of-memory accesses.
1613
 
1614
The following parameters may be specified.
1615
 
1616 19 jeremybenn
`enabled = 0|1'
1617 82 jeremybenn
     If 1 (true, the default), this memory controller is enabled.  If
1618
     0, it is disabled.
1619 19 jeremybenn
 
1620
          Note: The memory controller can effectively also be disabled
1621
          by setting an appropriate power on control register value
1622 82 jeremybenn
          (see below).  However this should only be used if it is
1623 19 jeremybenn
          desired to specifically model this behavior of the memory
1624
          controller, not as a way of disabling the memory controller
1625
          in general.
1626
 
1627
`baseaddr = VALUE'
1628
     Set the base address of the memory controller's memory mapped
1629 82 jeremybenn
     registers to VALUE.  The default is 0, which is probably not a
1630 19 jeremybenn
     sensible value.
1631
 
1632
     The memory controller has a 7 bit address bus, with a total of 19
1633
     32-bit registers, at addresses 0x00 through 0x4c (address 0x0c and
1634
     addresses 0x50 through 0x7c are not used).
1635
 
1636
`poc = VALUE'
1637
     Specifies the value of the power on control register, The least
1638
     signficant two bits specify the bus width (use 0 for an 8-bit bus,
1639
     1 for a 16-bit bus and 2 for a 32-bit bus) and the next two bits
1640
     the type of memory connected (use 0 for a disabled interface, 1
1641
     for SSRAM, 2 for asyncrhonous devices and 3 for synchronous
1642
     devices).
1643
 
1644
     If other bits are specified, they are ignored with a warning.
1645
 
1646
          Caution: The default value, 0, corresponds to a disabled
1647
          8-bit bus, and is likely not the most suitable value
1648
 
1649
`index = VALUE'
1650
     Specify the index of this memory controller amongst all the memory
1651 82 jeremybenn
     controllers.  This value should be unique for each memory
1652 19 jeremybenn
     controller, and is used to associate specific memories with the
1653
     controller, through the `mc' field in the `section memory'
1654
     configuration (*note Memory Configuration: Memory Configuration.).
1655
 
1656
     The default value, 0, is suitable when there is only one memory
1657
     controller.
1658
 
1659
 
1660

1661
File: or1ksim.info,  Node: UART Configuration,  Next: DMA Configuration,  Prev: Memory Controller Configuration,  Up: Peripheral Configuration
1662
 
1663
3.4.2 UART Configuration
1664
------------------------
1665
 
1666
The UART implemented in Or1ksim follows the specification of the
1667 82 jeremybenn
National Semiconductor 16450 and 16550 parts.  It is a memory mapped
1668 19 jeremybenn
component, which resides on the main OpenRISC Wishbone data bus.
1669
 
1670
The component provides a number of interfaces to emulate the behavior
1671
of an external terminal connected to the UART.
1672
 
1673 82 jeremybenn
UART configuration is described in `section uart'.  This section may
1674
appear multiple times, specifying multiple UARTs.  The following
1675 19 jeremybenn
parameters may be specified.
1676
 
1677
`enabled = 0|1'
1678 82 jeremybenn
     If 1 (true, the default), this UART is enabled.  If 0, it is
1679 19 jeremybenn
     disabled.
1680
 
1681
`baseaddr = VALUE'
1682
     Set the base address of the UART's memory mapped registers to
1683 82 jeremybenn
     VALUE.  The default is 0, which is probably not a sensible value.
1684 19 jeremybenn
 
1685
     The UART has a 3 bit address bus, with a total of 8 8-bit
1686
     registers, at addresses 0x0 through 0x7.
1687
 
1688
`channel = "TYPE:ARGS"'
1689
     Specify the channel representing the terminal connected to the UART
1690
     Rx & Tx pins.
1691
 
1692
    `channel="file:`rxfile',`txfile'"'
1693
          Read input characters from the file `rxfile' and write output
1694
          characters to the file `txfile' (which will be created if
1695
          required).
1696
 
1697
    `channel="xterm:ARGS"'
1698
          Create an xterm on startup, write UART Tx traffic to the
1699
          xterm and take Rx traffic from the keyboard when the xterm
1700 82 jeremybenn
          window is selected.  Additional arguments to the xterm
1701
          command (for example specifying window size may be specified
1702
          in ARGS, or this may be left blank.
1703 19 jeremybenn
 
1704
    `channel="tcp:VALUE"'
1705
          Open the TCP/IP port specified by VALUE and read and write
1706
          UART traffic from and to it.
1707
 
1708
          Typically a telnet session is connected to the other end of
1709
          this port.
1710
 
1711
               Tip: There is no registered port for Or1ksim telnet UART
1712 82 jeremybenn
               connection.  Priviledged access is required to read
1713 19 jeremybenn
               traffic on the registered "well-known" telnet port (23).
1714
               Instead users should use port values in the "Dynamic" or
1715 82 jeremybenn
               "Private" port range, i.e.  49152-65535.
1716 19 jeremybenn
 
1717
    `channel="fd:`rxfd',`txfd'"'
1718
          Read and write characters from and to the existing open
1719
          numerical file descriptors, file `rxfd' and `txfd'.
1720
 
1721
    `channel="tty:device=/dev/ttyS0,baud=9600"'
1722
          Read and write characters from and to a physical serial port.
1723
          The precise device (shown here as `/dev/ttyS0') may vary from
1724
          machine to machine.
1725
 
1726
 
1727
     The default value for this field is `"xterm:"'.
1728
 
1729
`irq = VALUE'
1730 82 jeremybenn
     Use VALUE as the IRQ number of this UART.  Default value 0.
1731 19 jeremybenn
 
1732
`16550 = 0|1'
1733 82 jeremybenn
     If 1 (true), the UART has the functionality of a 16550.  If 0 (the
1734
     default), it has the functionality of a 16450.  The principal
1735 19 jeremybenn
     difference is that the 16550 can buffer multiple characters.
1736
 
1737
`jitter = VALUE'
1738
     Set the jitter, modeled as a time to block, to VALUE milliseconds.
1739 82 jeremybenn
     Set to -1 to disable jitter modeling.  Default value 0.
1740 19 jeremybenn
 
1741
          Note: This functionality has yet to be implemented, so this
1742
          parameter has no effect.
1743
 
1744
`vapi_id = VALUE'
1745
     VALUE specifies the value of the Verification API (VAPI) base
1746 82 jeremybenn
     address to be used with the UART.  *Note Verification API:
1747 19 jeremybenn
     Verification API, for more details, which details the use of the
1748
     VAPI with the UART.
1749
 
1750
 
1751

1752
File: or1ksim.info,  Node: DMA Configuration,  Next: Ethernet Configuration,  Prev: UART Configuration,  Up: Peripheral Configuration
1753
 
1754
3.4.3 DMA Configuration
1755
-----------------------
1756
 
1757
The DMA controller used in Or1ksim is the component implemented at
1758 98 jeremybenn
OpenCores, and found in the top level SVN directory, `wb_dma'.  It is
1759 19 jeremybenn
described in the document `Wishbone DMA/Bridge IP Core' by Rudolf
1760 82 jeremybenn
Usselmann, which can be found in the `doc' subdirectory.  It is a
1761
memory mapped component, which resides on the main OpenRISC Wishbone
1762
data bus.  The present implementation is incomplete, intended only to
1763
support the Ethernet interface (*note Ethernet Configuration::),
1764
although the Ethernet interface is not yet completed.
1765 19 jeremybenn
 
1766 82 jeremybenn
DMA configuration is described in `section dma'.  This section may
1767
appear multiple times, specifying multiple DMA controllers.  The
1768 19 jeremybenn
following parameters may be specified.
1769
 
1770
`enabled = 0|1'
1771 82 jeremybenn
     If 1 (true, the default), this DMA controller is enabled.  If 0,
1772
     it is disabled.
1773 19 jeremybenn
 
1774
`baseaddr = VALUE'
1775
     Set the base address of the DMA's memory mapped registers to
1776 82 jeremybenn
     VALUE.  The default is 0, which is probably not a sensible value.
1777 19 jeremybenn
 
1778
     The DMA controller has a 10 bit address bus, with a total of 253
1779 82 jeremybenn
     32-bit registers.  The first 5 registers at addresses 0x000 through
1780
     0x010 control the overall behavior of the DMA controller.  There
1781
     are then 31 blocks of 8 registers, controlling each of the 31 DMA
1782
     channels available.  Addresses 0x014 through 0x01c are not used.
1783 19 jeremybenn
 
1784
`irq = VALUE'
1785 82 jeremybenn
     Use VALUE as the IRQ number of this DMA controller.  Default value
1786 19 jeremybenn
     0.
1787
 
1788
`vapi_id = VALUE'
1789
     VALUE specifies the value of the Verification API (VAPI) base
1790 82 jeremybenn
     address to be used with the DMA controller.  *Note Verification
1791 19 jeremybenn
     API: Verification API, for more details, which details the use of
1792
     the VAPI with the DMA controller.
1793
 
1794
 
1795

1796
File: or1ksim.info,  Node: Ethernet Configuration,  Next: GPIO Configuration,  Prev: DMA Configuration,  Up: Peripheral Configuration
1797
 
1798
3.4.4 Ethernet Configuration
1799
----------------------------
1800
 
1801
The Ethernet MAC used in Or1ksim is the component implemented at
1802 98 jeremybenn
OpenCores, and found in the top level SVN directory, `ethmac'.  It also
1803
forms part of the OpenRISC SoC, ORPSoC.  It is described in the
1804 19 jeremybenn
document `Ethernet IP Core Specification' by Igor Mohor, which can be
1805 82 jeremybenn
found in the `doc' subdirectory.  It is a memory mapped component,
1806
which resides on the main OpenRISC Wishbone data bus.
1807 19 jeremybenn
 
1808 82 jeremybenn
Ethernet configuration is described in `section ethernet'.  This
1809
section may appear multiple times, specifying multiple Ethernet
1810
interfaces.  The following parameters may be specified.
1811 19 jeremybenn
 
1812
`enabled = 0|1'
1813 82 jeremybenn
     If 1 (true, the default), this Ethernet MAC is enabled.  If 0, it
1814
     is disabled.
1815 19 jeremybenn
 
1816
`baseaddr = VALUE'
1817
     Set the base address of the MAC's memory mapped registers to
1818 82 jeremybenn
     VALUE.  The default is 0, which is probably not a sensible value.
1819 19 jeremybenn
 
1820
     The Ethernet MAC has a 7-bit address bus, with a total of 21
1821 82 jeremybenn
     32-bit registers.  Addresses 0x54 through 0x7c are not used.
1822 19 jeremybenn
 
1823
          Note: The Ethernet specification describes a Tx control
1824 82 jeremybenn
          register, `TXCTRL', at address 0x50.  However this register
1825
          is not implemented in the Or1ksim model.
1826 19 jeremybenn
 
1827
`dma = VALUE'
1828
     VALUE specifies the DMA controller with which this Ethernet is
1829 82 jeremybenn
     associated.  The default value is 0.
1830 19 jeremybenn
 
1831
          Note: Support for external DMA is not provided in the current
1832 82 jeremybenn
          implementation, and this value is ignored.  In any case there
1833 19 jeremybenn
          is no equivalent field to which this can be matched in the
1834
          current DMA component implementation (*note DMA
1835
          Configuration: DMA Configuration.).
1836
 
1837
`irq = VALUE'
1838 82 jeremybenn
     Use VALUE as the IRQ number of this Ethernet MAC.  Default value 0.
1839 19 jeremybenn
 
1840
`rtx_type = 0|1'
1841
     If 1 (true) use a socket interface to the Ethernet (see parameter
1842 82 jeremybenn
     `sockif' below).  If 0 (the default), use a file interface,
1843
     reading and writing from and to the files specified in the
1844
     `rxfile' and `txfile' parameters (see below).
1845 19 jeremybenn
 
1846
          Note: By default the socket interface is not provided in
1847 82 jeremybenn
          Or1ksim.  If it is required, this must be requested when
1848 19 jeremybenn
          configuring, by use of the `--enable-ethphy' option to
1849
          `configure'.
1850
 
1851
               configure --target=or32-uclinux --enable-ethphy ...
1852
 
1853
`rx_channel = RXVALUE'
1854
`tx_channel = TXVALUE'
1855
     RXVALUE specifies the DMA channel to use for receive and TXVALUE
1856 82 jeremybenn
     the DMA channel to use for transmit.  Both default to 0.
1857 19 jeremybenn
 
1858
          Note: As noted above, support for external DMA is not
1859
          provided in the current implementation, and so these values
1860
          are ignored.
1861
 
1862
`rxfile = "RXFILE"'
1863
`txfile = "TXFILE"'
1864
     When `rtx_type' is 0 (see above), RXFILE specifies the file to use
1865
     as input and TXFILE specifies the fie to use as output.
1866
 
1867 82 jeremybenn
     The file contains a sequence of packets.  Each packet consists of a
1868
     packet length (32 bits), followed by that many bytes of data.
1869
     Once the input file is empty, the Ethernet MAC behaves as though
1870
     there were no data on the Ethernet.  The default values of these
1871 19 jeremybenn
     parameters are `"eth_rx"' and `"eth_tx"' respectively.
1872
 
1873 82 jeremybenn
     The input file must exist and be readable.  The output file must be
1874
     writable and will be created if necessary.  If either of these
1875 19 jeremybenn
     conditions is not met, a warning will be given.
1876
 
1877
`sockif = "SERVICE"'
1878
     When `rtx_type' is 1 (see above), SERVICE specifies the service to
1879 82 jeremybenn
     use for communication.  This may be TCP/IP or UDP/IP.  The default
1880 19 jeremybenn
     value of this parameter is `"or1ksim_eth"'.
1881
 
1882
`vapi_id = VALUE'
1883
     VALUE specifies the value of the Verification API (VAPI) base
1884 82 jeremybenn
     address to be used with the Ethernet PHY.  *Note Verification API:
1885 19 jeremybenn
     Verification API, for more details, which details the use of the
1886
     VAPI with the DMA controller.
1887
 
1888
 
1889

1890
File: or1ksim.info,  Node: GPIO Configuration,  Next: Display Interface Configuration,  Prev: Ethernet Configuration,  Up: Peripheral Configuration
1891
 
1892
3.4.5 GPIO Configuration
1893
------------------------
1894
 
1895
The GPIO used in Or1ksim is the component implemented at OpenCores, and
1896 98 jeremybenn
found in the top level SVN directory, `gpio'.  It is described in the
1897 19 jeremybenn
document `GPIO IP Core Specification' by Damjan Lampret and Goran
1898 82 jeremybenn
Djakovic, which can be found in the `doc' subdirectory.  It is a memory
1899 19 jeremybenn
mapped component, which resides on the main OpenRISC Wishbone data bus.
1900
 
1901 82 jeremybenn
GPIO configuration is described in `section gpio'.  This section may
1902
appear multiple times, specifying multiple GPIO devices.  The following
1903 19 jeremybenn
parameters may be specified.
1904
 
1905
`enabled = 0|1'
1906 82 jeremybenn
     If 1 (true, the default), this GPIO is enabled.  If 0, it is
1907 19 jeremybenn
     disabled.
1908
 
1909
`baseaddr = VALUE'
1910
     Set the base address of the GPIO's memory mapped registers to
1911 82 jeremybenn
     VALUE.  The default is 0, which is probably not a sensible value.
1912 19 jeremybenn
 
1913
     The GPIO has a 6 bit address bus, with a total of 10 32-bit
1914
     registers, although the number of bits that are actively used
1915 82 jeremybenn
     varies.  Addresses 0x28 through 0x3c are not used.
1916 19 jeremybenn
 
1917
`irq = VALUE'
1918 82 jeremybenn
     Use VALUE as the IRQ number of this GPIO.  Default value 0.
1919 19 jeremybenn
 
1920
`vapi_id = VALUE'
1921
     VALUE specifies the value of the Verification API (VAPI) base
1922 82 jeremybenn
     address to be used with the GPIO.  *Note Verification API:
1923 19 jeremybenn
     Verification API, for more details, which details the use of the
1924 82 jeremybenn
     VAPI with the GPIO controller.  For backwards compatibility, the
1925 19 jeremybenn
     alternative name `base_vapi_id' is supported for this parameter,
1926
     but deprecated.
1927
 
1928
 
1929

1930
File: or1ksim.info,  Node: Display Interface Configuration,  Next: Frame Buffer Configuration,  Prev: GPIO Configuration,  Up: Peripheral Configuration
1931
 
1932
3.4.6 Display Interface Configuration
1933
-------------------------------------
1934
 
1935
Or1ksim models a VGA interface to an external monitor.  The VGA
1936
controller used in Or1ksim is the component implemented at OpenCores,
1937 98 jeremybenn
and found in the top level SVN directory, `vga_lcd', with no support
1938 82 jeremybenn
for the optional hardware cursors.  It is described in the document
1939 19 jeremybenn
`VGA/LCD Core v2.0 Specifications' by Richard Herveille, which can be
1940 82 jeremybenn
found in the `doc' subdirectory.  It is a memory mapped component,
1941
which resides on the main OpenRISC Wishbone data bus.
1942 19 jeremybenn
 
1943
The current implementation provides only functionality to dump the
1944
screen to a file at intervals.
1945
 
1946 82 jeremybenn
VGA controller configuration is described in `section vga'.  This
1947 19 jeremybenn
section may appear multiple times, specifying multiple VGA controllers.
1948
The following parameters may be specified.
1949
 
1950
`enabled = 0|1'
1951 82 jeremybenn
     If 1 (true, the default), this VGA is enabled.  If 0, it is
1952 19 jeremybenn
     disabled.
1953
 
1954
`baseaddr = VALUE'
1955
     Set the base address of the VGA controller's memory mapped
1956 82 jeremybenn
     registers to VALUE.  The default is 0, which is probably not a
1957 19 jeremybenn
     sensible value.
1958
 
1959
     The VGA controller has a 12-bit address bus, with 7 32-bit
1960
     registers, at addresses 0x000 through 0x018, and two color lookup
1961 82 jeremybenn
     tables at addresses 0x800 through 0xfff.  The hardware cursor
1962 19 jeremybenn
     registers are not implemented, so addresses 0x01c through 0x7fc
1963
     are not used.
1964
 
1965
`irq = VALUE'
1966 82 jeremybenn
     Use VALUE as the IRQ number of this VGA controller.  Default value
1967 19 jeremybenn
     0.
1968
 
1969
`refresh_rate = VALUE'
1970 82 jeremybenn
     VALUE specifies number of cycles between screen dumps.  Default
1971 19 jeremybenn
     value is derived from the simulation clock cycle time (*note
1972
     Simulator Behavior: Simulator Behavior.), to correspond to dumping
1973
     50 times per simulated second.
1974
 
1975
`txfile = "FILE"'
1976
     FILE specifies the base of the filename for screen dumps.
1977
     Successive screen dumps will be in BMP format, in files with the
1978
     name `FILENNNN.bmp', where NNNN is a sequential count of the
1979 82 jeremybenn
     screen dumps starting at zero.  The default value is `"vga_out"'.
1980 19 jeremybenn
     For backwards compatibility, the alternative name `filename' is
1981
     supported for this parameter, but deprecated.
1982
 
1983
 
1984

1985
File: or1ksim.info,  Node: Frame Buffer Configuration,  Next: Keyboard Configuration,  Prev: Display Interface Configuration,  Up: Peripheral Configuration
1986
 
1987
3.4.7 Frame Buffer Configuration
1988
--------------------------------
1989
 
1990 82 jeremybenn
     Caution: The frame buffer is only partially implemented.  Its
1991 19 jeremybenn
     configuration fields are described here, but the component should
1992 82 jeremybenn
     not be used at this time.  Like the VGA controller, it is designed
1993 19 jeremybenn
     to make screen dumps to file.
1994
 
1995 82 jeremybenn
Frame buffer configuration is described in `section fb'.  This section
1996
may appear multiple times, specifying multiple frame buffers.  The
1997 19 jeremybenn
following parameters may be specified.
1998
 
1999
`enabled = 0|1'
2000 82 jeremybenn
     If 1 (true, the default), this frame buffer is enabled.  If 0, it
2001 19 jeremybenn
     is disabled.
2002
 
2003
`baseaddr = VALUE'
2004
     Set the base address of the frame buffer's memory mapped registers
2005 82 jeremybenn
     to VALUE.  The default is 0, which is probably not a sensible
2006
     value.
2007 19 jeremybenn
 
2008
     The frame buffer has an 121-bit address bus, with 4 32-bit
2009
     registers, at addresses 0x000 through 0x00c, and a PAL lookup
2010 82 jeremybenn
     table at addresses 0x400 through 0x4ff.  Addresses 0x010 through
2011 19 jeremybenn
     0x3fc and addresses 0x500 through 0x7ff are not used.
2012
 
2013
`refresh_rate = VALUE'
2014 82 jeremybenn
     VALUE specifies number of cycles between screen dumps.  Default
2015 19 jeremybenn
     value is derived from the simulation clock cycle time (*note
2016
     Simulator Behavior: Simulator Behavior.), to correspond to dumping
2017
     50 times per simulated second.
2018
 
2019
`txfile = "FILE"'
2020
     FILE specifies the base of the filename for screen dumps.
2021
     Successive screen dumps will be in BMP format, in files with the
2022
     name `FILENNNN.bmp', where NNNN is a sequential count of the
2023 82 jeremybenn
     screen dumps starting at zero.  The default value is `"fb_out"'.
2024 19 jeremybenn
     For backwards compatibility, the alternative name `filename' is
2025
     supported for this parameter, but deprecated.
2026
 
2027
 
2028

2029
File: or1ksim.info,  Node: Keyboard Configuration,  Next: Disc Interface Configuration,  Prev: Frame Buffer Configuration,  Up: Peripheral Configuration
2030
 
2031
3.4.8 Keyboard Configuration (PS2)
2032
----------------------------------
2033
 
2034 82 jeremybenn
The PS2 interface provided by Or1ksim is not documented.  It may be
2035 98 jeremybenn
based on the PS2 project at OpenCores, and found in the top level SVN
2036 82 jeremybenn
directory, `ps2'.  However this project lacks any documentation beyond
2037
its project webpage.  Since most PS2 interfaces follow the Intel i8042
2038 19 jeremybenn
standard, this is presumably what is expected with this device.
2039
 
2040
The implementation only provides for keyboard support, which is
2041 82 jeremybenn
modelled as a file of keystrokes.  There is no mouse support.
2042 19 jeremybenn
 
2043
     Caution: A standard i8042 device has two registers at addresses
2044 82 jeremybenn
     0x60 (command) and 0x64 (status).  Inspection of the code,
2045
     suggests that the Or1ksim component places these registers at
2046
     addresses 0x00 and 0x04.
2047 19 jeremybenn
 
2048
     The port of Linux for the OpenRISC 1000, which runs on Or1ksim
2049
     implements the i8042 device driver, anticipating these registers
2050 82 jeremybenn
     reside at their conventional address.  It seems unlikel that this
2051 19 jeremybenn
     code will work.
2052
 
2053
     This component should be used with caution.
2054
 
2055 82 jeremybenn
Keyboard configuration is described in `section kbd'.  This section may
2056
appear multiple times, specifying multiple keyboard interfaces.  The
2057 19 jeremybenn
following parameters may be specified.
2058
 
2059
`enabled = 0|1'
2060 82 jeremybenn
     If 1 (true, the default), this keyboard is enabled.  If 0, it is
2061 19 jeremybenn
     disabled.
2062
 
2063
`baseaddr = VALUE'
2064
     Set the base address of the keyboard's memory mapped registers to
2065 82 jeremybenn
     VALUE.  The default is 0, which is probably not a sensible value.
2066 19 jeremybenn
 
2067
     The keyboard PS/2 interface has an 3-bit address bus, with 2 8-bit
2068
     registers, at addresses 0x000 and 0x004.
2069
 
2070
          Caution: As noted above, a standard Intel 8042 interface
2071
          would expect to find these registers at locations 0x60 and
2072
          0x64, thus requiring at least a 7-bit bus.
2073
 
2074
`irq = VALUE'
2075 82 jeremybenn
     Use VALUE as the IRQ number of this Keyboard interface.  Default
2076 19 jeremybenn
     value 0.
2077
 
2078
`rxfile = "FILE"'
2079
     `file' specifies a file containing raw key stroke data, which
2080 82 jeremybenn
     models the input from a physical keyboard.  The default value is
2081 19 jeremybenn
     `"kbd_in"'.
2082
 
2083
 
2084

2085
File: or1ksim.info,  Node: Disc Interface Configuration,  Next: Generic Peripheral Configuration,  Prev: Keyboard Configuration,  Up: Peripheral Configuration
2086
 
2087
3.4.9 Disc Interface Configuration
2088
----------------------------------
2089
 
2090
The ATA/ATAPI disc controller used in Or1ksim is the OCIDEC (OpenCores
2091
IDE Controller) component implemented at OpenCores, and found in the
2092 98 jeremybenn
top level SVN directory, `ata'.  It is described in the document
2093 19 jeremybenn
`ATA/ATAPI-5 Core Specification' by Richard Herveille, which can be
2094 82 jeremybenn
found in the `doc' subdirectory.  It is a memory mapped component,
2095
which resides on the main OpenRISC Wishbone data bus.
2096 19 jeremybenn
 
2097 82 jeremybenn
ATA/ATAPI configuration is described in `section ata'.  This section
2098
may appear multiple times, specifying multiple disc controllers.  The
2099 19 jeremybenn
following parameters may be specified.
2100
 
2101
`enabled = 0|1'
2102 82 jeremybenn
     If 1 (true, the default), this ATA/ATAPI interface is enabled.  If
2103 19 jeremybenn
     0, it is disabled.
2104
 
2105
`baseaddr = VALUE'
2106
     Set the base address of the ATA/ATAPI interface's memory mapped
2107 82 jeremybenn
     registers to VALUE.  The default is 0, which is probably not a
2108 19 jeremybenn
     sensible value.
2109
 
2110
     The ATA/ATAPI PS/2 interface has an 5-bit address bus, with 8
2111 82 jeremybenn
     32-bit registers.  Depending on the version of the OCIDEC
2112
     ATA/ATAPI interface selected (see `dev_id' below), not all
2113
     registers will be available.
2114 19 jeremybenn
 
2115
`irq = VALUE'
2116 82 jeremybenn
     Use VALUE as the IRQ number of this ATA/ATAPI interface.  Default
2117 19 jeremybenn
     value 0.
2118
 
2119
`dev_id = 1|2|3'
2120
     This parameter specifies which version of the OCIDEC ATA/ATAPI
2121 82 jeremybenn
     interface to model.  The default value is 1.
2122 19 jeremybenn
 
2123
     Version 1 supports only the `CTRL', `STAT' and `PCTR' registers.
2124
     Versions 2 & 3 add the `FCTR' registers, Version 3 adds the `DTR'
2125
     registers and the `RXD'/`TXD' registers.
2126
 
2127
`rev = VALUE'
2128
     Set the VALUE as the revision of the OCIDEC ATA/ATAPI interface.
2129 82 jeremybenn
     The default value is 1.  The default value is 0.  Its value should
2130
     be in the range 0-15.  Larger values are truncated with a warning.
2131 19 jeremybenn
     This only affects the reset value of the `STAT' register, where it
2132
     forms bits 24-27.
2133
 
2134
`pio_mode0_t1 = VALUE'
2135
`pio_mode0_t2 = VALUE'
2136
`pio_mode0_t4 = VALUE'
2137
`pio_mode0_teoc = VALUE'
2138
     These parameters specify the timings for use with Programmed
2139 82 jeremybenn
     Input/Output (PIO) transfers.  They are specified as the number of
2140 19 jeremybenn
     clock cycles - 2, rounded up to the next highest integer, or zero
2141 82 jeremybenn
     if that would be negative.  The values should not exceed 255.  If
2142 19 jeremybenn
     they do, they will be ignored with a warning.
2143
 
2144
     See the ATA/ATAPI-5 specification for explanations of each of these
2145 82 jeremybenn
     timing parameters.  The default values are:
2146 19 jeremybenn
 
2147
          pio_mode0_t1   =  6
2148
          pio_mode0_t2   = 28
2149
          pio_mode0_t4   =  2
2150
          pio_mode0_teoc = 23
2151
 
2152
`dma_mode0_tm = VALUE'
2153
`dma_mode0_td = VALUE'
2154
`dma_mode0_teoc = VALUE'
2155
     These parameters specify the timings for use with DMA transfers.
2156
     They are specified as the number of clock cycles - 2, rounded up
2157
     to the next highest integer, or zero if that would be negative.
2158 82 jeremybenn
     The values should not exceed 255.  If they do, they will be
2159
     ignored with a warning.
2160 19 jeremybenn
 
2161
     See the ATA/ATAPI-5 specification for explanations of each of these
2162 82 jeremybenn
     timing parameters.  The default values are:
2163 19 jeremybenn
 
2164
          dma_mode0_tm   =  4
2165
          dma_mode0_td   = 21
2166
          dma_mode0_teoc = 21
2167
 
2168
 
2169
3.4.9.1 ATA/ATAPI Device Configuration
2170
......................................
2171
 
2172 82 jeremybenn
Within the `section ata', each device is specified separately.  The
2173 19 jeremybenn
device subsection is introduced by
2174
 
2175
     device VALUE
2176
 
2177 82 jeremybenn
VALUE is the device number, which should be 0 or 1.  The subsection
2178
ends with `enddevice'.  Note that if the same device number is
2179
specified more than once, the previous values will be overwritten.
2180
Within the `device' subsection, the following parameters may appear:
2181 19 jeremybenn
 
2182
`type = VALUE'
2183
     VALUEspecifies the type of device: 0 (the default) for "not
2184
     connected", 1 for hard disk simulated in a file and 2 for local
2185
     system hard disk.
2186
 
2187
`file = "FILENAME"'
2188
     `filename' specifies the file to be used for a simulated ATA
2189 82 jeremybenn
     device if the file type (see `type' above) is 1.  Default value
2190 19 jeremybenn
     `"ata-FileN"', where N is the device number.
2191
 
2192
`size = VALUE'
2193
     VALUE specifies the size of a simulated ATA device if the file
2194 82 jeremybenn
     type (see `type' above) is 1.  The default value is zero.
2195 19 jeremybenn
 
2196
`packet = 0|1'
2197 82 jeremybenn
     If 1 (true), implement the PACKET command feature set.  If 0 (the
2198 19 jeremybenn
     default), do not implement the PACKET command feature set.
2199
 
2200
`firmware = "STR"'
2201
     Firmware to report in response to the "Identify Device" command.
2202
     Default `"02207031"'.
2203
 
2204
`heads = VALUE'
2205 82 jeremybenn
     Number of heads in the device.  Default 7, use -1 to disable all
2206 19 jeremybenn
     heads.
2207
 
2208
`sectors = VALUE'
2209 82 jeremybenn
     Number of sectors per track in the device.  Default 32.
2210 19 jeremybenn
 
2211
`mwdma = 0|1|2|-1'
2212 82 jeremybenn
     Highest multi-word DMA mode supported.  Default 2, use -1 to
2213 19 jeremybenn
     disable.
2214
 
2215
`pio = 0|1|2|3|4'
2216 82 jeremybenn
     Highest PIO mode supported.  Default 4.
2217 19 jeremybenn
 
2218
 
2219

2220
File: or1ksim.info,  Node: Generic Peripheral Configuration,  Prev: Disc Interface Configuration,  Up: Peripheral Configuration
2221
 
2222
3.4.10 Generic Peripheral Configuration
2223
---------------------------------------
2224
 
2225
When used as a library (*note Simulator Library: Simulator Library.),
2226
Or1ksim makes provision for any additional peripheral to be implemented
2227 82 jeremybenn
externally.  Any read or write access to this peripheral's memory map
2228
generates "upcall"s to an external handler.  This interface can support
2229 19 jeremybenn
either C or C++, and was particularly designed to facilitate support
2230
for OSCI SystemC (see `http://www.systemc.org').
2231
 
2232
Generic peripheral configuration is described in `section generic'.
2233
This section may appear multiple times, specifying multiple external
2234 82 jeremybenn
peripherals.  The following parameters may be specified.
2235 19 jeremybenn
 
2236
`enabled = 0|1'
2237 82 jeremybenn
     If 1 (true, the default), this ATA/ATAPI interface is enabled.  If
2238 19 jeremybenn
     0, it is disabled.
2239
 
2240
`baseaddr = VALUE'
2241
     Set the base address of the generic peripheral's memory mapped
2242 82 jeremybenn
     registers to VALUE.  The default is 0, which is probably not a
2243 19 jeremybenn
     sensible value.
2244
 
2245
     The size of the memory mapped register space is controlled by the
2246
     `size' paramter, described below.
2247
 
2248
`size = VALUE'
2249
     Set the size of the generic peripheral's memory mapped register
2250 82 jeremybenn
     space to VALUE bytes.  Any read or write accesses to addresses with
2251 19 jeremybenn
     offsets of 0 to VALUE-1 bytes from the base address specified in
2252
     parameter `baseaddr' (see above) will be directed to the external
2253
     interface.
2254
 
2255 82 jeremybenn
     VALUE will be rounded up the nearest power of 2.  It's default
2256
     value is zero.  If VALUE is not an exact power of two, accesses to
2257 19 jeremybenn
     address offsets of VALUE or above up to the next power of 2 will
2258
     generate a warning, and have no effect (reads will return zero).
2259
 
2260
`name = "STR"'
2261 82 jeremybenn
     This gives the peripheral the name `"STR"'.  This is used to
2262 19 jeremybenn
     identify the peripheral in error messages and warnings, and when
2263 82 jeremybenn
     reporting its status.  The default value is
2264 19 jeremybenn
     `"anonymous external peripheral"'.
2265
 
2266
`byte_enabled = 0|1'
2267
`hw_enabled = 0|1'
2268
`word_enabled = 0|1'
2269
     If 1 (true, the default), these parameters respectively enable the
2270 82 jeremybenn
     device for byte wide, half-word wide and word wide accesses.  If 0,
2271 19 jeremybenn
     accesses of that width will fail.
2272
 
2273
 
2274

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

2471
File: or1ksim.info,  Node: Verification API,  Next: Code Internals,  Prev: Interactive Command Line,  Up: Top
2472
 
2473
5 Verification API (VAPI)
2474
*************************
2475
 
2476
The Verification API (VAPI) provides a TCP/IP interface to allow
2477 82 jeremybenn
components of the simulation to be controlled externally.  The
2478
interface is polled for new requests on each simulated clock cycle.
2479
Components within the simulator may send responses to such requests.
2480 19 jeremybenn
 
2481 82 jeremybenn
The inteface is an asynchronous duplex protocol.  On the request side
2482
it provides for simple commands, known as VAPI IDs (a 32 bit integer),
2483
with a single piece of data (also a 32 bit integer).  On the send side,
2484
it provides for sending a single VAPI ID and data.  However there is no
2485
explicit command-response structure.  Some components just accept
2486
requests (e.g.  to set values), some just generate sends (to report
2487 19 jeremybenn
values), and some do both.
2488
 
2489
Each component has a base ID (32 bit) and its commands will start from
2490 82 jeremybenn
that base ID.  This provides a simple partitioning of the command space
2491
amongst components.  Request commands will be directed to the component
2492 19 jeremybenn
with the closest base ID lower than the VAPI ID of the command.
2493
 
2494
Thus if there are two components with base IDs of 0x200 and 0x300, and
2495
a request with VAPI ID of 0x203 is received, it will be directed to the
2496
first component as its command #3.
2497
 
2498
The results of VAPI interactions are logged (by default in `vapi.log'
2499
unless an alternative is specified in `section vapi').
2500
 
2501
Currently the following components support VAPI:
2502
 
2503
Debug Unit
2504
     Although the Debug Unit can specify a base VAPI ID, it is not used
2505
     to send commands or receive requests.
2506
 
2507
     Instead, if the base VAPI ID is set, all remote JTAG protocol
2508
     exchanges are logged in the VAPI log file.
2509
 
2510
UART
2511
     If a base VAPI ID is specified, the UART sends details of any
2512
     chars or break characters sent, with dteails of the line control
2513
     register etc encoded in the data packet sent.
2514
 
2515
     This supports a single VAPI command request, but encodes a
2516
     sub-command in the top 8 bits of the associated data.
2517
 
2518
    `0x00'
2519
          This stuffs the least significant 8 bits of the data into the
2520
          serial register of the UART and the next 8 bits into the line
2521
          control register, effectively providing control of the next
2522
          character to be sent or received.
2523
 
2524
    `0x01'
2525
          The divisor latch bytes are set from the least significant 16
2526
          bits of the data.
2527
 
2528
    `0x02'
2529
          The line control register is set from bits 15-8 of the data.
2530
 
2531
    `0x03'
2532
          The UART skew is set from the least significant 16 bits of
2533
          the data
2534
 
2535
    `0x04'
2536
          If the 16th most significant bit of the data is 1, start
2537 82 jeremybenn
          sending breaks, otherwise stop sending breaks.  The breaks
2538
          are sent or cleared after the number of UART clock divider
2539
          ticks specified by the data (immediately if the data is zero).
2540 19 jeremybenn
 
2541
 
2542
DMA
2543
     Although the DMA unit supports a base VAPI ID in its configuration
2544
     (`section dma'), no VAPI data is sent, nor VAPI requests currently
2545
     implemented.
2546
 
2547
Ethernet
2548 82 jeremybenn
     The following requests are handled by the Ethernet.  Specified
2549 19 jeremybenn
     symbolically, these are the increments from the base VAPI ID of the
2550 82 jeremybenn
     Ethernet.  At present no implementation is provided behind these
2551 19 jeremybenn
     VAPI requests.
2552
 
2553
    `ETH_VAPI_DATA (0)'
2554
 
2555
    `ETH_VAPI_CTRL (0)'
2556
 
2557
GPIO
2558
     If a base VAPI ID is specified, the GPIO sends out on its base
2559
     VAPI ID (symbolically, GPIO_VAPI_DATA (0) offset from the base
2560
     VAPI ID) any changes in outputs.
2561
 
2562 82 jeremybenn
     The following requests are handled by the GPIO.  Specified
2563 19 jeremybenn
     symbolically, these are the increments from the VAPI base ID of the
2564
     GPIO.
2565
 
2566
    `GPIO_VAPI_DATA (0)'
2567
          Set the next input to the commands data field
2568
 
2569
    `GPIO_VAPI_AUX (1)'
2570
          Set the GPIO auxiliary inputs to the data field
2571
 
2572
    `GPIO_VAPI_CLOCK (2)'
2573
          Add an external GPIO clock trigger of period specified in the
2574
          data field.
2575
 
2576
    `GPIO_VAPI_RGPIO_OE (3)'
2577
          Set the GPIO output enable to the data field
2578
 
2579
    `GPIO_VAPI_RGPIO_INTE (4)'
2580
          Set the next interrupt to the data field
2581
 
2582
    `GPIO_VAPI_RGPIO_PTRIG (5)'
2583
          Set the next trigger to the data field
2584
 
2585
    `GPIO_VAPI_RGPIO_AUX (6)'
2586
          Set the next auxiliary input to the data field
2587
 
2588
    `GPIO_VAPI_RGPIO_CTRL (7)'
2589
          Set th next control input to the data field
2590
 
2591
 
2592
 
2593

2594
File: or1ksim.info,  Node: Code Internals,  Next: GNU Free Documentation License,  Prev: Verification API,  Up: Top
2595
 
2596
6 A Guide to Or1ksim Internals
2597
******************************
2598
 
2599 82 jeremybenn
These are notes to help those wanting to extend Or1ksim.  This section
2600 19 jeremybenn
assumes the use of a tag file, so file locations of entities'
2601 82 jeremybenn
definitions are not in general provided.  For more on tags, see the
2602
Linux manual page for `etags'.  A tag file can be created with:
2603 19 jeremybenn
 
2604
     make tags
2605
 
2606
* Menu:
2607
 
2608
* Coding Conventions::
2609
* Global Data Structures::
2610
* Concepts::
2611
* Internal Debugging::
2612
 
2613

2614
File: or1ksim.info,  Node: Coding Conventions,  Next: Global Data Structures,  Up: Code Internals
2615
 
2616
6.1 Coding Conventions for Or1ksim
2617
==================================
2618
 
2619
This chapter provides some guidelines for coding, to facilitate
2620
extensions to Or1ksim
2621
 
2622
_GNU Coding Standard_
2623
     Code should follow the GNU coding standard for C
2624 82 jeremybenn
     (`http://www.gnu.org/prep/standards/'.  If in doubt, put your code
2625 19 jeremybenn
     through the `indent' program.
2626
 
2627
_`#include' headers_
2628
     All C source code files should include `config.h' before any other
2629
     file.
2630
 
2631
     This should be followed by inclusion of any system headers (but see
2632
     the comments about portability and `port.h' below) and then by any
2633
     Or1ksim package headers.
2634
 
2635
     If `port.h' is required, it should be the first package header to
2636
     be included after the system headers.
2637
 
2638
     All C source code and header files should directly include any
2639 82 jeremybenn
     system or package header they depend on, i.e.  not rely on any
2640
     other header having already included it.  The two exceptions are
2641 19 jeremybenn
 
2642
       1. All header files may assume that `config.h' has already been
2643
          included.
2644
 
2645
       2. System headers which impose portability problems should be
2646
          included by using the package header `port.h', rather than
2647 82 jeremybenn
          the system headers themselves.  This is the case for code
2648 19 jeremybenn
          requiring
2649
 
2650
             * `strndup' (from `string.h')
2651
 
2652
             * Integer types (`intN_t', `uintN_t') (from `inttypes.h').
2653
 
2654
             * `isblank' (from `ctype.h')
2655
 
2656
 
2657
 
2658
_`#include' files once only_
2659
     All include files should be protected by `#ifndef' to ensure their
2660 82 jeremybenn
     definitions are only included once.  For instance a header file
2661 19 jeremybenn
     `X-Y.H' should surround its contents with:
2662
 
2663
          #ifndef X_Y__H
2664
          #define X_Y__H
2665
 
2666
          
2667
 
2668
          #endif  /* X_Y__H */
2669
 
2670
_Avoid `typedef'_
2671
     The GNU coding style for C does not have a clear way to distinguish
2672 82 jeremybenn
     between user type name and user variables.  For this reason
2673 19 jeremybenn
     `typedef' should be avoided except for the most ubiquitous user
2674 82 jeremybenn
     defined types.  This makes the code much easier to read.
2675 19 jeremybenn
 
2676
     There are some `typedef' declarations in the `argtable2' library
2677
     and the ELF and COFF headers, because this code is taken from
2678
     other places.
2679
 
2680
     Within Or1ksim legacy uses of `typedef' have largely been purged,
2681
     except in the Custom Unit Compiler (*note Custom Unit Compiler
2682
     (CUC) Configuration: CUC Configuration.).
2683
 
2684
     The remaining uses of `typedef' occur in two places:
2685
 
2686
        * `port/port.h' defines types to replace those in header files
2687
          that are not available (character functions, string
2688
          duplication, integer types).
2689
 
2690
          `cpu/or1k/arch.h' defines types for the key Or1ksim entities:
2691
          addresses (`oraddr_t'), unsigned register values (`uorreg_t')
2692
          and signed register (`orreg_t') values.
2693
 
2694
 
2695
     Where new types are defined, they should appear in one of these two
2696 82 jeremybenn
     files as appropriate.  Or1ksim specific types appearing in
2697
     `arch.h' should always have the suffix `_h'.
2698 19 jeremybenn
 
2699
_Don't begin names with underscore_
2700
     Names beginning with `_' are intended to be part of the C
2701 82 jeremybenn
     infrastructure.  They should not be used in the simulator code.
2702 19 jeremybenn
 
2703
_Keep Non-global top level entities static_
2704
     All top level entities (functions, variables), which are not
2705
     explicitly part of a global interface should be declared static.
2706
     This ensures that unwanted connections are not inadvertently built
2707
     across the program.
2708
 
2709
_Use of `inline'_
2710 82 jeremybenn
     Code should not be declared `inline'.  Modern compilers can work
2711 19 jeremybenn
     out for themselves what is best in this respect.
2712
 
2713
_Initialization_
2714 82 jeremybenn
     All data structures should be explicitly initialized.  In
2715
     particular code should not rely on static data structures being
2716
     initialized to zero.
2717 19 jeremybenn
 
2718
     The rationale is that in future static data structures may become
2719 82 jeremybenn
     dynamic.  This has been a particular source of bugs in Or1ksim
2720 19 jeremybenn
     historically.
2721
 
2722
     A specific case is with new peripherals, which should always
2723
     include a `start' function to pre-initialize all configuration
2724
     parameters to sensible defaults
2725
 
2726
_Configuration Validation_
2727
     All configuration values should be validated, preferably when
2728
     encountered, if not when the `section' is closed, or otherwise at
2729
     run time when the parameter is first used.
2730
 
2731
 
2732

2733
File: or1ksim.info,  Node: Global Data Structures,  Next: Concepts,  Prev: Coding Conventions,  Up: Code Internals
2734
 
2735
6.2 Global Data Structures
2736
==========================
2737
 
2738
`config'
2739
     The global variable `config' of type `struct config' holds the
2740
     configuration data for some of the Or1ksim components which are
2741 82 jeremybenn
     always present.  At present the components are:
2742 19 jeremybenn
 
2743
        * The simulator defined in `section sim' (*note Simulator
2744
          Configuration: Simulator Configuration.).
2745
 
2746
        * The Verification API (VAPI) defined  in `section vapi' (*note
2747
          Verification API (VAPI) Configuration: Verification API
2748
          Configuration.).
2749
 
2750
        * The Custom Unit Compiler (CUC), defined in `section cuc'
2751
          (*note Custom Unit Compiler (CUC) Configuration: CUC
2752
          Configuration.).
2753
 
2754
        * The CPU, defined in `section cpu' (*note CPU Configuration:
2755
          CPU Configuration.).
2756
 
2757
        * The data cache (but not the instruction cache), defined in
2758
          `section dc' (*note Cache Configuration: Cache
2759
          Configuration.).
2760
 
2761
        * The power management unit, defined in `section pm' (*note
2762
          Power Management Configuration: Power Management
2763
          Configuration.).
2764
 
2765
        * The programmable interrupt controller, defined in
2766
          `section pic' (*note Interrupt Configuration: Interrupt
2767
          Configuration.).
2768
 
2769
        * Branch prediciton, defined in `section bpb' (*note Branch
2770
          Prediction Configuration: Branch Prediction Configuration.).
2771
 
2772
        * The debug unit, defined in `section debug' (*note Debug
2773
          Interface Configuration: Debug Interface Configuration.).
2774
 
2775
 
2776
     This struct is made of a collection of structs, one for each
2777 82 jeremybenn
     component.  For example the simulator configuration is held in
2778 19 jeremybenn
     `config.sim'.
2779
 
2780
`config'
2781
     This is a linked list of data structures holding configuration data
2782
     for all sections which are not held in the main `config' data
2783 82 jeremybenn
     structure.  In general these are components (such as peripherals
2784
     and memory) which may occur multiple times.  However it also
2785
     handles some architectural components which may occur only once,
2786
     such as the memory management units, the instruction cache, the
2787
     interrupt controller and branch prediction.
2788 19 jeremybenn
 
2789
`runtime'
2790
     The global variable `runtime' of type `struct runtime' holds all
2791 82 jeremybenn
     the runtime information about the simulation.  To access this
2792 19 jeremybenn
     variable, `sim-config.h' must be included.
2793
 
2794
     This struct is itself made of 3 other structs, `cpu' (for CPU run
2795
     time state), `vapi' (for Verification API state) and `cuc' (for
2796
     Custom Unit Compiler state).
2797
 
2798
 
2799

2800
File: or1ksim.info,  Node: Concepts,  Next: Internal Debugging,  Prev: Global Data Structures,  Up: Code Internals
2801
 
2802
6.3 Concepts
2803
============
2804
 
2805
_Output Redirection_
2806 82 jeremybenn
     The current output stream is held in `runtime.cpu.fout'.  Output
2807 19 jeremybenn
     should be explicitly written to this stream, or may use the
2808
     `PRINTF' macro, which will write its arguments to this output
2809
     stream.
2810
 
2811
_Reset Hooks_
2812
     Any peripheral may register a routine to be called when the the
2813
     processor is reset by calling `reg_sim_reset', providing a
2814 82 jeremybenn
     function and pointer to a data structure as arguments.  On reset
2815 19 jeremybenn
     that function will be called with the data stucture pointer as
2816
     argument.
2817
 
2818
 
2819

2820
File: or1ksim.info,  Node: Internal Debugging,  Prev: Concepts,  Up: Code Internals
2821
 
2822
6.4 Internal Debugging
2823
======================
2824
 
2825
The function `debug' is like `printf', but with an extra first
2826 82 jeremybenn
argument, which is the debug level.  If the debug level specified in
2827
the simulator configuration (*note Simulator Behavior: Simulator
2828
Behavior.) is greater than or equal to this value, the remaining
2829
arguments are printed to the current output stream (*note Output
2830
Redirection: Output Redirection.).
2831 19 jeremybenn
 
2832

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

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

4124
Tag Table:
4125
Node: Top814
4126
Node: Installation1224
4127
Node: Preparation1471
4128 90 jeremybenn
Node: Configuring the Build1766
4129
Node: Build and Install7245
4130
Node: Known Issues8091
4131
Node: Usage10232
4132
Node: Standalone Simulator10446
4133
Node: Profiling Utility13349
4134
Node: Memory Profiling Utility14259
4135
Node: Simulator Library15624
4136 93 jeremybenn
Node: Configuration21816
4137
Node: Configuration File Format22425
4138
Node: Configuration File Preprocessing22717
4139
Node: Configuration File Syntax23088
4140
Node: Simulator Configuration25873
4141
Node: Simulator Behavior26164
4142
Node: Verification API Configuration30208
4143
Node: CUC Configuration32148
4144
Node: Core OpenRISC Configuration34065
4145
Node: CPU Configuration34567
4146 98 jeremybenn
Node: Memory Configuration38602
4147
Node: Memory Management Configuration45060
4148
Node: Cache Configuration47437
4149
Node: Interrupt Configuration49823
4150
Node: Power Management Configuration50559
4151
Node: Branch Prediction Configuration51836
4152
Node: Debug Interface Configuration53196
4153
Node: Peripheral Configuration57416
4154
Node: Memory Controller Configuration58042
4155
Node: UART Configuration61456
4156
Node: DMA Configuration64975
4157
Node: Ethernet Configuration66842
4158
Node: GPIO Configuration70818
4159
Node: Display Interface Configuration72451
4160
Node: Frame Buffer Configuration74760
4161
Node: Keyboard Configuration76624
4162
Node: Disc Interface Configuration78862
4163
Node: Generic Peripheral Configuration83805
4164
Node: Interactive Command Line86100
4165
Node: Verification API93074
4166
Node: Code Internals97504
4167
Node: Coding Conventions98064
4168
Node: Global Data Structures102491
4169
Node: Concepts105148
4170
Ref: Output Redirection105293
4171
Node: Internal Debugging105832
4172
Node: GNU Free Documentation License106329

powered by: WebSVN 2.1.0

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