coreblocks 0.2026.7.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (321) hide show
  1. coreblocks-0.2026.7.3/.gitattributes +8 -0
  2. coreblocks-0.2026.7.3/.github/workflows/benchmark.yml +287 -0
  3. coreblocks-0.2026.7.3/.github/workflows/deploy_gh_pages.yml +48 -0
  4. coreblocks-0.2026.7.3/.github/workflows/main.yml +327 -0
  5. coreblocks-0.2026.7.3/.github/workflows/publish-to-pypi.yml +189 -0
  6. coreblocks-0.2026.7.3/.github/workflows/publish_comment.yml +35 -0
  7. coreblocks-0.2026.7.3/.gitignore +63 -0
  8. coreblocks-0.2026.7.3/.gitmodules +10 -0
  9. coreblocks-0.2026.7.3/.pre-commit-config.yaml +35 -0
  10. coreblocks-0.2026.7.3/LICENSE +23 -0
  11. coreblocks-0.2026.7.3/PKG-INFO +45 -0
  12. coreblocks-0.2026.7.3/README.md +70 -0
  13. coreblocks-0.2026.7.3/ci/build_docs.sh +17 -0
  14. coreblocks-0.2026.7.3/ci/print_benchmark_summary.py +52 -0
  15. coreblocks-0.2026.7.3/ci/push_docs.sh +40 -0
  16. coreblocks-0.2026.7.3/ci/push_gh_pages.sh +40 -0
  17. coreblocks-0.2026.7.3/constants/__init__.py +0 -0
  18. coreblocks-0.2026.7.3/constants/benchmark_information.py +13 -0
  19. coreblocks-0.2026.7.3/constants/ecp5_pinout.py +17 -0
  20. coreblocks-0.2026.7.3/constants/ecp5_platforms.py +89 -0
  21. coreblocks-0.2026.7.3/coreblocks/__init__.py +0 -0
  22. coreblocks-0.2026.7.3/coreblocks/arch/__init__.py +4 -0
  23. coreblocks-0.2026.7.3/coreblocks/arch/csr_address.py +588 -0
  24. coreblocks-0.2026.7.3/coreblocks/arch/isa.py +286 -0
  25. coreblocks-0.2026.7.3/coreblocks/arch/isa_consts.py +319 -0
  26. coreblocks-0.2026.7.3/coreblocks/arch/optypes.py +204 -0
  27. coreblocks-0.2026.7.3/coreblocks/backend/__init__.py +0 -0
  28. coreblocks-0.2026.7.3/coreblocks/backend/announcement.py +61 -0
  29. coreblocks-0.2026.7.3/coreblocks/backend/retirement.py +358 -0
  30. coreblocks-0.2026.7.3/coreblocks/cache/__init__.py +0 -0
  31. coreblocks-0.2026.7.3/coreblocks/cache/icache.py +364 -0
  32. coreblocks-0.2026.7.3/coreblocks/cache/iface.py +42 -0
  33. coreblocks-0.2026.7.3/coreblocks/cache/refiller.py +107 -0
  34. coreblocks-0.2026.7.3/coreblocks/core.py +245 -0
  35. coreblocks-0.2026.7.3/coreblocks/core_structs/__init__.py +0 -0
  36. coreblocks-0.2026.7.3/coreblocks/core_structs/crat.py +493 -0
  37. coreblocks-0.2026.7.3/coreblocks/core_structs/rat.py +57 -0
  38. coreblocks-0.2026.7.3/coreblocks/core_structs/rf.py +132 -0
  39. coreblocks-0.2026.7.3/coreblocks/core_structs/rob.py +187 -0
  40. coreblocks-0.2026.7.3/coreblocks/frontend/__init__.py +1 -0
  41. coreblocks-0.2026.7.3/coreblocks/frontend/bpu/__init__.py +0 -0
  42. coreblocks-0.2026.7.3/coreblocks/frontend/bpu/bpu.py +48 -0
  43. coreblocks-0.2026.7.3/coreblocks/frontend/decoder/__init__.py +0 -0
  44. coreblocks-0.2026.7.3/coreblocks/frontend/decoder/decode_stage.py +154 -0
  45. coreblocks-0.2026.7.3/coreblocks/frontend/decoder/instr_decoder.py +357 -0
  46. coreblocks-0.2026.7.3/coreblocks/frontend/decoder/instr_description.py +230 -0
  47. coreblocks-0.2026.7.3/coreblocks/frontend/decoder/rvc.py +375 -0
  48. coreblocks-0.2026.7.3/coreblocks/frontend/fetch/__init__.py +0 -0
  49. coreblocks-0.2026.7.3/coreblocks/frontend/fetch/fetch.py +685 -0
  50. coreblocks-0.2026.7.3/coreblocks/frontend/fetch_addr_unit.py +73 -0
  51. coreblocks-0.2026.7.3/coreblocks/frontend/frontend.py +172 -0
  52. coreblocks-0.2026.7.3/coreblocks/frontend/frontend_params.py +26 -0
  53. coreblocks-0.2026.7.3/coreblocks/frontend/ftq.py +242 -0
  54. coreblocks-0.2026.7.3/coreblocks/frontend/stall_controller.py +113 -0
  55. coreblocks-0.2026.7.3/coreblocks/func_blocks/__init__.py +0 -0
  56. coreblocks-0.2026.7.3/coreblocks/func_blocks/csr/csr_protocol.py +18 -0
  57. coreblocks-0.2026.7.3/coreblocks/func_blocks/csr/csr_unit.py +281 -0
  58. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/__init__.py +0 -0
  59. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/alu.py +269 -0
  60. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/common/__init__.py +5 -0
  61. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/common/fifo_rs.py +42 -0
  62. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/common/fu_decoder.py +107 -0
  63. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/common/func_base.py +52 -0
  64. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/common/rs.py +189 -0
  65. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/common/rs_func_block.py +135 -0
  66. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/div_unit.py +132 -0
  67. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/division/common.py +15 -0
  68. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/division/long_division.py +206 -0
  69. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/exception.py +108 -0
  70. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/fpu/__init__.py +0 -0
  71. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/fpu/close_path.py +180 -0
  72. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/fpu/far_path.py +323 -0
  73. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/fpu/float_to_int.py +214 -0
  74. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/fpu/fpu_add_sub.py +287 -0
  75. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/fpu/fpu_class.py +114 -0
  76. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/fpu/fpu_common.py +169 -0
  77. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/fpu/fpu_comp.py +134 -0
  78. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/fpu/fpu_error_module.py +178 -0
  79. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/fpu/fpu_mul.py +263 -0
  80. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/fpu/fpu_qsf.py +122 -0
  81. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/fpu/fpu_rounding_module.py +117 -0
  82. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/fpu/fpu_sign_injection.py +88 -0
  83. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/fpu/int_to_float.py +132 -0
  84. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/fpu/lza.py +105 -0
  85. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/fpu/otfc.py +126 -0
  86. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/fpu/qsf_tables.py +21 -0
  87. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/jumpbranch.py +259 -0
  88. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/lsu/__init__.py +0 -0
  89. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/lsu/dummyLsu.py +214 -0
  90. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/lsu/lsu_atomic_wrapper.py +225 -0
  91. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/lsu/lsu_requester.py +184 -0
  92. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/lsu/pma.py +74 -0
  93. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/mul_unit.py +210 -0
  94. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/priv.py +288 -0
  95. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/shift_unit.py +108 -0
  96. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/unsigned_multiplication/__init__.py +0 -0
  97. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/unsigned_multiplication/common.py +73 -0
  98. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/unsigned_multiplication/fast_recursive.py +134 -0
  99. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/unsigned_multiplication/pipelined.py +145 -0
  100. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/unsigned_multiplication/sequence.py +154 -0
  101. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/unsigned_multiplication/shift.py +45 -0
  102. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/zbc.py +233 -0
  103. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/zbkx.py +85 -0
  104. coreblocks-0.2026.7.3/coreblocks/func_blocks/fu/zbs.py +116 -0
  105. coreblocks-0.2026.7.3/coreblocks/func_blocks/instruction_metrics.py +37 -0
  106. coreblocks-0.2026.7.3/coreblocks/func_blocks/interface/__init__.py +0 -0
  107. coreblocks-0.2026.7.3/coreblocks/func_blocks/interface/func_blocks_unifier.py +34 -0
  108. coreblocks-0.2026.7.3/coreblocks/func_blocks/interface/func_protocols.py +21 -0
  109. coreblocks-0.2026.7.3/coreblocks/gen_verilog.py +165 -0
  110. coreblocks-0.2026.7.3/coreblocks/interface/keys.py +168 -0
  111. coreblocks-0.2026.7.3/coreblocks/interface/layouts.py +954 -0
  112. coreblocks-0.2026.7.3/coreblocks/interface/views.py +65 -0
  113. coreblocks-0.2026.7.3/coreblocks/params/__init__.py +5 -0
  114. coreblocks-0.2026.7.3/coreblocks/params/configurations.py +133 -0
  115. coreblocks-0.2026.7.3/coreblocks/params/core_configuration.py +223 -0
  116. coreblocks-0.2026.7.3/coreblocks/params/fu_params.py +128 -0
  117. coreblocks-0.2026.7.3/coreblocks/params/genparams.py +175 -0
  118. coreblocks-0.2026.7.3/coreblocks/params/icache_params.py +59 -0
  119. coreblocks-0.2026.7.3/coreblocks/params/instr.py +250 -0
  120. coreblocks-0.2026.7.3/coreblocks/params/vmem_params.py +100 -0
  121. coreblocks-0.2026.7.3/coreblocks/peripherals/__init__.py +0 -0
  122. coreblocks-0.2026.7.3/coreblocks/peripherals/axi_lite.py +339 -0
  123. coreblocks-0.2026.7.3/coreblocks/peripherals/bus_adapter.py +279 -0
  124. coreblocks-0.2026.7.3/coreblocks/peripherals/wishbone.py +533 -0
  125. coreblocks-0.2026.7.3/coreblocks/priv/__init__.py +0 -0
  126. coreblocks-0.2026.7.3/coreblocks/priv/csr/__init__.py +0 -0
  127. coreblocks-0.2026.7.3/coreblocks/priv/csr/aliased.py +101 -0
  128. coreblocks-0.2026.7.3/coreblocks/priv/csr/csr_instances.py +596 -0
  129. coreblocks-0.2026.7.3/coreblocks/priv/csr/csr_register.py +286 -0
  130. coreblocks-0.2026.7.3/coreblocks/priv/csr/double_counter.py +78 -0
  131. coreblocks-0.2026.7.3/coreblocks/priv/csr/double_shadow.py +100 -0
  132. coreblocks-0.2026.7.3/coreblocks/priv/csr/shadow.py +141 -0
  133. coreblocks-0.2026.7.3/coreblocks/priv/pmp.py +124 -0
  134. coreblocks-0.2026.7.3/coreblocks/priv/traps/__init__.py +0 -0
  135. coreblocks-0.2026.7.3/coreblocks/priv/traps/exception.py +135 -0
  136. coreblocks-0.2026.7.3/coreblocks/priv/traps/instr_counter.py +51 -0
  137. coreblocks-0.2026.7.3/coreblocks/priv/traps/interrupt_controller.py +402 -0
  138. coreblocks-0.2026.7.3/coreblocks/priv/vmem/__init__.py +2 -0
  139. coreblocks-0.2026.7.3/coreblocks/priv/vmem/iface.py +15 -0
  140. coreblocks-0.2026.7.3/coreblocks/priv/vmem/tlb.py +658 -0
  141. coreblocks-0.2026.7.3/coreblocks/priv/vmem/translation.py +224 -0
  142. coreblocks-0.2026.7.3/coreblocks/priv/vmem/walker.py +273 -0
  143. coreblocks-0.2026.7.3/coreblocks/scheduler/__init__.py +0 -0
  144. coreblocks-0.2026.7.3/coreblocks/scheduler/scheduler.py +593 -0
  145. coreblocks-0.2026.7.3/coreblocks/scheduler/wakeup_select.py +62 -0
  146. coreblocks-0.2026.7.3/coreblocks/socks/clint.py +76 -0
  147. coreblocks-0.2026.7.3/coreblocks/socks/peripheral.py +68 -0
  148. coreblocks-0.2026.7.3/coreblocks/socks/plic.py +188 -0
  149. coreblocks-0.2026.7.3/coreblocks/socks/socks.py +100 -0
  150. coreblocks-0.2026.7.3/coreblocks.egg-info/PKG-INFO +45 -0
  151. coreblocks-0.2026.7.3/coreblocks.egg-info/SOURCES.txt +319 -0
  152. coreblocks-0.2026.7.3/coreblocks.egg-info/dependency_links.txt +1 -0
  153. coreblocks-0.2026.7.3/coreblocks.egg-info/entry_points.txt +2 -0
  154. coreblocks-0.2026.7.3/coreblocks.egg-info/requires.txt +28 -0
  155. coreblocks-0.2026.7.3/coreblocks.egg-info/scm_file_list.json +315 -0
  156. coreblocks-0.2026.7.3/coreblocks.egg-info/scm_version.json +8 -0
  157. coreblocks-0.2026.7.3/coreblocks.egg-info/top_level.txt +1 -0
  158. coreblocks-0.2026.7.3/docker/AmaranthSynthECP5.Dockerfile +35 -0
  159. coreblocks-0.2026.7.3/docker/Verilator.Dockerfile +22 -0
  160. coreblocks-0.2026.7.3/docker/riscv-toolchain.Dockerfile +41 -0
  161. coreblocks-0.2026.7.3/docs/api.md +5 -0
  162. coreblocks-0.2026.7.3/docs/assumptions.md +7 -0
  163. coreblocks-0.2026.7.3/docs/components/icache.md +24 -0
  164. coreblocks-0.2026.7.3/docs/conf.py +114 -0
  165. coreblocks-0.2026.7.3/docs/current-graph.md +12 -0
  166. coreblocks-0.2026.7.3/docs/development-environment.md +141 -0
  167. coreblocks-0.2026.7.3/docs/home.md +28 -0
  168. coreblocks-0.2026.7.3/docs/images/logo-banner.svg +79 -0
  169. coreblocks-0.2026.7.3/docs/images/logo.svg +79 -0
  170. coreblocks-0.2026.7.3/docs/images/ngi0-commons.svg +14 -0
  171. coreblocks-0.2026.7.3/docs/images/nlnet.svg +1 -0
  172. coreblocks-0.2026.7.3/docs/index.md +18 -0
  173. coreblocks-0.2026.7.3/docs/miscellany/exceptions-summary.md +153 -0
  174. coreblocks-0.2026.7.3/docs/problem-checklist.md +15 -0
  175. coreblocks-0.2026.7.3/docs/scheduler/overview.md +46 -0
  176. coreblocks-0.2026.7.3/docs/synthesis/synthesis.md +239 -0
  177. coreblocks-0.2026.7.3/docs/wiki_exclude +3 -0
  178. coreblocks-0.2026.7.3/pyproject.toml +109 -0
  179. coreblocks-0.2026.7.3/scripts/build_docs.sh +63 -0
  180. coreblocks-0.2026.7.3/scripts/core_graph.py +40 -0
  181. coreblocks-0.2026.7.3/scripts/lint.sh +75 -0
  182. coreblocks-0.2026.7.3/scripts/parse_benchmark_info.py +91 -0
  183. coreblocks-0.2026.7.3/scripts/run_benchmarks.py +213 -0
  184. coreblocks-0.2026.7.3/scripts/run_tests.py +76 -0
  185. coreblocks-0.2026.7.3/scripts/synthesize.py +241 -0
  186. coreblocks-0.2026.7.3/scripts/tprof.py +84 -0
  187. coreblocks-0.2026.7.3/setup.cfg +4 -0
  188. coreblocks-0.2026.7.3/test/__init__.py +0 -0
  189. coreblocks-0.2026.7.3/test/asm/csr.asm +9 -0
  190. coreblocks-0.2026.7.3/test/asm/csr_mmode.asm +33 -0
  191. coreblocks-0.2026.7.3/test/asm/exception.asm +8 -0
  192. coreblocks-0.2026.7.3/test/asm/exception_handler.asm +53 -0
  193. coreblocks-0.2026.7.3/test/asm/exception_mem.asm +17 -0
  194. coreblocks-0.2026.7.3/test/asm/fibonacci.asm +11 -0
  195. coreblocks-0.2026.7.3/test/asm/fibonacci_mem.asm +29 -0
  196. coreblocks-0.2026.7.3/test/asm/init_regs.s +41 -0
  197. coreblocks-0.2026.7.3/test/asm/interrupt.asm +106 -0
  198. coreblocks-0.2026.7.3/test/asm/interrupt_vectored.asm +138 -0
  199. coreblocks-0.2026.7.3/test/asm/link.ld +17 -0
  200. coreblocks-0.2026.7.3/test/asm/mtval.asm +106 -0
  201. coreblocks-0.2026.7.3/test/asm/plic.asm +222 -0
  202. coreblocks-0.2026.7.3/test/asm/pmp_fetch.asm +36 -0
  203. coreblocks-0.2026.7.3/test/asm/pmp_lsu.asm +38 -0
  204. coreblocks-0.2026.7.3/test/asm/smode_exception.asm +84 -0
  205. coreblocks-0.2026.7.3/test/asm/smode_interrupt.asm +79 -0
  206. coreblocks-0.2026.7.3/test/asm/socks_clint.asm +122 -0
  207. coreblocks-0.2026.7.3/test/asm/sv32_translation.asm +96 -0
  208. coreblocks-0.2026.7.3/test/asm/user_mode.asm +158 -0
  209. coreblocks-0.2026.7.3/test/asm/wfi_int.asm +34 -0
  210. coreblocks-0.2026.7.3/test/asm/wfi_no_int.asm +5 -0
  211. coreblocks-0.2026.7.3/test/asm/wfi_no_mie.asm +29 -0
  212. coreblocks-0.2026.7.3/test/backend/__init__.py +0 -0
  213. coreblocks-0.2026.7.3/test/backend/test_announcement.py +57 -0
  214. coreblocks-0.2026.7.3/test/backend/test_retirement.py +211 -0
  215. coreblocks-0.2026.7.3/test/cache/__init__.py +0 -0
  216. coreblocks-0.2026.7.3/test/cache/test_icache.py +759 -0
  217. coreblocks-0.2026.7.3/test/common/test_isa.py +177 -0
  218. coreblocks-0.2026.7.3/test/conftest.py +115 -0
  219. coreblocks-0.2026.7.3/test/core_structs/__init__.py +0 -0
  220. coreblocks-0.2026.7.3/test/core_structs/test_rat.py +106 -0
  221. coreblocks-0.2026.7.3/test/core_structs/test_reorder_buffer.py +165 -0
  222. coreblocks-0.2026.7.3/test/core_structs/test_rf.py +100 -0
  223. coreblocks-0.2026.7.3/test/external/embench/Makefile +17 -0
  224. coreblocks-0.2026.7.3/test/external/embench/board_config/coreblocks-sim/board.cfg +5 -0
  225. coreblocks-0.2026.7.3/test/external/embench/board_config/coreblocks-sim/boardsupport.c +33 -0
  226. coreblocks-0.2026.7.3/test/external/embench/board_config/coreblocks-sim/crt0.S +102 -0
  227. coreblocks-0.2026.7.3/test/external/embench/common/link.ld +64 -0
  228. coreblocks-0.2026.7.3/test/external/riscv-arch-test/Makefile +45 -0
  229. coreblocks-0.2026.7.3/test/external/riscv-arch-test/coreblocks/coreblocks-full/coreblocks.yaml +242 -0
  230. coreblocks-0.2026.7.3/test/external/riscv-arch-test/coreblocks/coreblocks-full/link.ld +15 -0
  231. coreblocks-0.2026.7.3/test/external/riscv-arch-test/coreblocks/coreblocks-full/rvmodel_macros.h +120 -0
  232. coreblocks-0.2026.7.3/test/external/riscv-arch-test/coreblocks/coreblocks-full/sail.json +724 -0
  233. coreblocks-0.2026.7.3/test/external/riscv-arch-test/coreblocks/coreblocks-full/test_config.yaml +8 -0
  234. coreblocks-0.2026.7.3/test/external/riscv-arch-test/coreblocks/coreblocks-full/test_config_clang.yaml +7 -0
  235. coreblocks-0.2026.7.3/test/external/riscv-tests/Makefile +45 -0
  236. coreblocks-0.2026.7.3/test/external/riscv-tests/environment/custom/link.ld +26 -0
  237. coreblocks-0.2026.7.3/test/external/riscv-tests/environment/custom/riscv_test.h +245 -0
  238. coreblocks-0.2026.7.3/test/frontend/__init__.py +0 -0
  239. coreblocks-0.2026.7.3/test/frontend/test_decode_stage.py +71 -0
  240. coreblocks-0.2026.7.3/test/frontend/test_fetch.py +942 -0
  241. coreblocks-0.2026.7.3/test/frontend/test_ftq.py +193 -0
  242. coreblocks-0.2026.7.3/test/frontend/test_instr_decoder.py +445 -0
  243. coreblocks-0.2026.7.3/test/frontend/test_rvc.py +391 -0
  244. coreblocks-0.2026.7.3/test/func_blocks/__init__.py +0 -0
  245. coreblocks-0.2026.7.3/test/func_blocks/csr/__init__.py +0 -0
  246. coreblocks-0.2026.7.3/test/func_blocks/csr/test_csr.py +511 -0
  247. coreblocks-0.2026.7.3/test/func_blocks/fu/__init__.py +0 -0
  248. coreblocks-0.2026.7.3/test/func_blocks/fu/common/__init__.py +0 -0
  249. coreblocks-0.2026.7.3/test/func_blocks/fu/common/test_rs.py +156 -0
  250. coreblocks-0.2026.7.3/test/func_blocks/fu/fpu/add_sub_test_cases.py +91 -0
  251. coreblocks-0.2026.7.3/test/func_blocks/fu/fpu/fpu_test_common.py +106 -0
  252. coreblocks-0.2026.7.3/test/func_blocks/fu/fpu/mul_test_cases.py +76 -0
  253. coreblocks-0.2026.7.3/test/func_blocks/fu/fpu/test_add_sub.py +161 -0
  254. coreblocks-0.2026.7.3/test/func_blocks/fu/fpu/test_close_path.py +177 -0
  255. coreblocks-0.2026.7.3/test/func_blocks/fu/fpu/test_far_path.py +1264 -0
  256. coreblocks-0.2026.7.3/test/func_blocks/fu/fpu/test_float_to_int.py +151 -0
  257. coreblocks-0.2026.7.3/test/func_blocks/fu/fpu/test_fpu_classification.py +76 -0
  258. coreblocks-0.2026.7.3/test/func_blocks/fu/fpu/test_fpu_comp.py +119 -0
  259. coreblocks-0.2026.7.3/test/func_blocks/fu/fpu/test_fpu_error.py +325 -0
  260. coreblocks-0.2026.7.3/test/func_blocks/fu/fpu/test_fpu_mul.py +98 -0
  261. coreblocks-0.2026.7.3/test/func_blocks/fu/fpu/test_fpu_rounding.py +278 -0
  262. coreblocks-0.2026.7.3/test/func_blocks/fu/fpu/test_int_to_float.py +66 -0
  263. coreblocks-0.2026.7.3/test/func_blocks/fu/fpu/test_lza.py +88 -0
  264. coreblocks-0.2026.7.3/test/func_blocks/fu/fpu/test_otfc.py +53 -0
  265. coreblocks-0.2026.7.3/test/func_blocks/fu/fpu/test_qsf.py +37 -0
  266. coreblocks-0.2026.7.3/test/func_blocks/fu/fpu/test_sign_injection.py +92 -0
  267. coreblocks-0.2026.7.3/test/func_blocks/fu/functional_common.py +211 -0
  268. coreblocks-0.2026.7.3/test/func_blocks/fu/test_alu.py +140 -0
  269. coreblocks-0.2026.7.3/test/func_blocks/fu/test_div_unit.py +62 -0
  270. coreblocks-0.2026.7.3/test/func_blocks/fu/test_exception_unit.py +49 -0
  271. coreblocks-0.2026.7.3/test/func_blocks/fu/test_fu_decoder.py +141 -0
  272. coreblocks-0.2026.7.3/test/func_blocks/fu/test_jb_unit.py +190 -0
  273. coreblocks-0.2026.7.3/test/func_blocks/fu/test_mul_unit.py +63 -0
  274. coreblocks-0.2026.7.3/test/func_blocks/fu/test_pipelined_mul_unit.py +83 -0
  275. coreblocks-0.2026.7.3/test/func_blocks/fu/test_shift_unit.py +47 -0
  276. coreblocks-0.2026.7.3/test/func_blocks/fu/test_unsigned_mul_unit.py +85 -0
  277. coreblocks-0.2026.7.3/test/func_blocks/fu/test_zbc.py +71 -0
  278. coreblocks-0.2026.7.3/test/func_blocks/fu/test_zbkx.py +38 -0
  279. coreblocks-0.2026.7.3/test/func_blocks/fu/test_zbs.py +40 -0
  280. coreblocks-0.2026.7.3/test/func_blocks/lsu/__init__.py +0 -0
  281. coreblocks-0.2026.7.3/test/func_blocks/lsu/test_dummylsu.py +496 -0
  282. coreblocks-0.2026.7.3/test/func_blocks/lsu/test_lsu_atomic_wrapper.py +226 -0
  283. coreblocks-0.2026.7.3/test/func_blocks/lsu/test_pma.py +150 -0
  284. coreblocks-0.2026.7.3/test/func_blocks/lsu/test_pmp.py +420 -0
  285. coreblocks-0.2026.7.3/test/params/__init__.py +0 -0
  286. coreblocks-0.2026.7.3/test/params/test_configurations.py +61 -0
  287. coreblocks-0.2026.7.3/test/params/test_dependentcache.py +49 -0
  288. coreblocks-0.2026.7.3/test/params/test_instr.py +63 -0
  289. coreblocks-0.2026.7.3/test/peripherals/__init__.py +0 -0
  290. coreblocks-0.2026.7.3/test/peripherals/bus_mock.py +41 -0
  291. coreblocks-0.2026.7.3/test/peripherals/test_axi_lite.py +255 -0
  292. coreblocks-0.2026.7.3/test/peripherals/test_wishbone.py +383 -0
  293. coreblocks-0.2026.7.3/test/priv/__init__.py +0 -0
  294. coreblocks-0.2026.7.3/test/priv/traps/__init__.py +0 -0
  295. coreblocks-0.2026.7.3/test/priv/traps/test_exception.py +80 -0
  296. coreblocks-0.2026.7.3/test/priv/traps/test_interrupt_controller.py +124 -0
  297. coreblocks-0.2026.7.3/test/priv/vmem/__init__.py +0 -0
  298. coreblocks-0.2026.7.3/test/priv/vmem/test_tlb.py +474 -0
  299. coreblocks-0.2026.7.3/test/priv/vmem/test_walker.py +312 -0
  300. coreblocks-0.2026.7.3/test/regression/__init__.py +0 -0
  301. coreblocks-0.2026.7.3/test/regression/benchmark.py +111 -0
  302. coreblocks-0.2026.7.3/test/regression/cocotb/arch_elf_entrypoint.py +18 -0
  303. coreblocks-0.2026.7.3/test/regression/cocotb/arch_test.Makefile +25 -0
  304. coreblocks-0.2026.7.3/test/regression/cocotb/benchmark.Makefile +26 -0
  305. coreblocks-0.2026.7.3/test/regression/cocotb/benchmark_entrypoint.py +15 -0
  306. coreblocks-0.2026.7.3/test/regression/cocotb/cocotb-config +21 -0
  307. coreblocks-0.2026.7.3/test/regression/cocotb/test.Makefile +26 -0
  308. coreblocks-0.2026.7.3/test/regression/cocotb/test_entrypoint.py +21 -0
  309. coreblocks-0.2026.7.3/test/regression/cocotb.py +301 -0
  310. coreblocks-0.2026.7.3/test/regression/common.py +33 -0
  311. coreblocks-0.2026.7.3/test/regression/conftest.py +92 -0
  312. coreblocks-0.2026.7.3/test/regression/memory.py +217 -0
  313. coreblocks-0.2026.7.3/test/regression/pysim.py +203 -0
  314. coreblocks-0.2026.7.3/test/regression/test_arch_regression.py +317 -0
  315. coreblocks-0.2026.7.3/test/regression/test_regression.py +150 -0
  316. coreblocks-0.2026.7.3/test/scheduler/__init__.py +0 -0
  317. coreblocks-0.2026.7.3/test/scheduler/test_checkpointing.py +268 -0
  318. coreblocks-0.2026.7.3/test/scheduler/test_rs_selection.py +177 -0
  319. coreblocks-0.2026.7.3/test/scheduler/test_scheduler.py +404 -0
  320. coreblocks-0.2026.7.3/test/scheduler/test_wakeup_select.py +92 -0
  321. coreblocks-0.2026.7.3/test/test_core.py +447 -0
@@ -0,0 +1,8 @@
1
+ * text=auto
2
+ *.sh text eol=lf
3
+ *.bat text eol=crlf
4
+ *.ps1 text eol=crlf
5
+
6
+ *.jpg binary
7
+ *.png binary
8
+ *.svg binary
@@ -0,0 +1,287 @@
1
+ name: Core Benchmarks
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ types: [ synchronize, labeled ]
9
+ branches:
10
+ - master
11
+ workflow_dispatch:
12
+
13
+ jobs:
14
+ synthesis:
15
+ strategy:
16
+ matrix:
17
+ config: [basic, full]
18
+ name: Run synthesis benchmarks
19
+ if: >
20
+ github.ref == 'refs/heads/master' ||
21
+ (
22
+ github.event_name == 'pull_request' &&
23
+ (
24
+ (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'benchmark')) ||
25
+ (github.event.action == 'labeled' && github.event.label.name == 'benchmark')
26
+ )
27
+ )
28
+ runs-on: ubuntu-24.04
29
+ timeout-minutes: 45
30
+ container: ghcr.io/kuznia-rdzeni/amaranth-synth:ecp5-2025.01.31
31
+ steps:
32
+ - uses: actions/checkout@v6
33
+
34
+ - name: Set ownership (Github Actions workaround)
35
+ run: |
36
+ # https://github.com/actions/runner/issues/2033
37
+ chown -R $(id -u):$(id -g) $PWD
38
+
39
+ - name: Set up Python
40
+ uses: actions/setup-python@v5
41
+ with:
42
+ python-version: '3.13'
43
+
44
+ - name: Install dependencies
45
+ run: |
46
+ python3 -m venv venv
47
+ . venv/bin/activate
48
+ python3 -m pip install --upgrade pip
49
+ python3 -m pip install ".[dev]"
50
+
51
+ - name: Synthesize
52
+ run: |
53
+ . venv/bin/activate
54
+ PYTHONHASHSEED=0 ./scripts/synthesize.py --verbose --strip-debug --config ${{ matrix.config }}
55
+
56
+ - name: Print synthesis information
57
+ run: cat ./build/top.tim
58
+
59
+ - name: Collect Benchmark information
60
+ run: |
61
+ . venv/bin/activate
62
+ ./scripts/parse_benchmark_info.py -o synth-benchmark-${{ matrix.config }}.json
63
+ cat ./synth-benchmark-${{ matrix.config }}.json
64
+
65
+ - uses: actions/upload-artifact@v7
66
+ with:
67
+ name: synth_benchmark_results-${{ matrix.config }}
68
+ path: synth-benchmark-${{ matrix.config }}.json
69
+
70
+
71
+ build-perf-benchmarks:
72
+ name: Build performance benchmarks
73
+ runs-on: ubuntu-latest
74
+ if: >
75
+ github.ref == 'refs/heads/master' ||
76
+ (
77
+ github.event_name == 'pull_request' &&
78
+ (
79
+ (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'benchmark')) ||
80
+ (github.event.action == 'labeled' && github.event.label.name == 'benchmark')
81
+ )
82
+ )
83
+ container: ghcr.io/kuznia-rdzeni/riscv-toolchain:2024.12.07
84
+ steps:
85
+ - name: Checkout
86
+ uses: actions/checkout@v6
87
+ with:
88
+ submodules: recursive
89
+
90
+ - name: Build embench
91
+ run: cd test/external/embench && make
92
+
93
+ - uses: actions/upload-artifact@v7
94
+ with:
95
+ name: "embench"
96
+ path: |
97
+ test/external/embench/build
98
+
99
+ run-perf-benchmarks:
100
+ name: Run performance benchmarks
101
+ runs-on: ubuntu-22.04 # older version for compatibility with Docker image
102
+ timeout-minutes: 60
103
+ container: ghcr.io/kuznia-rdzeni/verilator:v5.032-2026.04.15
104
+ needs: build-perf-benchmarks
105
+ steps:
106
+ - name: Checkout
107
+ uses: actions/checkout@v6
108
+
109
+ - name: Set ownership (Github Actions workaround)
110
+ run: |
111
+ # https://github.com/actions/runner/issues/2033
112
+ chown -R $(id -u):$(id -g) $PWD
113
+
114
+ - name: Set up Python
115
+ uses: actions/setup-python@v5
116
+ with:
117
+ python-version: '3.13'
118
+
119
+ - name: Install dependencies
120
+ run: |
121
+ python3 -m venv venv
122
+ . venv/bin/activate
123
+ python3 -m pip install --upgrade pip
124
+ python3 -m pip install ".[dev]"
125
+
126
+ - name: Generate Verilog
127
+ run: |
128
+ . venv/bin/activate
129
+ PYTHONHASHSEED=0 TRANSACTRON_VERBOSE=1 python3 -m coreblocks.gen_verilog --verbose --config full
130
+
131
+ - uses: actions/download-artifact@v8
132
+ with:
133
+ name: "embench"
134
+ path: test/external/embench/build
135
+
136
+ - name: Run benchmarks
137
+ run: |
138
+ . venv/bin/activate
139
+ scripts/run_benchmarks.py -o perf_benchmark.json --summary perf.md
140
+ cat perf.md >> $GITHUB_STEP_SUMMARY
141
+
142
+ - uses: actions/upload-artifact@v7
143
+ with:
144
+ name: perf_benchmark_results
145
+ path: perf_benchmark.json
146
+
147
+ pr-summary:
148
+ name: Create benchmark summary for a pull request
149
+ if: ${{ github.event_name == 'pull_request' }}
150
+ runs-on: ubuntu-latest
151
+ timeout-minutes: 5
152
+ needs: [run-perf-benchmarks, synthesis]
153
+ steps:
154
+ - name: Checkout
155
+ uses: actions/checkout@v6
156
+
157
+ - name: Set ownership (Github Actions workaround)
158
+ run: |
159
+ # https://github.com/actions/runner/issues/2033
160
+ chown -R $(id -u):$(id -g) $PWD
161
+
162
+ - name: Set up Python
163
+ uses: actions/setup-python@v5
164
+ with:
165
+ python-version: '3.13'
166
+
167
+ - name: Install dependencies
168
+ run: |
169
+ python3 -m venv venv
170
+ . venv/bin/activate
171
+ python3 -m pip install --upgrade pip
172
+ python3 -m pip install ".[dev]"
173
+
174
+ - name: Get baseline benchmarks results
175
+ uses: actions/cache@v4
176
+ env:
177
+ cache-name: benchmark-results
178
+ with:
179
+ key: ${{ env.cache-name }}-${{ runner.os }}-${{ github.event.pull_request.base.sha }}
180
+ path: |
181
+ perf_benchmark.json
182
+ synth-benchmark-basic.json
183
+ synth-benchmark-full.json
184
+
185
+ - uses: actions/download-artifact@v8
186
+ with:
187
+ name: perf_benchmark_results
188
+ path: artifacts
189
+ - uses: actions/download-artifact@v8
190
+ with:
191
+ name: synth_benchmark_results-basic
192
+ path: artifacts
193
+ - uses: actions/download-artifact@v8
194
+ with:
195
+ name: synth_benchmark_results-full
196
+ path: artifacts
197
+
198
+ - name: Save PR number
199
+ run: |
200
+ mkdir -p ./summary
201
+ echo ${{ github.event.number }} > ./summary/pr_number
202
+
203
+ - name: Create comment
204
+ id: createComment
205
+ run: |
206
+ . venv/bin/activate
207
+ {
208
+ echo "## Benchmarks summary"
209
+ echo "### Performance benchmarks"
210
+ ci/print_benchmark_summary.py --precision 3 artifacts/perf_benchmark.json perf_benchmark.json
211
+ echo
212
+ echo "You can view all the metrics [here](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})."
213
+ echo "### Synthesis benchmarks (basic)"
214
+ ci/print_benchmark_summary.py --precision 0 artifacts/synth-benchmark-basic.json synth-benchmark-basic.json
215
+ echo
216
+ echo "### Synthesis benchmarks (full)"
217
+ ci/print_benchmark_summary.py --precision 0 artifacts/synth-benchmark-full.json synth-benchmark-full.json
218
+ echo
219
+ } >> summary/comment.md
220
+
221
+ - uses: actions/upload-artifact@v4
222
+ with:
223
+ name: benchmark-summary
224
+ path: summary
225
+
226
+ publish-benchmarks:
227
+ name: Publish benchmarks
228
+ if: github.ref == 'refs/heads/master'
229
+ runs-on: ubuntu-latest
230
+ timeout-minutes: 5
231
+ needs: [run-perf-benchmarks, synthesis]
232
+ steps:
233
+ - uses: actions/checkout@v6
234
+
235
+ - uses: actions/download-artifact@v8
236
+ with:
237
+ name: perf_benchmark_results
238
+ path: .
239
+ - uses: actions/download-artifact@v8
240
+ with:
241
+ name: synth_benchmark_results-basic
242
+ path: .
243
+ - uses: actions/download-artifact@v8
244
+ with:
245
+ name: synth_benchmark_results-full
246
+ path: .
247
+
248
+ - name: Put results in a cache
249
+ uses: actions/cache@v4
250
+ env:
251
+ cache-name: benchmark-results
252
+ with:
253
+ key: ${{ env.cache-name }}-${{ runner.os }}-${{ github.sha }}
254
+ path: |
255
+ perf_benchmark.json
256
+ synth-benchmark-basic.json
257
+ synth-benchmark-full.json
258
+
259
+ - name: Store benchmark result (IPC)
260
+ uses: benchmark-action/github-action-benchmark@v1
261
+ with:
262
+ name: Performance (IPC)
263
+ tool: 'customBiggerIsBetter'
264
+ output-file-path: './perf_benchmark.json'
265
+ github-token: ${{ secrets.GITHUB_TOKEN }}
266
+ auto-push: true
267
+ benchmark-data-dir-path: "dev/benchmark"
268
+
269
+ - name: Store synthesis benchmark result (basic)
270
+ uses: benchmark-action/github-action-benchmark@v1
271
+ with:
272
+ name: Fmax and LCs (basic)
273
+ tool: 'customBiggerIsBetter'
274
+ output-file-path: './synth-benchmark-basic.json'
275
+ github-token: ${{ secrets.GITHUB_TOKEN }}
276
+ auto-push: true
277
+ benchmark-data-dir-path: "dev/benchmark"
278
+
279
+ - name: Store synthesis benchmark result (full)
280
+ uses: benchmark-action/github-action-benchmark@v1
281
+ with:
282
+ name: Fmax and LCs (full)
283
+ tool: 'customBiggerIsBetter'
284
+ output-file-path: './synth-benchmark-full.json'
285
+ github-token: ${{ secrets.GITHUB_TOKEN }}
286
+ auto-push: true
287
+ benchmark-data-dir-path: "dev/benchmark"
@@ -0,0 +1,48 @@
1
+ name: Build docs and trigger gh-pages
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - "master"
7
+ pull_request:
8
+ branches:
9
+ - "master"
10
+ workflow_dispatch:
11
+
12
+ jobs:
13
+ push_gh-pages:
14
+ runs-on: ubuntu-latest
15
+ timeout-minutes: 5
16
+ env:
17
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18
+ GH_MAIL: ${{github.event.pusher.email}}
19
+ GH_NAME: ${{github.event.pusher.name}}
20
+ DOCS_DIR: "docs"
21
+ BUILD_DIR: "build"
22
+ steps:
23
+ - name: Checkout
24
+ uses: actions/checkout@v6
25
+
26
+ - name: Set up Python
27
+ uses: actions/setup-python@v5
28
+ with:
29
+ python-version: "3.13"
30
+
31
+ - name: Install dependencies
32
+ run: |
33
+ python3 -m venv venv
34
+ . venv/bin/activate
35
+ python -m pip install --upgrade pip
36
+ python -m pip install ".[dev]"
37
+
38
+ - name: Build documentation
39
+ run: |
40
+ . venv/bin/activate
41
+ ./ci/build_docs.sh
42
+
43
+ - name: Push documentation
44
+ # Deploy documentation only when on master
45
+ if: github.ref == 'refs/heads/master'
46
+ run: |
47
+ . venv/bin/activate
48
+ ./ci/push_gh_pages.sh
@@ -0,0 +1,327 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ - 'feature/**'
8
+ pull_request:
9
+ branches:
10
+ - master
11
+ - 'feature/**'
12
+ workflow_dispatch:
13
+
14
+ jobs:
15
+ build-core:
16
+ name: Synthesize full core
17
+ runs-on: ubuntu-latest
18
+ timeout-minutes: 5
19
+ steps:
20
+ - name: Checkout
21
+ uses: actions/checkout@v6
22
+
23
+ - name: Set up Python
24
+ uses: actions/setup-python@v5
25
+ with:
26
+ python-version: '3.13'
27
+
28
+ - name: Install Coreblocks dependencies
29
+ run: |
30
+ python3 -m venv venv
31
+ . venv/bin/activate
32
+ python3 -m pip install --upgrade pip
33
+ python3 -m pip install .
34
+
35
+ - name: Generate Verilog
36
+ run: |
37
+ . venv/bin/activate
38
+ PYTHONHASHSEED=0 TRANSACTRON_VERBOSE=1 python3 -m coreblocks.gen_verilog --verbose --config full
39
+
40
+ - uses: actions/upload-artifact@v7
41
+ with:
42
+ name: "verilog-full-core"
43
+ path: |
44
+ core.v
45
+ core.v.json
46
+
47
+ build-regression-tests:
48
+ name: Build regression tests (riscv-tests)
49
+ runs-on: ubuntu-latest
50
+ container: ghcr.io/kuznia-rdzeni/riscv-toolchain:2024.12.07
51
+ timeout-minutes: 10
52
+ steps:
53
+ - name: Checkout
54
+ uses: actions/checkout@v6
55
+
56
+ - name: Get submodules HEAD hash
57
+ run: |
58
+ git config --global --add safe.directory /__w/coreblocks/coreblocks
59
+ git submodule > .gitmodules-hash
60
+
61
+ - name: Cache regression-tests
62
+ id: cache-regression
63
+ uses: actions/cache@v4
64
+ env:
65
+ cache-name: cache-regression-tests
66
+ with:
67
+ path: test/external/riscv-tests/test-*
68
+ key: ${{ env.cache-name }}-${{ runner.os }}-${{ hashFiles(
69
+ '**/test/external/riscv-tests/environment/custom/**',
70
+ '**/test/external/riscv-tests/Makefile',
71
+ '**/.gitmodules-hash',
72
+ '**/docker/riscv-toolchain.Dockerfile',
73
+ '**/.github/workflows/main.yml'
74
+ ) }}
75
+ lookup-only: true
76
+
77
+ - if: ${{ steps.cache-regression.outputs.cache-hit != 'true' }}
78
+ name: Checkout with submodules
79
+ uses: actions/checkout@v6
80
+ with:
81
+ submodules: recursive
82
+
83
+ - if: ${{ steps.cache-regression.outputs.cache-hit != 'true' }}
84
+ run: cd test/external/riscv-tests && make
85
+
86
+ - if: ${{ steps.cache-regression.outputs.cache-hit != 'true' }}
87
+ name: Upload riscv-tests
88
+ uses: actions/upload-artifact@v7
89
+ with:
90
+ path: test/external/riscv-tests
91
+
92
+ run-regression-tests:
93
+ name: Run regression tests (riscv-tests)
94
+ runs-on: ubuntu-22.04 # older version for compatibility with Docker image
95
+ timeout-minutes: 60
96
+ container: ghcr.io/kuznia-rdzeni/verilator:v5.008-2023.11.19_v
97
+ needs: [ build-regression-tests, build-core ]
98
+ steps:
99
+ - name: Checkout
100
+ uses: actions/checkout@v6
101
+
102
+ - name: Get submodules HEAD hash
103
+ run: |
104
+ git config --global --add safe.directory /__w/coreblocks/coreblocks
105
+ git submodule > .gitmodules-hash
106
+
107
+ - name: Set up Python
108
+ uses: actions/setup-python@v5
109
+ with:
110
+ python-version: '3.13'
111
+
112
+ - name: Install dependencies
113
+ run: |
114
+ python3 -m venv venv
115
+ . venv/bin/activate
116
+ python3 -m pip install --upgrade pip
117
+ python3 -m pip install ".[dev]"
118
+
119
+ - uses: actions/download-artifact@v8
120
+ name: Download full verilog core
121
+ with:
122
+ name: "verilog-full-core"
123
+ path: .
124
+
125
+ - uses: actions/cache@v4
126
+ name: Download tests from cache
127
+ env:
128
+ cache-name: cache-regression-tests
129
+ with:
130
+ path: test/external/riscv-tests/test-*
131
+ key: ${{ env.cache-name }}-${{ runner.os }}-${{ hashFiles(
132
+ '**/test/external/riscv-tests/environment/custom/**',
133
+ '**/test/external/riscv-tests/Makefile',
134
+ '**/.gitmodules-hash',
135
+ '**/docker/riscv-toolchain.Dockerfile',
136
+ '**/.github/workflows/main.yml'
137
+ ) }}
138
+ fail-on-cache-miss: true
139
+
140
+ - name: Run tests
141
+ run: |
142
+ . venv/bin/activate
143
+ scripts/run_tests.py -a regression -v
144
+
145
+ - name: Check regression with pysim
146
+ run: |
147
+ . venv/bin/activate
148
+ ./scripts/run_tests.py -c 1 -a -b pysim regression
149
+
150
+ build-arch-regression-tests:
151
+ name: Build arch regression tests (riscv-arch-test)
152
+ runs-on: ubuntu-latest
153
+ container:
154
+ image: ghcr.io/riscv/act4-build:sha-cb452225bcac086030f4bf6f3565298abe45401c
155
+ options: --user root
156
+ timeout-minutes: 20
157
+ steps:
158
+ - name: Add required tools for github CI
159
+ run: |
160
+ apt-get update
161
+ apt-get install -y git tar gzip curl ca-certificates build-essential libgmp-dev
162
+
163
+ - name: Checkout
164
+ uses: actions/checkout@v6
165
+
166
+ - name: Get submodules HEAD hash
167
+ working-directory: .
168
+ run: |
169
+ git config --global --add safe.directory /__w/coreblocks/coreblocks
170
+ git submodule > .gitmodules-hash
171
+
172
+ - name: Cache arch regression tests
173
+ id: cache-arch-regression-tests
174
+ uses: actions/cache@v4
175
+ env:
176
+ cache-name: cache-arch-regression-tests
177
+ with:
178
+ path: |
179
+ test/external/riscv-arch-test/elfs/**/*.elf
180
+ key: ${{ env.cache-name }}-${{ runner.os }}-${{ hashFiles(
181
+ '**/test/external/riscv-arch-test/Makefile',
182
+ '**/test/external/riscv-arch-test/coreblocks/**',
183
+ '**/.gitmodules-hash',
184
+ '**/.github/workflows/main.yml'
185
+ ) }}
186
+
187
+ - if: ${{ steps.cache-arch-regression-tests.outputs.cache-hit != 'true' }}
188
+ name: Checkout with submodules
189
+ uses: actions/checkout@v6
190
+ with:
191
+ submodules: recursive
192
+
193
+ - if: ${{ steps.cache-arch-regression-tests.outputs.cache-hit != 'true' }}
194
+ name: Trust riscv-arch-test with mise
195
+ run: mise trust test/external/riscv-arch-test/.mise.toml
196
+
197
+ - if: ${{ steps.cache-arch-regression-tests.outputs.cache-hit != 'true' }}
198
+ name: Build arch regression tests
199
+ run: make -C test/external/riscv-arch-test -j $(nproc)
200
+
201
+ - name: Upload riscv-arch-test tests
202
+ uses: actions/upload-artifact@v7
203
+ with:
204
+ name: "riscv-arch-test-elfs"
205
+ path: test/external/riscv-arch-test/elfs
206
+
207
+ run-arch-regression-tests:
208
+ strategy:
209
+ fail-fast: false
210
+ matrix:
211
+ config: [cocotb, pysim]
212
+ name: Run arch regression tests (riscv-arch-test)
213
+ runs-on: ubuntu-22.04 # older version for compatibility with Docker image
214
+ container: ghcr.io/kuznia-rdzeni/verilator:v5.008-2023.11.19_v
215
+ timeout-minutes: 180
216
+ needs: [ build-arch-regression-tests ]
217
+ steps:
218
+ - name: Checkout
219
+ uses: actions/checkout@v6
220
+
221
+ - name: Get submodules HEAD hash
222
+ working-directory: .
223
+ run: |
224
+ git config --global --add safe.directory /__w/coreblocks/coreblocks
225
+ git submodule > .gitmodules-hash
226
+
227
+ - name: Restore arch regression tests cache
228
+ uses: actions/cache@v4
229
+ env:
230
+ cache-name: cache-arch-regression-tests
231
+ with:
232
+ path: |
233
+ test/external/riscv-arch-test/elfs/**/*.elf
234
+ key: ${{ env.cache-name }}-${{ runner.os }}-${{ hashFiles(
235
+ '**/test/external/riscv-arch-test/Makefile',
236
+ '**/test/external/riscv-arch-test/coreblocks/**',
237
+ '**/.gitmodules-hash',
238
+ '**/.github/workflows/main.yml'
239
+ ) }}
240
+ fail-on-cache-miss: true
241
+
242
+ - name: Set up Python
243
+ uses: actions/setup-python@v5
244
+ with:
245
+ python-version: '3.13'
246
+
247
+ - name: Install dependencies
248
+ run: |
249
+ python3 -m venv venv
250
+ . venv/bin/activate
251
+ python3 -m pip install --upgrade pip
252
+ python3 -m pip install ".[dev]"
253
+
254
+ - name: Run arch regression tests
255
+ run: |
256
+ . venv/bin/activate
257
+ if [ "${{ matrix.config }}" = "cocotb" ]; then
258
+ ./scripts/run_tests.py --arch-tests -v -b cocotb regression
259
+ else
260
+ ./scripts/run_tests.py --arch-tests -v -b pysim -c 1 -j 0 'regression.*not'
261
+ fi
262
+
263
+ unit-test:
264
+ name: Run unit tests
265
+ runs-on: ubuntu-latest
266
+ timeout-minutes: 150
267
+ steps:
268
+ - name: Checkout
269
+ uses: actions/checkout@v6
270
+
271
+ - name: Set up Python
272
+ uses: actions/setup-python@v5
273
+ with:
274
+ python-version: '3.13'
275
+ cache: 'pip'
276
+ cache-dependency-path: |
277
+ pyproject.toml
278
+
279
+ - name: Install dependencies
280
+ run: |
281
+ python -m pip install --upgrade pip
282
+ pip3 install ".[dev]"
283
+ sudo apt-get install -y binutils-riscv64-unknown-elf
284
+
285
+ - name: Run tests
286
+ run: ./scripts/run_tests.py -v
287
+
288
+ - name: Check traces and profiles
289
+ run: ./scripts/run_tests.py -t -p -c 1 TestCore
290
+
291
+ - name: Check listing tests
292
+ run: ./scripts/run_tests.py -l
293
+
294
+ lint:
295
+ name: Check code formatting and typing
296
+ runs-on: ubuntu-latest
297
+ timeout-minutes: 5
298
+ steps:
299
+ - name: Checkout
300
+ uses: actions/checkout@v6
301
+
302
+ - name: Set up Python
303
+ uses: actions/setup-python@v5
304
+ with:
305
+ python-version: '3.13'
306
+ cache: 'pip'
307
+ cache-dependency-path: |
308
+ pyproject.toml
309
+
310
+ - name: Install dependencies
311
+ run: |
312
+ python -m pip install --upgrade pip
313
+ pip3 install ".[dev]"
314
+
315
+ - name: Check format
316
+ run: ./scripts/lint.sh check_format
317
+
318
+ - name: Check types
319
+ run: ./scripts/lint.sh check_types
320
+
321
+ - name: Check line endings
322
+ run: |
323
+ git add --renormalize .
324
+ git diff --cached --exit-code
325
+
326
+ - name: Check pre-commit hooks
327
+ run: pre-commit run --all-files --show-diff-on-failure