blob: 9926093a407b34d4255faa1f77600b2c250915b7 [file] [log] [blame]
Stefan Kristiansson0e65f1a2011-11-26 19:04:55 +00001/* sim.cfg -- Simulator configuration script file
2 Copyright (C) 2001-2002, Marko Mlinar, markom@opencores.org
3
4This file is part of OpenRISC 1000 Architectural Simulator.
5It contains the default configuration and help about configuring
6the simulator.
7
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02008 * SPDX-License-Identifier: GPL-2.0+
9 */
Stefan Kristiansson0e65f1a2011-11-26 19:04:55 +000010
11
12/* INTRODUCTION
13
14 The ork1sim has various parameters, that are set in configuration files
15 like this one. The user can switch between configurations at startup by
16 specifying the required configuration file with the -f <filename.cfg> option.
17 If no configuration file is specified or1ksim searches for the default
18 configuration file sim.cfg. First it searches for './sim.cfg'. If this
19 file is not found, it searches for '~/or1k/sim.cfg'. If this file is
20 not found too, it reverts to the built-in default configuration.
21
22 NOTE: Users should not rely on the built-in configuration, since the
23 default configuration may differ between version.
24 Rather create a configuration file that sets all critical values.
25
26 This file may contain (standard C) comments only - no // support.
27
28 Configure files may be be included, using:
29 include "file_name_to_include"
30
31 Like normal configuration files, the included file is divided into
32 sections. Each section is described in detail also.
33
34 Some section have subsections. One example of such a subsection is:
35
36 device <index>
37 instance specific parameters...
38 enddevice
39
40 which creates a device instance.
41*/
42
43
44/* MEMORY SECTION
45
46 This section specifies how the memory is generated and the blocks
47 it consists of.
48
49 type = random/unknown/pattern
50 Specifies the initial memory values.
51 'random' generates random memory using seed 'random_seed'.
52 'pattern' fills memory with 'pattern'.
53 'unknown' does not specify how memory should be generated,
54 leaving the memory in a undefined state. This is the fastest
55 option.
56
57 random_seed = <value>
58 random seed for randomizer, used if type = 'random'.
59
60 pattern = <value>
61 pattern to fill memory, used if type = 'pattern'.
62
63 nmemories = <value>
64 number of memory instances connected
65
66 baseaddr = <hex_value>
67 memory start address
68
69 size = <hex_value>
70 memory size
71
72 name = "<string>"
73 memory block name
74
75 ce = <value>
76 chip enable index of the memory instance
77
78 mc = <value>
79 memory controller this memory is connected to
80
81 delayr = <value>
82 cycles, required for read access, -1 if instance does not support reading
83
84 delayw = <value>
85 cycles, required for write access, -1 if instance does not support writing
86
87 log = "<filename>"
88 filename, where to log memory accesses to, no log, if log command is not specified
89*/
90
91
92section memory
93 pattern = 0x00
94 type = unknown /* Fastest */
95
96 name = "FLASH"
97 ce = 0
98 mc = 0
99 baseaddr = 0xf0000000
100 size = 0x01000000
101 delayr = 1
102 delayw = -1
103end
104
105section memory
106 pattern = 0x00
107 type = unknown /* Fastest */
108
109 name = "RAM"
110 ce = 1
111 mc = 0
112 baseaddr = 0x00000000
113 size = 0x02000000
114 delayr = 1
115 delayw = 1
116end
117
118section memory
119 pattern = 0x00
120 type = unknown /* Fastest */
121
122 name = "SRAM"
123 mc = 0
124 ce = 2
125 baseaddr = 0xa4000000
126 size = 0x00100000
127 delayr = 1
128 delayw = 2
129end
130
131
132/* IMMU SECTION
133
134 This section configures the Instruction Memory Manangement Unit
135
136 enabled = 0/1
137 '0': disabled
138 '1': enabled
139 (NOTE: UPR bit is set)
140
141 nsets = <value>
142 number of ITLB sets; must be power of two
143
144 nways = <value>
145 number of ITLB ways
146
147 pagesize = <value>
148 instruction page size; must be power of two
149
150 entrysize = <value>
151 instruction entry size in bytes
152
153 ustates = <value>
154 number of ITLB usage states (2, 3, 4 etc., max is 4)
155
156 hitdelay = <value>
157 number of cycles immu hit costs
158
159 missdelay = <value>
160 number of cycles immu miss costs
161*/
162
163section immu
164 enabled = 1
165 nsets = 64
166 nways = 1
167 pagesize = 8192
168 hitdelay = 0
169 missdelay = 0
170end
171
172
173/* DMMU SECTION
174
175 This section configures the Data Memory Manangement Unit
176
177 enabled = 0/1
178 '0': disabled
179 '1': enabled
180 (NOTE: UPR bit is set)
181
182 nsets = <value>
183 number of DTLB sets; must be power of two
184
185 nways = <value>
186 number of DTLB ways
187
188 pagesize = <value>
189 data page size; must be power of two
190
191 entrysize = <value>
192 data entry size in bytes
193
194 ustates = <value>
195 number of DTLB usage states (2, 3, 4 etc., max is 4)
196
197 hitdelay = <value>
198 number of cycles dmmu hit costs
199
200 missdelay = <value>
201 number of cycles dmmu miss costs
202*/
203
204section dmmu
205 enabled = 1
206 nsets = 64
207 nways = 1
208 pagesize = 8192
209 hitdelay = 0
210 missdelay = 0
211end
212
213
214/* IC SECTION
215
216 This section configures the Instruction Cache
217
218 enabled = 0/1
219 '0': disabled
220 '1': enabled
221 (NOTE: UPR bit is set)
222
223 nsets = <value>
224 number of IC sets; must be power of two
225
226 nways = <value>
227 number of IC ways
228
229 blocksize = <value>
230 IC block size in bytes; must be power of two
231
232 ustates = <value>
233 number of IC usage states (2, 3, 4 etc., max is 4)
234
235 hitdelay = <value>
236 number of cycles ic hit costs
237
238 missdelay = <value>
239 number of cycles ic miss costs
240*/
241
242section ic
243 enabled = 1
244 nsets = 512
245 nways = 1
246 blocksize = 16
247 hitdelay = 1
248 missdelay = 1
249end
250
251
252/* DC SECTION
253
254 This section configures the Data Cache
255
256 enabled = 0/1
257 '0': disabled
258 '1': enabled
259 (NOTE: UPR bit is set)
260
261 nsets = <value>
262 number of DC sets; must be power of two
263
264 nways = <value>
265 number of DC ways
266
267 blocksize = <value>
268 DC block size in bytes; must be power of two
269
270 ustates = <value>
271 number of DC usage states (2, 3, 4 etc., max is 4)
272
273 load_hitdelay = <value>
274 number of cycles dc load hit costs
275
276 load_missdelay = <value>
277 number of cycles dc load miss costs
278
279 store_hitdelay = <value>
280 number of cycles dc load hit costs
281
282 store_missdelay = <value>
283 number of cycles dc load miss costs
284*/
285
286section dc
287 enabled = 1
288 nsets = 512
289 nways = 1
290 blocksize = 16
291 load_hitdelay = 1
292 load_missdelay = 1
293 store_hitdelay = 1
294 store_missdelay = 1
295end
296
297
298/* SIM SECTION
299
300 This section specifies how or1ksim should behave.
301
302 verbose = 0/1
303 '0': don't print extra messages
304 '1': print extra messages
305
306 debug = 0-9
307 0 : no debug messages
308 1-9: debug message level.
309 higher numbers produce more messages
310
311 profile = 0/1
312 '0': don't generate profiling file 'sim.profile'
313 '1': don't generate profiling file 'sim.profile'
314
315 prof_fn = "<filename>"
316 optional filename for the profiling file.
317 valid only if 'profile' is set
318
319 mprofile = 0/1
320 '0': don't generate memory profiling file 'sim.mprofile'
321 '1': generate memory profiling file 'sim.mprofile'
322
323 mprof_fn = "<filename>"
324 optional filename for the memory profiling file.
325 valid only if 'mprofile' is set
326
327 history = 0/1
328 '0': don't track execution flow
329 '1': track execution flow
330 Execution flow can be tracked for the simulator's
331 'hist' command. Useful for back-trace debugging.
332
333 iprompt = 0/1
334 '0': start in <not interactive prompt> (so what do we start in ???)
335 '1': start in interactive prompt.
336
337 exe_log = 0/1
338 '0': don't generate execution log.
339 '1': generate execution log.
340
341 exe_log = default/hardware/simple/software
342 type of execution log, default is used when not specified
343
344 exe_log_start = <value>
345 index of first instruction to start logging, default = 0
346
347 exe_log_end = <value>
348 index of last instruction to end logging; not limited, if omitted
349
350 exe_log_marker = <value>
351 <value> specifies number of instructions before horizontal marker is
352 printed; if zero, markers are disabled (default)
353
354 exe_log_fn = "<filename>"
355 filename for the exection log file.
356 valid only if 'exe_log' is set
357
358 clkcycle = <value>[ps|ns|us|ms]
359 specifies time measurement for one cycle
360*/
361
362section sim
363 verbose = 1
364 debug = 0
365 profile = 0
366 history = 0
367
368 clkcycle = 10ns
369end
370
371
372/* SECTION VAPI
373
374 This section configures the Verification API, used for Advanced
375 Core Verification.
376
377 enabled = 0/1
378 '0': disbable VAPI server
379 '1': enable/start VAPI server
380
381 server_port = <value>
382 TCP/IP port to start VAPI server on
383
384 log_enabled = 0/1
385 '0': disable VAPI requests logging
386 '1': enable VAPI requests logging
387
388 hide_device_id = 0/1
389 '0': don't log device id (for compatability with old version)
390 '1': log device id
391
392
393 vapi_fn = <filename>
394 filename for the log file.
395 valid only if log_enabled is set
396*/
397
398section VAPI
399 enabled = 0
400 server_port = 9998
401 log_enabled = 0
402 vapi_log_fn = "vapi.log"
403end
404
405
406/* CPU SECTION
407
408 This section specifies various CPU parameters.
409
410 ver = <value>
411 rev = <value>
412 specifies version and revision of the CPU used
413
414 upr = <value>
415 changes the upr register
416
417 sr = <value>
418 sets the initial Supervision Register value
419 supervisor mode (SM) and fixed one (FO) set = 0x8001
420 exception prefix high (EPH, vectors@0xf0000000) = 0x4000
421 together, (SM | FO | EPH) = 0xc001
422 superscalar = 0/1
423 '0': CPU is scalar
424 '1': CPU is superscalar
425 (modify cpu/or32/execute.c to tune superscalar model)
426
427 hazards = 0/1
428 '0': don't track data hazards in superscalar CPU
429 '1': track data hazards in superscalar CPU
430 If tracked, data hazards can be displayed using the
431 simulator's 'r' command.
432
433 dependstats = 0/1
434 '0': don't calculate inter-instruction dependencies.
435 '1': calculate inter-instruction dependencies.
436 If calculated, inter-instruction dependencies can be
437 displayed using the simulator's 'stat' command.
438
439 sbuf_len = <value>
440 length of store buffer (<= 256), 0 = disabled
441*/
442
443section cpu
444 ver = 0x12
445 cfg = 0x00
446 rev = 0x01
447 sr = 0x8001 /*SPR_SR_FO | SPR_SR_SM | SPR_SR_EPH */
448 /* upr = */
449 superscalar = 0
450 hazards = 0
451 dependstats = 0
452 sbuf_len = 0
453end
454
455
456/* PM SECTION
457
458 This section specifies Power Management parameters
459
460 enabled = 0/1
461 '0': disable power management
462 '1': enable power management
463*/
464
465section pm
466 enabled = 0
467end
468
469
470/* BPB SECTION
471
472 This section specifies how branch prediction should behave.
473
474 enabled = 0/1
475 '0': disable branch prediction
476 '1': enable branch prediction
477
478 btic = 0/1
479 '0': disable branch target instruction cache model
480 '1': enable branch target instruction cache model
481
482 sbp_bf_fwd = 0/1
483 Static branch prediction for 'l.bf'
484 '0': don't use forward prediction
485 '1': use forward prediction
486
487 sbp_bnf_fwd = 0/1
488 Static branch prediction for 'l.bnf'
489 '0': don't use forward prediction
490 '1': use forward prediction
491
492 hitdelay = <value>
493 number of cycles bpb hit costs
494
495 missdelay = <value>
496 number of cycles bpb miss costs
497*/
498
499section bpb
500 enabled = 0
501 btic = 0
502 sbp_bf_fwd = 0
503 sbp_bnf_fwd = 0
504 hitdelay = 0
505 missdelay = 0
506end
507
508
509/* DEBUG SECTION
510
511 This sections specifies how the debug unit should behave.
512
513 enabled = 0/1
514 '0': disable debug unit
515 '1': enable debug unit
516
517 gdb_enabled = 0/1
518 '0': don't start gdb server
519 '1': start gdb server at port 'server_port'
520
521 server_port = <value>
522 TCP/IP port to start gdb server on
523 valid only if gdb_enabled is set
524
525 vapi_id = <hex_value>
526 Used to create "fake" vapi log file containing the JTAG proxy messages.
527*/
528section debug
529 enabled = 0
530/* gdb_enabled = 0 */
531/* server_port = 9999*/
532 rsp_enabled = 1
533 rsp_port = 50001
534end
535
536
537/* MC SECTION
538
539 This section configures the memory controller
540
541 enabled = 0/1
542 '0': disable memory controller
543 '1': enable memory controller
544
545 baseaddr = <hex_value>
546 address of first MC register
547
548 POC = <hex_value>
549 Power On Configuration register
550
551 index = <value>
552 Index of this memory controller amongst all the memory controllers
553*/
554
555section mc
556 enabled = 0
557 baseaddr = 0x93000000
558 POC = 0x00000008 /* Power on configuration register */
559 index = 0
560end
561
562
563/* UART SECTION
564
565 This section configures the UARTs
566
567 enabled = <0|1>
568 Enable/disable the peripheral. By default if it is enabled.
569
570 baseaddr = <hex_value>
571 address of first UART register for this device
572
573
574 channel = <channeltype>:<args>
575
576 The channel parameter indicates the source of received UART characters
577 and the sink for transmitted UART characters.
578
579 The <channeltype> can be either "file", "xterm", "tcp", "fd", or "tty"
580 (without quotes).
581
582 A) To send/receive characters from a pair of files, use a file
583 channel:
584
585 channel=file:<rxfile>,<txfile>
586
587 B) To create an interactive terminal window, use an xterm channel:
588
589 channel=xterm:[<xterm_arg>]*
590
591 C) To create a bidirectional tcp socket which one could, for example,
592 access via telnet, use a tcp channel:
593
594 channel=tcp:<port number>
595
596 D) To cause the UART to read/write from existing numeric file
597 descriptors, use an fd channel:
598
599 channel=fd:<rx file descriptor num>,<tx file descriptor num>
600
601 E) To connect the UART to a physical serial port, create a tty
602 channel:
603
604 channel=tty:device=/dev/ttyS0,baud=9600
605
606 irq = <value>
607 irq number for this device
608
609 16550 = 0/1
610 '0': this device is a UART16450
611 '1': this device is a UART16550
612
613 jitter = <value>
614 in msecs... time to block, -1 to disable it
615
616 vapi_id = <hex_value>
617 VAPI id of this instance
618*/
619
620section uart
621 enabled = 1
622 baseaddr = 0x90000000
623 irq = 2
624 /* channel = "file:uart0.rx,uart0.tx" */
625 /* channel = "tcp:10084" */
626 channel = "xterm:"
627 jitter = -1 /* async behaviour */
628 16550 = 1
629end
630
631
632/* DMA SECTION
633
634 This section configures the DMAs
635
636 enabled = <0|1>
637 Enable/disable the peripheral. By default if it is enabled.
638
639 baseaddr = <hex_value>
640 address of first DMA register for this device
641
642 irq = <value>
643 irq number for this device
644
645 vapi_id = <hex_value>
646 VAPI id of this instance
647*/
648
649section dma
650 enabled = 1
651 baseaddr = 0x9a000000
652 irq = 11
653end
654
655
656/* ETHERNET SECTION
657
658 This section configures the ETHERNETs
659
660 enabled = <0|1>
661 Enable/disable the peripheral. By default if it is enabled.
662
663 baseaddr = <hex_value>
664 address of first ethernet register for this device
665
666 dma = <value>
667 which controller is this ethernet "connected" to
668
669 irq = <value>
670 ethernet mac IRQ level
671
672 rtx_type = <value>
673 use 0 - file interface, 1 - socket interface
674
675 rx_channel = <value>
676 DMA channel used for RX
677
678 tx_channel = <value>
679 DMA channel used for TX
680
681 rxfile = "<filename>"
682 filename, where to read data from
683
684 txfile = "<filename>"
685 filename, where to write data to
686
687 sockif = "<ifacename>"
688 interface name of ethernet socket
689
690 vapi_id = <hex_value>
691 VAPI id of this instance
692*/
693
694section ethernet
695 enabled = 1
696 baseaddr = 0x92000000
697 /* dma = 0 */
698 irq = 4
699 rtx_type = "tap"
700 tap_dev = "tap0"
701 /* tx_channel = 0 */
702 /* rx_channel = 1 */
703 rxfile = "eth0.rx"
704 txfile = "eth0.tx"
705 sockif = "eth0"
706end
707
708
709/* GPIO SECTION
710
711 This section configures the GPIOs
712
713 enabled = <0|1>
714 Enable/disable the peripheral. By default if it is enabled.
715
716 baseaddr = <hex_value>
717 address of first GPIO register for this device
718
719 irq = <value>
720 irq number for this device
721
722 base_vapi_id = <hex_value>
723 first VAPI id of this instance
724 GPIO uses 8 consecutive VAPI IDs
725*/
726
727section gpio
728 enabled = 0
729 baseaddr = 0x91000000
730 irq = 3
731 base_vapi_id = 0x0200
732end
733
734/* VGA SECTION
735
736 This section configures the VGA/LCD controller
737
738 enabled = <0|1>
739 Enable/disable the peripheral. By default if it is enabled.
740
741 baseaddr = <hex_value>
742 address of first VGA register
743
744 irq = <value>
745 irq number for this device
746
747 refresh_rate = <value>
748 number of cycles between screen dumps
749
750 filename = "<filename>"
751 template name for generated names (e.g. "primary" produces "primary0023.bmp")
752*/
753
754section vga
755 enabled = 0
756 baseaddr = 0x97100000
757 irq = 8
758 refresh_rate = 100000
759 filename = "primary"
760end
761
762
763/* TICK TIMER SECTION
764
765 This section configures tick timer
766
767 enabled = 0/1
768 whether tick timer is enabled
769*/
770
771section pic
772 enabled = 1
773 edge_trigger = 1
774end
775
776/* FB SECTION
777
778 This section configures the frame buffer
779
780 enabled = <0|1>
781 Enable/disable the peripheral. By default if it is enabled.
782
783 baseaddr = <hex_value>
784 base address of frame buffer
785
786 paladdr = <hex_value>
787 base address of first palette entry
788
789 refresh_rate = <value>
790 number of cycles between screen dumps
791
792 filename = "<filename>"
793 template name for generated names (e.g. "primary" produces "primary0023.bmp")
794*/
795
796section fb
797 enabled = 0
798 baseaddr = 0x97000000
799 refresh_rate = 1000000
800 filename = "primary"
801end
802
803
804/* KBD SECTION
805
806 This section configures the PS/2 compatible keyboard
807
808 baseaddr = <hex_value>
809 base address of the keyboard device
810
811 rxfile = "<filename>"
812 filename, where to read data from
813*/
814
815section kbd
816 enabled = 0
817 irq = 5
818 baseaddr = 0x94000000
819 rxfile = "kbd.rx"
820end
821
822
823/* ATA SECTION
824
825 This section configures the ATA/ATAPI host controller
826
827 baseaddr = <hex_value>
828 address of first ATA register
829
830 enabled = <0|1>
831 Enable/disable the peripheral. By default if it is enabled.
832
833 irq = <value>
834 irq number for this device
835
836 debug = <value>
837 debug level for ata models.
838 0: no debug messages
839 1: verbose messages
840 3: normal messages (more messages than verbose)
841 5: debug messages (normal debug messages)
842 7: flow control messages (debug statemachine flows)
843 9: low priority message (display everything the code does)
844
845 dev_type0/1 = <value>
846 ata device 0 type
847 0: NO_CONNeCT: none (not connected)
848 1: FILE : simulated harddisk
849 2: LOCAL : local system harddisk
850
851 dev_file0/1 = "<filename>"
852 filename for simulated ATA device
853 valid only if dev_type0 == 1
854
855 dev_size0/1 = <value>
856 size of simulated hard-disk (in MBytes)
857 valid only if dev_type0 == 1
858
859 dev_packet0/1 = <value>
860 0: simulated ATA device does NOT implement PACKET command feature set
861 1: simulated ATA device does implement PACKET command feature set
862
863 FIXME: irq number
864*/
865
866section ata
867 enabled = 0
868 baseaddr = 0x9e000000
869 irq = 15
870
871end