or1ksim.cfg 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882
  1. /* sim.cfg -- Simulator configuration script file
  2. Copyright (C) 2001-2002, Marko Mlinar, markom@opencores.org
  3. This file is part of OpenRISC 1000 Architectural Simulator.
  4. It contains the default configuration and help about configuring
  5. the simulator.
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
  17. /* INTRODUCTION
  18. The ork1sim has various parameters, that are set in configuration files
  19. like this one. The user can switch between configurations at startup by
  20. specifying the required configuration file with the -f <filename.cfg> option.
  21. If no configuration file is specified or1ksim searches for the default
  22. configuration file sim.cfg. First it searches for './sim.cfg'. If this
  23. file is not found, it searches for '~/or1k/sim.cfg'. If this file is
  24. not found too, it reverts to the built-in default configuration.
  25. NOTE: Users should not rely on the built-in configuration, since the
  26. default configuration may differ between version.
  27. Rather create a configuration file that sets all critical values.
  28. This file may contain (standard C) comments only - no // support.
  29. Configure files may be be included, using:
  30. 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.
  33. Some section have subsections. One example of such a subsection is:
  34. device <index>
  35. instance specific parameters...
  36. enddevice
  37. which creates a device instance.
  38. */
  39. /* MEMORY SECTION
  40. This section specifies how the memory is generated and the blocks
  41. it consists of.
  42. type = random/unknown/pattern
  43. Specifies the initial memory values.
  44. 'random' generates random memory using seed 'random_seed'.
  45. 'pattern' fills memory with 'pattern'.
  46. 'unknown' does not specify how memory should be generated,
  47. leaving the memory in a undefined state. This is the fastest
  48. option.
  49. random_seed = <value>
  50. random seed for randomizer, used if type = 'random'.
  51. pattern = <value>
  52. pattern to fill memory, used if type = 'pattern'.
  53. nmemories = <value>
  54. number of memory instances connected
  55. baseaddr = <hex_value>
  56. memory start address
  57. size = <hex_value>
  58. memory size
  59. name = "<string>"
  60. memory block name
  61. ce = <value>
  62. chip enable index of the memory instance
  63. mc = <value>
  64. memory controller this memory is connected to
  65. delayr = <value>
  66. cycles, required for read access, -1 if instance does not support reading
  67. delayw = <value>
  68. cycles, required for write access, -1 if instance does not support writing
  69. log = "<filename>"
  70. filename, where to log memory accesses to, no log, if log command is not specified
  71. */
  72. section memory
  73. pattern = 0x00
  74. type = unknown /* Fastest */
  75. name = "FLASH"
  76. ce = 0
  77. mc = 0
  78. baseaddr = 0xf0000000
  79. size = 0x01000000
  80. delayr = 1
  81. delayw = -1
  82. end
  83. section memory
  84. pattern = 0x00
  85. type = unknown /* Fastest */
  86. name = "RAM"
  87. ce = 1
  88. mc = 0
  89. baseaddr = 0x00000000
  90. size = 0x02000000
  91. delayr = 1
  92. delayw = 1
  93. end
  94. section memory
  95. pattern = 0x00
  96. type = unknown /* Fastest */
  97. name = "SRAM"
  98. mc = 0
  99. ce = 2
  100. baseaddr = 0xa4000000
  101. size = 0x00100000
  102. delayr = 1
  103. delayw = 2
  104. end
  105. /* IMMU SECTION
  106. This section configures the Instruction Memory Manangement Unit
  107. enabled = 0/1
  108. '0': disabled
  109. '1': enabled
  110. (NOTE: UPR bit is set)
  111. nsets = <value>
  112. number of ITLB sets; must be power of two
  113. nways = <value>
  114. number of ITLB ways
  115. pagesize = <value>
  116. instruction page size; must be power of two
  117. entrysize = <value>
  118. instruction entry size in bytes
  119. ustates = <value>
  120. number of ITLB usage states (2, 3, 4 etc., max is 4)
  121. hitdelay = <value>
  122. number of cycles immu hit costs
  123. missdelay = <value>
  124. number of cycles immu miss costs
  125. */
  126. section immu
  127. enabled = 1
  128. nsets = 64
  129. nways = 1
  130. pagesize = 8192
  131. hitdelay = 0
  132. missdelay = 0
  133. end
  134. /* DMMU SECTION
  135. This section configures the Data Memory Manangement Unit
  136. enabled = 0/1
  137. '0': disabled
  138. '1': enabled
  139. (NOTE: UPR bit is set)
  140. nsets = <value>
  141. number of DTLB sets; must be power of two
  142. nways = <value>
  143. number of DTLB ways
  144. pagesize = <value>
  145. data page size; must be power of two
  146. entrysize = <value>
  147. data entry size in bytes
  148. ustates = <value>
  149. number of DTLB usage states (2, 3, 4 etc., max is 4)
  150. hitdelay = <value>
  151. number of cycles dmmu hit costs
  152. missdelay = <value>
  153. number of cycles dmmu miss costs
  154. */
  155. section dmmu
  156. enabled = 1
  157. nsets = 64
  158. nways = 1
  159. pagesize = 8192
  160. hitdelay = 0
  161. missdelay = 0
  162. end
  163. /* IC SECTION
  164. This section configures the Instruction Cache
  165. enabled = 0/1
  166. '0': disabled
  167. '1': enabled
  168. (NOTE: UPR bit is set)
  169. nsets = <value>
  170. number of IC sets; must be power of two
  171. nways = <value>
  172. number of IC ways
  173. blocksize = <value>
  174. IC block size in bytes; must be power of two
  175. ustates = <value>
  176. number of IC usage states (2, 3, 4 etc., max is 4)
  177. hitdelay = <value>
  178. number of cycles ic hit costs
  179. missdelay = <value>
  180. number of cycles ic miss costs
  181. */
  182. section ic
  183. enabled = 1
  184. nsets = 512
  185. nways = 1
  186. blocksize = 16
  187. hitdelay = 1
  188. missdelay = 1
  189. end
  190. /* DC SECTION
  191. This section configures the Data Cache
  192. enabled = 0/1
  193. '0': disabled
  194. '1': enabled
  195. (NOTE: UPR bit is set)
  196. nsets = <value>
  197. number of DC sets; must be power of two
  198. nways = <value>
  199. number of DC ways
  200. blocksize = <value>
  201. DC block size in bytes; must be power of two
  202. ustates = <value>
  203. number of DC usage states (2, 3, 4 etc., max is 4)
  204. load_hitdelay = <value>
  205. number of cycles dc load hit costs
  206. load_missdelay = <value>
  207. number of cycles dc load miss costs
  208. store_hitdelay = <value>
  209. number of cycles dc load hit costs
  210. store_missdelay = <value>
  211. number of cycles dc load miss costs
  212. */
  213. section dc
  214. enabled = 1
  215. nsets = 512
  216. nways = 1
  217. blocksize = 16
  218. load_hitdelay = 1
  219. load_missdelay = 1
  220. store_hitdelay = 1
  221. store_missdelay = 1
  222. end
  223. /* SIM SECTION
  224. This section specifies how or1ksim should behave.
  225. verbose = 0/1
  226. '0': don't print extra messages
  227. '1': print extra messages
  228. debug = 0-9
  229. 0 : no debug messages
  230. 1-9: debug message level.
  231. higher numbers produce more messages
  232. profile = 0/1
  233. '0': don't generate profiling file 'sim.profile'
  234. '1': don't generate profiling file 'sim.profile'
  235. prof_fn = "<filename>"
  236. optional filename for the profiling file.
  237. valid only if 'profile' is set
  238. mprofile = 0/1
  239. '0': don't generate memory profiling file 'sim.mprofile'
  240. '1': generate memory profiling file 'sim.mprofile'
  241. mprof_fn = "<filename>"
  242. optional filename for the memory profiling file.
  243. valid only if 'mprofile' is set
  244. history = 0/1
  245. '0': don't track execution flow
  246. '1': track execution flow
  247. Execution flow can be tracked for the simulator's
  248. 'hist' command. Useful for back-trace debugging.
  249. iprompt = 0/1
  250. '0': start in <not interactive prompt> (so what do we start in ???)
  251. '1': start in interactive prompt.
  252. exe_log = 0/1
  253. '0': don't generate execution log.
  254. '1': generate execution log.
  255. exe_log = default/hardware/simple/software
  256. type of execution log, default is used when not specified
  257. exe_log_start = <value>
  258. index of first instruction to start logging, default = 0
  259. exe_log_end = <value>
  260. index of last instruction to end logging; not limited, if omitted
  261. exe_log_marker = <value>
  262. <value> specifies number of instructions before horizontal marker is
  263. printed; if zero, markers are disabled (default)
  264. exe_log_fn = "<filename>"
  265. filename for the exection log file.
  266. valid only if 'exe_log' is set
  267. clkcycle = <value>[ps|ns|us|ms]
  268. specifies time measurement for one cycle
  269. */
  270. section sim
  271. verbose = 1
  272. debug = 0
  273. profile = 0
  274. history = 0
  275. clkcycle = 10ns
  276. end
  277. /* SECTION VAPI
  278. This section configures the Verification API, used for Advanced
  279. Core Verification.
  280. enabled = 0/1
  281. '0': disbable VAPI server
  282. '1': enable/start VAPI server
  283. server_port = <value>
  284. TCP/IP port to start VAPI server on
  285. log_enabled = 0/1
  286. '0': disable VAPI requests logging
  287. '1': enable VAPI requests logging
  288. hide_device_id = 0/1
  289. '0': don't log device id (for compatability with old version)
  290. '1': log device id
  291. vapi_fn = <filename>
  292. filename for the log file.
  293. valid only if log_enabled is set
  294. */
  295. section VAPI
  296. enabled = 0
  297. server_port = 9998
  298. log_enabled = 0
  299. vapi_log_fn = "vapi.log"
  300. end
  301. /* CPU SECTION
  302. This section specifies various CPU parameters.
  303. ver = <value>
  304. rev = <value>
  305. specifies version and revision of the CPU used
  306. upr = <value>
  307. changes the upr register
  308. sr = <value>
  309. sets the initial Supervision Register value
  310. supervisor mode (SM) and fixed one (FO) set = 0x8001
  311. exception prefix high (EPH, vectors@0xf0000000) = 0x4000
  312. together, (SM | FO | EPH) = 0xc001
  313. superscalar = 0/1
  314. '0': CPU is scalar
  315. '1': CPU is superscalar
  316. (modify cpu/or32/execute.c to tune superscalar model)
  317. hazards = 0/1
  318. '0': don't track data hazards in superscalar CPU
  319. '1': track data hazards in superscalar CPU
  320. If tracked, data hazards can be displayed using the
  321. simulator's 'r' command.
  322. dependstats = 0/1
  323. '0': don't calculate inter-instruction dependencies.
  324. '1': calculate inter-instruction dependencies.
  325. If calculated, inter-instruction dependencies can be
  326. displayed using the simulator's 'stat' command.
  327. sbuf_len = <value>
  328. length of store buffer (<= 256), 0 = disabled
  329. */
  330. section cpu
  331. ver = 0x12
  332. cfg = 0x00
  333. rev = 0x01
  334. sr = 0x8001 /*SPR_SR_FO | SPR_SR_SM | SPR_SR_EPH */
  335. /* upr = */
  336. superscalar = 0
  337. hazards = 0
  338. dependstats = 0
  339. sbuf_len = 0
  340. end
  341. /* PM SECTION
  342. This section specifies Power Management parameters
  343. enabled = 0/1
  344. '0': disable power management
  345. '1': enable power management
  346. */
  347. section pm
  348. enabled = 0
  349. end
  350. /* BPB SECTION
  351. This section specifies how branch prediction should behave.
  352. enabled = 0/1
  353. '0': disable branch prediction
  354. '1': enable branch prediction
  355. btic = 0/1
  356. '0': disable branch target instruction cache model
  357. '1': enable branch target instruction cache model
  358. sbp_bf_fwd = 0/1
  359. Static branch prediction for 'l.bf'
  360. '0': don't use forward prediction
  361. '1': use forward prediction
  362. sbp_bnf_fwd = 0/1
  363. Static branch prediction for 'l.bnf'
  364. '0': don't use forward prediction
  365. '1': use forward prediction
  366. hitdelay = <value>
  367. number of cycles bpb hit costs
  368. missdelay = <value>
  369. number of cycles bpb miss costs
  370. */
  371. section bpb
  372. enabled = 0
  373. btic = 0
  374. sbp_bf_fwd = 0
  375. sbp_bnf_fwd = 0
  376. hitdelay = 0
  377. missdelay = 0
  378. end
  379. /* DEBUG SECTION
  380. This sections specifies how the debug unit should behave.
  381. enabled = 0/1
  382. '0': disable debug unit
  383. '1': enable debug unit
  384. gdb_enabled = 0/1
  385. '0': don't start gdb server
  386. '1': start gdb server at port 'server_port'
  387. server_port = <value>
  388. TCP/IP port to start gdb server on
  389. valid only if gdb_enabled is set
  390. vapi_id = <hex_value>
  391. Used to create "fake" vapi log file containing the JTAG proxy messages.
  392. */
  393. section debug
  394. enabled = 0
  395. /* gdb_enabled = 0 */
  396. /* server_port = 9999*/
  397. rsp_enabled = 1
  398. rsp_port = 50001
  399. end
  400. /* MC SECTION
  401. This section configures the memory controller
  402. enabled = 0/1
  403. '0': disable memory controller
  404. '1': enable memory controller
  405. baseaddr = <hex_value>
  406. address of first MC register
  407. POC = <hex_value>
  408. Power On Configuration register
  409. index = <value>
  410. Index of this memory controller amongst all the memory controllers
  411. */
  412. section mc
  413. enabled = 0
  414. baseaddr = 0x93000000
  415. POC = 0x00000008 /* Power on configuration register */
  416. index = 0
  417. end
  418. /* UART SECTION
  419. This section configures the UARTs
  420. enabled = <0|1>
  421. Enable/disable the peripheral. By default if it is enabled.
  422. baseaddr = <hex_value>
  423. address of first UART register for this device
  424. channel = <channeltype>:<args>
  425. The channel parameter indicates the source of received UART characters
  426. and the sink for transmitted UART characters.
  427. The <channeltype> can be either "file", "xterm", "tcp", "fd", or "tty"
  428. (without quotes).
  429. A) To send/receive characters from a pair of files, use a file
  430. channel:
  431. channel=file:<rxfile>,<txfile>
  432. B) To create an interactive terminal window, use an xterm channel:
  433. channel=xterm:[<xterm_arg>]*
  434. C) To create a bidirectional tcp socket which one could, for example,
  435. access via telnet, use a tcp channel:
  436. channel=tcp:<port number>
  437. D) To cause the UART to read/write from existing numeric file
  438. descriptors, use an fd channel:
  439. channel=fd:<rx file descriptor num>,<tx file descriptor num>
  440. E) To connect the UART to a physical serial port, create a tty
  441. channel:
  442. channel=tty:device=/dev/ttyS0,baud=9600
  443. irq = <value>
  444. irq number for this device
  445. 16550 = 0/1
  446. '0': this device is a UART16450
  447. '1': this device is a UART16550
  448. jitter = <value>
  449. in msecs... time to block, -1 to disable it
  450. vapi_id = <hex_value>
  451. VAPI id of this instance
  452. */
  453. section uart
  454. enabled = 1
  455. baseaddr = 0x90000000
  456. irq = 2
  457. /* channel = "file:uart0.rx,uart0.tx" */
  458. /* channel = "tcp:10084" */
  459. channel = "xterm:"
  460. jitter = -1 /* async behaviour */
  461. 16550 = 1
  462. end
  463. /* DMA SECTION
  464. This section configures the DMAs
  465. enabled = <0|1>
  466. Enable/disable the peripheral. By default if it is enabled.
  467. baseaddr = <hex_value>
  468. address of first DMA register for this device
  469. irq = <value>
  470. irq number for this device
  471. vapi_id = <hex_value>
  472. VAPI id of this instance
  473. */
  474. section dma
  475. enabled = 1
  476. baseaddr = 0x9a000000
  477. irq = 11
  478. end
  479. /* ETHERNET SECTION
  480. This section configures the ETHERNETs
  481. enabled = <0|1>
  482. Enable/disable the peripheral. By default if it is enabled.
  483. baseaddr = <hex_value>
  484. address of first ethernet register for this device
  485. dma = <value>
  486. which controller is this ethernet "connected" to
  487. irq = <value>
  488. ethernet mac IRQ level
  489. rtx_type = <value>
  490. use 0 - file interface, 1 - socket interface
  491. rx_channel = <value>
  492. DMA channel used for RX
  493. tx_channel = <value>
  494. DMA channel used for TX
  495. rxfile = "<filename>"
  496. filename, where to read data from
  497. txfile = "<filename>"
  498. filename, where to write data to
  499. sockif = "<ifacename>"
  500. interface name of ethernet socket
  501. vapi_id = <hex_value>
  502. VAPI id of this instance
  503. */
  504. section ethernet
  505. enabled = 1
  506. baseaddr = 0x92000000
  507. /* dma = 0 */
  508. irq = 4
  509. rtx_type = "tap"
  510. tap_dev = "tap0"
  511. /* tx_channel = 0 */
  512. /* rx_channel = 1 */
  513. rxfile = "eth0.rx"
  514. txfile = "eth0.tx"
  515. sockif = "eth0"
  516. end
  517. /* GPIO SECTION
  518. This section configures the GPIOs
  519. enabled = <0|1>
  520. Enable/disable the peripheral. By default if it is enabled.
  521. baseaddr = <hex_value>
  522. address of first GPIO register for this device
  523. irq = <value>
  524. irq number for this device
  525. base_vapi_id = <hex_value>
  526. first VAPI id of this instance
  527. GPIO uses 8 consecutive VAPI IDs
  528. */
  529. section gpio
  530. enabled = 0
  531. baseaddr = 0x91000000
  532. irq = 3
  533. base_vapi_id = 0x0200
  534. end
  535. /* VGA SECTION
  536. This section configures the VGA/LCD controller
  537. enabled = <0|1>
  538. Enable/disable the peripheral. By default if it is enabled.
  539. baseaddr = <hex_value>
  540. address of first VGA register
  541. irq = <value>
  542. irq number for this device
  543. refresh_rate = <value>
  544. number of cycles between screen dumps
  545. filename = "<filename>"
  546. template name for generated names (e.g. "primary" produces "primary0023.bmp")
  547. */
  548. section vga
  549. enabled = 0
  550. baseaddr = 0x97100000
  551. irq = 8
  552. refresh_rate = 100000
  553. filename = "primary"
  554. end
  555. /* TICK TIMER SECTION
  556. This section configures tick timer
  557. enabled = 0/1
  558. whether tick timer is enabled
  559. */
  560. section pic
  561. enabled = 1
  562. edge_trigger = 1
  563. end
  564. /* FB SECTION
  565. This section configures the frame buffer
  566. enabled = <0|1>
  567. Enable/disable the peripheral. By default if it is enabled.
  568. baseaddr = <hex_value>
  569. base address of frame buffer
  570. paladdr = <hex_value>
  571. base address of first palette entry
  572. refresh_rate = <value>
  573. number of cycles between screen dumps
  574. filename = "<filename>"
  575. template name for generated names (e.g. "primary" produces "primary0023.bmp")
  576. */
  577. section fb
  578. enabled = 0
  579. baseaddr = 0x97000000
  580. refresh_rate = 1000000
  581. filename = "primary"
  582. end
  583. /* KBD SECTION
  584. This section configures the PS/2 compatible keyboard
  585. baseaddr = <hex_value>
  586. base address of the keyboard device
  587. rxfile = "<filename>"
  588. filename, where to read data from
  589. */
  590. section kbd
  591. enabled = 0
  592. irq = 5
  593. baseaddr = 0x94000000
  594. rxfile = "kbd.rx"
  595. end
  596. /* ATA SECTION
  597. This section configures the ATA/ATAPI host controller
  598. baseaddr = <hex_value>
  599. address of first ATA register
  600. enabled = <0|1>
  601. Enable/disable the peripheral. By default if it is enabled.
  602. irq = <value>
  603. irq number for this device
  604. debug = <value>
  605. debug level for ata models.
  606. 0: no debug messages
  607. 1: verbose messages
  608. 3: normal messages (more messages than verbose)
  609. 5: debug messages (normal debug messages)
  610. 7: flow control messages (debug statemachine flows)
  611. 9: low priority message (display everything the code does)
  612. dev_type0/1 = <value>
  613. ata device 0 type
  614. 0: NO_CONNeCT: none (not connected)
  615. 1: FILE : simulated harddisk
  616. 2: LOCAL : local system harddisk
  617. dev_file0/1 = "<filename>"
  618. filename for simulated ATA device
  619. valid only if dev_type0 == 1
  620. dev_size0/1 = <value>
  621. size of simulated hard-disk (in MBytes)
  622. valid only if dev_type0 == 1
  623. dev_packet0/1 = <value>
  624. 0: simulated ATA device does NOT implement PACKET command feature set
  625. 1: simulated ATA device does implement PACKET command feature set
  626. FIXME: irq number
  627. */
  628. section ata
  629. enabled = 0
  630. baseaddr = 0x9e000000
  631. irq = 15
  632. end