{"id":13427716,"url":"https://github.com/SpinalHDL/NaxRiscv","last_synced_at":"2025-03-16T00:32:04.283Z","repository":{"id":38739356,"uuid":"413357087","full_name":"SpinalHDL/NaxRiscv","owner":"SpinalHDL","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-10T10:39:44.000Z","size":3591,"stargazers_count":275,"open_issues_count":40,"forks_count":41,"subscribers_count":24,"default_branch":"main","last_synced_at":"2025-03-12T14:02:20.061Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SpinalHDL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSES/CC0-1.0.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-04T09:31:06.000Z","updated_at":"2025-03-10T10:39:49.000Z","dependencies_parsed_at":"2023-10-11T19:03:39.719Z","dependency_job_id":"b72add0a-d5ee-4e36-9159-c0b59d06e3ff","html_url":"https://github.com/SpinalHDL/NaxRiscv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpinalHDL%2FNaxRiscv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpinalHDL%2FNaxRiscv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpinalHDL%2FNaxRiscv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpinalHDL%2FNaxRiscv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SpinalHDL","download_url":"https://codeload.github.com/SpinalHDL/NaxRiscv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243809865,"owners_count":20351403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T01:00:39.053Z","updated_at":"2025-03-16T00:32:04.260Z","avatar_url":"https://github.com/SpinalHDL.png","language":"Scala","funding_links":[],"categories":["Scala","CPU","Open Source implementations","Open Source Core Implementations"],"sub_categories":[],"readme":"\u003c!--\nSPDX-FileCopyrightText: 2023 Everybody\n\nSPDX-License-Identifier: CC0-1.0\n--\u003e\n\n# NaxRiscv\n\nA RISC-V core currently characterised by :\n \n- Out of order execution with register renaming\n- Superscalar (ex : 2 decode, 3 execution units, 2 retire)\n- (RV32/RV64)IMAFDCSU (Linux / Buildroot works on hardware)\n- High perf config : 2.93 DMIPS/MHz, 5.02 Coremark/MHz, 1.67 Embench-iot baseline (Cortex M4) @ 155 MHz + 13.3 KLUT on Artix 7-3\n- Portable HDL, but target FPGA with distributed ram (Xilinx series 7 is the reference used so far)\n- Target a (relatively) low area usage and high fmax (not the best IPC)\n- Decentralized hardware elaboration (Empty toplevel parameterized with plugins)\n- Frontend implemented around a pipelining framework to ease customisation\n- Non-blocking Data cache with multiple refill and writeback slots\n- BTB + GSHARE + RAS branch predictors\n- Hardware refilled MMU (SV32, SV39)\n- Load to use latency of 3 cycles via the speculative cache hit predictor\n- Pipeline visualisation via verilator simulation and Konata (gem5 file format)\n- JTAG / OpenOCD / GDB support by implementing the RISCV External Debug Support v. 0.13.2\n\nTo test the project, see the \"Running Verilator simulation\" section\n\n# Online documentation\n\nThere is a Read The Doc hosted here :\n\nhttps://spinalhdl.github.io/NaxRiscv-Rtd/main/NaxRiscv/introduction/index.html\n\n# Performances / Area\n\nSee :\n\nhttps://spinalhdl.github.io/NaxRiscv-Rtd/main/NaxRiscv/performance/index.html\n\n# Running on hardware\n\nNaxRiscv is currently integrated into https://github.com/enjoy-digital/litex. For instance to run it on the Nexys video board, you can :\n\n```shell\npython3 -m litex_boards.targets.digilent_nexys_video --cpu-type=naxriscv --with-video-framebuffer --with-sdcard --build --load\n```\n\nAlso, note that if you want to run Linux on it, it is image compatible with https://github.com/litex-hub/linux-on-litex-vexriscv, you will have to adapt the dts/dtb (removing peripherals).\n\nHere is Doom running in linux :\nhttps://twitter.com/enjoy_digital/status/1493996880593887235?s=20\u0026t=VR734wYewBFsT2Fgvm339Q\n\n# Running Verilator simulation\n\nSee src/test/cpp/naxriscv/README.md\n\nLinux/Buildroot running in simulation :\n\n```\n./obj_dir/VNaxRiscv \\\n    --load-bin $LINUX_IMAGES/fw_jump.bin,0x80000000 \\\n    --load-bin $LINUX_IMAGES/linux.dtb,0x80F80000 \\\n    --load-bin $LINUX_IMAGES/Image,0x80400000 \\\n    --load-bin $LINUX_IMAGES/rootfs.cpio,0x81000000\nOpenSBI v0.8\n   ____                    _____ ____ _____\n  / __ \\                  / ____|  _ \\_   _|\n | |  | |_ __   ___ _ __ | (___ | |_) || |\n | |  | | '_ \\ / _ \\ '_ \\ \\___ \\|  _ \u003c | |\n | |__| | |_) |  __/ | | |____) | |_) || |_\n  \\____/| .__/ \\___|_| |_|_____/|____/_____|\n        | |\n        |_|\n\nPlatform Name       : NaxRiscv\nPlatform Features   : timer,mfdeleg\nPlatform HART Count : 1\nBoot HART ID        : 0\nBoot HART ISA       : rv32imasu\nBOOT HART Features  : scounteren,mcounteren\nBOOT HART PMP Count : 0\nFirmware Base       : 0x80000000\nFirmware Size       : 64 KB\nRuntime SBI Version : 0.2\n\nMIDELEG : 0x00000222\nMEDELEG : 0x0000b109\n[    0.000000] Linux version 5.10.1 (rawrr@rawrr) (riscv32-buildroot-linux-gnu-gcc.br_real (Buildroot 2020.11-rc3-8-g9ef54b7d0b) 10.2.0, GNU ld (GNU Binutils) 2.34) #2 SMP Wed Jan 26 14:18:17 CET 2022\n[    0.000000] earlycon: sbi0 at I/O port 0x0 (options '')\n[    0.000000] printk: bootconsole [sbi0] enabled\n[    0.000000] Initial ramdisk at: 0x(ptrval) (8388608 bytes)\n[    0.000000] Zone ranges:\n[    0.000000]   Normal   [mem 0x0000000080400000-0x000000008fffffff]\n[    0.000000] Movable zone start for each node\n[    0.000000] Early memory node ranges\n[    0.000000]   node   0: [mem 0x0000000080400000-0x000000008fffffff]\n[    0.000000] Initmem setup node 0 [mem 0x0000000080400000-0x000000008fffffff]\n[    0.000000] SBI specification v0.2 detected\n[    0.000000] SBI implementation ID=0x1 Version=0x8\n[    0.000000] SBI v0.2 TIME extension detected\n[    0.000000] SBI v0.2 IPI extension detected\n[    0.000000] SBI v0.2 RFENCE extension detected\n[    0.000000] SBI v0.2 HSM extension detected\n[    0.000000] riscv: ISA extensions aim\n[    0.000000] riscv: ELF capabilities aim\n[    0.000000] percpu: Embedded 10 pages/cpu s18700 r0 d22260 u40960\n[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 64008\n[    0.000000] Kernel command line: rootwait console=hvc0 earlycon=sbi root=/dev/ram0 init=/sbin/init\n[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes, linear)\n[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes, linear)\n[    0.000000] Sorting __ex_table...\n[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off\n[    0.000000] Memory: 241280K/258048K available (4717K kernel code, 553K rwdata, 632K rodata, 166K init, 213K bss, 16768K reserved, 0K cma-reserved)\n[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1\n[    0.000000] rcu: Hierarchical RCU implementation.\n[    0.000000] rcu: \tRCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.\n[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.\n[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1\n[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0\n[    0.000000] riscv-intc: 32 local interrupts mapped\n[    0.000000] random: get_random_bytes called from start_kernel+0x35c/0x4dc with crng_init=0\n[    0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0]\n[    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x171024e7e0, max_idle_ns: 440795205315 ns\n[    0.000096] sched_clock: 64 bits at 100MHz, resolution 10ns, wraps every 4398046511100ns\n[    0.001452] Console: colour dummy device 80x25\n[    0.001923] printk: console [hvc0] enabled\n[    0.001923] printk: console [hvc0] enabled\n[    0.002597] printk: bootconsole [sbi0] disabled\n[    0.002597] printk: bootconsole [sbi0] disabled\n[    0.003469] Calibrating delay loop (skipped), value calculated using timer frequency.. 200.00 BogoMIPS (lpj=400000)\n[    0.004346] pid_max: default: 32768 minimum: 301\n[    0.006040] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)\n[    0.006715] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)\n[    0.018275] rcu: Hierarchical SRCU implementation.\n[    0.021169] smp: Bringing up secondary CPUs ...\n[    0.021752] smp: Brought up 1 node, 1 CPU\n[    0.024190] devtmpfs: initialized\n[    0.029478] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns\n[    0.030479] futex hash table entries: 256 (order: 2, 16384 bytes, linear)\n[    0.032419] NET: Registered protocol family 16\n[    0.072397] clocksource: Switched to clocksource riscv_clocksource\n[    0.130361] NET: Registered protocol family 2\n[    0.135484] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)\n[    0.136588] TCP established hash table entries: 2048 (order: 1, 8192 bytes, linear)\n[    0.137670] TCP bind hash table entries: 2048 (order: 2, 16384 bytes, linear)\n[    0.138674] TCP: Hash tables configured (established 2048 bind 2048)\n[    0.139694] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)\n[    0.140653] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)\n[    0.145111] Unpacking initramfs...\n[    0.382796] Initramfs unpacking failed: invalid magic at start of compressed archive\n[    0.438458] Freeing initrd memory: 8192K\n[    0.442311] workingset: timestamp_bits=30 max_order=16 bucket_order=0\n[    0.497197] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)\n[    0.497827] io scheduler mq-deadline registered\n[    0.498260] io scheduler kyber registered\n[    0.863943] NET: Registered protocol family 10\n[    0.869801] Segment Routing with IPv6\n[    0.870713] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver\n[    0.875543] NET: Registered protocol family 17\n[    0.880356] Freeing unused kernel memory: 164K\n[    0.880786] Kernel memory protection not selected by kernel config.\n[    0.881380] Run /init as init process\nStarting syslogd: OK\nStarting klogd: OK\nRunning sysctl: OK\nSaving random seed: [    1.502669] random: dd: uninitialized urandom read (512 bytes read)\nOK\nStarting network: OK\n\nWelcome to Buildroot\nbuildroot login: root\n           _  _                     ___      _\n    o O O | \\| |   __ _    __ __   | _ \\    (_)     ___     __     __ __\n   o      | .` |  / _` |   \\ \\ /   |   /    | |    (_-\u003c    / _|    \\ V /\n  TS__[O] |_|\\_|  \\__,_|   /_\\_\\   |_|_\\   _|_|_   /__/_   \\__|_   _\\_/_\n {======|_|\"\"\"\"\"|_|\"\"\"\"\"|_|\"\"\"\"\"|_|\"\"\"\"\"|_|\"\"\"\"\"|_|\"\"\"\"\"|_|\"\"\"\"\"|_|\"\"\"\"\"|\n./o--000'\"`-0-0-'\"`-0-0-'\"`-0-0-'\"`-0-0-'\"`-0-0-'\"`-0-0-'\"`-0-0-'\"`-0-0-'\nlogin[65]: root login on 'console'\nroot@buildroot:~# cat /proc/cpuinfo\nprocessor\t: 0\nhart\t\t: 0\nisa\t\t: rv32ima\nmmu\t\t: sv32\n\nroot@buildroot:~# echo 1+2+3*4 | bc\n15\nroot@buildroot:~# micropython\nMicroPython v1.13 on 2022-01-26; linux version\nUse Ctrl-D to exit, Ctrl-E for paste mode\n\u003e\u003e\u003e 1+2+3\n6\n\u003e\u003e\u003e import math\n\u003e\u003e\u003e math.sin(math.pi/4)\n0.7071067811865475\n\u003e\u003e\u003e from sys import exit\n\u003e\u003e\u003e exit()\nroot@buildroot:~# ls /\nbin      init     linuxrc  opt      run      tmp\ndev      lib      media    proc     sbin     usr\netc      lib32    mnt      root     sys      var\nroot@buildroot:~#\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSpinalHDL%2FNaxRiscv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSpinalHDL%2FNaxRiscv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSpinalHDL%2FNaxRiscv/lists"}