1 /* sim.cfg -- Simulator configuration script file
4 This file is part of OpenRISC 1000 Architectural Simulator.
5 It contains the default configuration and help about configuring
8 * SPDX-License-Identifier: GPL-2.0+
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.
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.
26 This file may contain (standard C) comments only - no // support.
28 Configure files may be be included, using:
29 include "file_name_to_include"
31 Like normal configuration files, the included file is divided into
32 sections. Each section is described in detail also.
34 Some section have subsections. One example of such a subsection is:
37 instance specific parameters...
40 which creates a device instance.
46 This section specifies how the memory is generated and the blocks
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
58 random seed for randomizer, used if type = 'random'.
61 pattern to fill memory, used if type = 'pattern'.
64 number of memory instances connected
66 baseaddr = <hex_value>
76 chip enable index of the memory instance
79 memory controller this memory is connected to
82 cycles, required for read access, -1 if instance does not support reading
85 cycles, required for write access, -1 if instance does not support writing
88 filename, where to log memory accesses to, no log, if log command is not specified
94 type = unknown /* Fastest */
107 type = unknown /* Fastest */
112 baseaddr = 0x00000000
120 type = unknown /* Fastest */
125 baseaddr = 0xa4000000
134 This section configures the Instruction Memory Manangement Unit
139 (NOTE: UPR bit is set)
142 number of ITLB sets; must be power of two
148 instruction page size; must be power of two
151 instruction entry size in bytes
154 number of ITLB usage states (2, 3, 4 etc., max is 4)
157 number of cycles immu hit costs
160 number of cycles immu miss costs
175 This section configures the Data Memory Manangement Unit
180 (NOTE: UPR bit is set)
183 number of DTLB sets; must be power of two
189 data page size; must be power of two
192 data entry size in bytes
195 number of DTLB usage states (2, 3, 4 etc., max is 4)
198 number of cycles dmmu hit costs
201 number of cycles dmmu miss costs
216 This section configures the Instruction Cache
221 (NOTE: UPR bit is set)
224 number of IC sets; must be power of two
230 IC block size in bytes; must be power of two
233 number of IC usage states (2, 3, 4 etc., max is 4)
236 number of cycles ic hit costs
239 number of cycles ic miss costs
254 This section configures the Data Cache
259 (NOTE: UPR bit is set)
262 number of DC sets; must be power of two
268 DC block size in bytes; must be power of two
271 number of DC usage states (2, 3, 4 etc., max is 4)
273 load_hitdelay = <value>
274 number of cycles dc load hit costs
276 load_missdelay = <value>
277 number of cycles dc load miss costs
279 store_hitdelay = <value>
280 number of cycles dc load hit costs
282 store_missdelay = <value>
283 number of cycles dc load miss costs
300 This section specifies how or1ksim should behave.
303 '0': don't print extra messages
304 '1': print extra messages
307 0 : no debug messages
308 1-9: debug message level.
309 higher numbers produce more messages
312 '0': don't generate profiling file 'sim.profile'
313 '1': don't generate profiling file 'sim.profile'
315 prof_fn = "<filename>"
316 optional filename for the profiling file.
317 valid only if 'profile' is set
320 '0': don't generate memory profiling file 'sim.mprofile'
321 '1': generate memory profiling file 'sim.mprofile'
323 mprof_fn = "<filename>"
324 optional filename for the memory profiling file.
325 valid only if 'mprofile' is set
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.
334 '0': start in <not interactive prompt> (so what do we start in ???)
335 '1': start in interactive prompt.
338 '0': don't generate execution log.
339 '1': generate execution log.
341 exe_log = default/hardware/simple/software
342 type of execution log, default is used when not specified
344 exe_log_start = <value>
345 index of first instruction to start logging, default = 0
347 exe_log_end = <value>
348 index of last instruction to end logging; not limited, if omitted
350 exe_log_marker = <value>
351 <value> specifies number of instructions before horizontal marker is
352 printed; if zero, markers are disabled (default)
354 exe_log_fn = "<filename>"
355 filename for the exection log file.
356 valid only if 'exe_log' is set
358 clkcycle = <value>[ps|ns|us|ms]
359 specifies time measurement for one cycle
374 This section configures the Verification API, used for Advanced
378 '0': disbable VAPI server
379 '1': enable/start VAPI server
381 server_port = <value>
382 TCP/IP port to start VAPI server on
385 '0': disable VAPI requests logging
386 '1': enable VAPI requests logging
389 '0': don't log device id (for compatability with old version)
394 filename for the log file.
395 valid only if log_enabled is set
402 vapi_log_fn = "vapi.log"
408 This section specifies various CPU parameters.
412 specifies version and revision of the CPU used
415 changes the upr register
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
424 '1': CPU is superscalar
425 (modify cpu/or32/execute.c to tune superscalar model)
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.
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.
440 length of store buffer (<= 256), 0 = disabled
447 sr = 0x8001 /*SPR_SR_FO | SPR_SR_SM | SPR_SR_EPH */
458 This section specifies Power Management parameters
461 '0': disable power management
462 '1': enable power management
472 This section specifies how branch prediction should behave.
475 '0': disable branch prediction
476 '1': enable branch prediction
479 '0': disable branch target instruction cache model
480 '1': enable branch target instruction cache model
483 Static branch prediction for 'l.bf'
484 '0': don't use forward prediction
485 '1': use forward prediction
488 Static branch prediction for 'l.bnf'
489 '0': don't use forward prediction
490 '1': use forward prediction
493 number of cycles bpb hit costs
496 number of cycles bpb miss costs
511 This sections specifies how the debug unit should behave.
514 '0': disable debug unit
515 '1': enable debug unit
518 '0': don't start gdb server
519 '1': start gdb server at port 'server_port'
521 server_port = <value>
522 TCP/IP port to start gdb server on
523 valid only if gdb_enabled is set
525 vapi_id = <hex_value>
526 Used to create "fake" vapi log file containing the JTAG proxy messages.
530 /* gdb_enabled = 0 */
531 /* server_port = 9999*/
539 This section configures the memory controller
542 '0': disable memory controller
543 '1': enable memory controller
545 baseaddr = <hex_value>
546 address of first MC register
549 Power On Configuration register
552 Index of this memory controller amongst all the memory controllers
557 baseaddr = 0x93000000
558 POC = 0x00000008 /* Power on configuration register */
565 This section configures the UARTs
568 Enable/disable the peripheral. By default if it is enabled.
570 baseaddr = <hex_value>
571 address of first UART register for this device
574 channel = <channeltype>:<args>
576 The channel parameter indicates the source of received UART characters
577 and the sink for transmitted UART characters.
579 The <channeltype> can be either "file", "xterm", "tcp", "fd", or "tty"
582 A) To send/receive characters from a pair of files, use a file
585 channel=file:<rxfile>,<txfile>
587 B) To create an interactive terminal window, use an xterm channel:
589 channel=xterm:[<xterm_arg>]*
591 C) To create a bidirectional tcp socket which one could, for example,
592 access via telnet, use a tcp channel:
594 channel=tcp:<port number>
596 D) To cause the UART to read/write from existing numeric file
597 descriptors, use an fd channel:
599 channel=fd:<rx file descriptor num>,<tx file descriptor num>
601 E) To connect the UART to a physical serial port, create a tty
604 channel=tty:device=/dev/ttyS0,baud=9600
607 irq number for this device
610 '0': this device is a UART16450
611 '1': this device is a UART16550
614 in msecs... time to block, -1 to disable it
616 vapi_id = <hex_value>
617 VAPI id of this instance
622 baseaddr = 0x90000000
624 /* channel = "file:uart0.rx,uart0.tx" */
625 /* channel = "tcp:10084" */
627 jitter = -1 /* async behaviour */
634 This section configures the DMAs
637 Enable/disable the peripheral. By default if it is enabled.
639 baseaddr = <hex_value>
640 address of first DMA register for this device
643 irq number for this device
645 vapi_id = <hex_value>
646 VAPI id of this instance
651 baseaddr = 0x9a000000
658 This section configures the ETHERNETs
661 Enable/disable the peripheral. By default if it is enabled.
663 baseaddr = <hex_value>
664 address of first ethernet register for this device
667 which controller is this ethernet "connected" to
670 ethernet mac IRQ level
673 use 0 - file interface, 1 - socket interface
676 DMA channel used for RX
679 DMA channel used for TX
681 rxfile = "<filename>"
682 filename, where to read data from
684 txfile = "<filename>"
685 filename, where to write data to
687 sockif = "<ifacename>"
688 interface name of ethernet socket
690 vapi_id = <hex_value>
691 VAPI id of this instance
696 baseaddr = 0x92000000
711 This section configures the GPIOs
714 Enable/disable the peripheral. By default if it is enabled.
716 baseaddr = <hex_value>
717 address of first GPIO register for this device
720 irq number for this device
722 base_vapi_id = <hex_value>
723 first VAPI id of this instance
724 GPIO uses 8 consecutive VAPI IDs
729 baseaddr = 0x91000000
731 base_vapi_id = 0x0200
736 This section configures the VGA/LCD controller
739 Enable/disable the peripheral. By default if it is enabled.
741 baseaddr = <hex_value>
742 address of first VGA register
745 irq number for this device
747 refresh_rate = <value>
748 number of cycles between screen dumps
750 filename = "<filename>"
751 template name for generated names (e.g. "primary" produces "primary0023.bmp")
756 baseaddr = 0x97100000
758 refresh_rate = 100000
763 /* TICK TIMER SECTION
765 This section configures tick timer
768 whether tick timer is enabled
778 This section configures the frame buffer
781 Enable/disable the peripheral. By default if it is enabled.
783 baseaddr = <hex_value>
784 base address of frame buffer
786 paladdr = <hex_value>
787 base address of first palette entry
789 refresh_rate = <value>
790 number of cycles between screen dumps
792 filename = "<filename>"
793 template name for generated names (e.g. "primary" produces "primary0023.bmp")
798 baseaddr = 0x97000000
799 refresh_rate = 1000000
806 This section configures the PS/2 compatible keyboard
808 baseaddr = <hex_value>
809 base address of the keyboard device
811 rxfile = "<filename>"
812 filename, where to read data from
818 baseaddr = 0x94000000
825 This section configures the ATA/ATAPI host controller
827 baseaddr = <hex_value>
828 address of first ATA register
831 Enable/disable the peripheral. By default if it is enabled.
834 irq number for this device
837 debug level for ata models.
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)
845 dev_type0/1 = <value>
847 0: NO_CONNeCT: none (not connected)
848 1: FILE : simulated harddisk
849 2: LOCAL : local system harddisk
851 dev_file0/1 = "<filename>"
852 filename for simulated ATA device
853 valid only if dev_type0 == 1
855 dev_size0/1 = <value>
856 size of simulated hard-disk (in MBytes)
857 valid only if dev_type0 == 1
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
868 baseaddr = 0x9e000000