{"id":15398989,"url":"https://github.com/seldridge/rocket-rocc-examples","last_synced_at":"2025-04-15T21:34:21.845Z","repository":{"id":144803318,"uuid":"64344228","full_name":"seldridge/rocket-rocc-examples","owner":"seldridge","description":"Tests for example Rocket Custom Coprocessors","archived":false,"fork":false,"pushed_at":"2020-02-19T22:15:39.000Z","size":31,"stargazers_count":69,"open_issues_count":3,"forks_count":27,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-01T12:42:12.476Z","etag":null,"topics":["riscv","rocc","rocket-chip"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seldridge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2016-07-27T21:53:43.000Z","updated_at":"2024-09-20T06:54:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"b9cfb5ce-841e-44d5-a610-c09ef441bb14","html_url":"https://github.com/seldridge/rocket-rocc-examples","commit_stats":{"total_commits":29,"total_committers":3,"mean_commits":9.666666666666666,"dds":"0.10344827586206895","last_synced_commit":"e5074735817984b73a01f4f27ac2acb6cb88146a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seldridge%2Frocket-rocc-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seldridge%2Frocket-rocc-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seldridge%2Frocket-rocc-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seldridge%2Frocket-rocc-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seldridge","download_url":"https://codeload.github.com/seldridge/rocket-rocc-examples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223688770,"owners_count":17186297,"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":["riscv","rocc","rocket-chip"],"created_at":"2024-10-01T15:46:23.626Z","updated_at":"2024-11-08T13:02:06.571Z","avatar_url":"https://github.com/seldridge.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Collection of example libraries and test programs for the existing Rocket Custom Coprocessor (RoCC) accelerators for [Rocket Chip](https://github.com/ucb-bar/rocket-chip).\n\n## Usage\n\nInstall the RISC-V toolchain and make sure that it's on your path.\nYou need to pass the path to `riscv-tools` in as an argument to configure `--with-riscvtools=$PATH_TO_RISCV_TOOLS`.\n\n```\nautoconf\nmkdir build \u0026\u0026 cd build\n../configure --with-riscvtools=$PATH_TO_RISCV_TOOLS\nmake\n```\n\nThis creates two classes of tests:\n* `bareMetal` -- Bare metal tests like [RISCV Tests](https://github.com/riscv/riscv-tests)\n* `pk` -- Tests that use the [Proxy Kernel](https://github.com/riscv/riscv-pk)\n\nBare Metal tests can be run directly on the emulator (for instructions on how to build this see the following section), e.g.:\n\n```\nemulator-freechips.rocketchip.system-RoccExampleConfig bareMetal/examples-bareMetal-p-accumulator\n```\n\nProxy Kernel tests are ELFs and need the Proxy Kernel (or Linux).\nYou must first patch the Proxy Kernel so that the `XS` bits allow access to the \"extension\" (the RoCC).\nYou can change this manually or use the provided patch ([`patches/riscv-pk.patch`](patches/riscv-pk.patch)):\n```\ncd $RISCV_PK_DIR\ngit apply $THIS_REPO_DIR/patches/riscv-pk.patch\n\nmkdir build\ncd build\n../configure --prefix=$RISCV/riscv64-unknown-elf --host=riscv64-unknown-elf\nmake\nmake install\n```\n\nFollowing that, you can run Proxy Kernel tests, e.g., :\n\n```\nemulator-freechips.rocketchip.system-RoccExampleConfig pk pk/examples-pk-accumulator\n```\n\n## Building a Rocket Chip Emulator\n\nBuild a rocket-chip emulator with the RoCC examples baked in and run the provided test program:\n```\ncd $ROCKETCHIP_DIR/emulator\nmake CONFIG=RoccExampleConfig\n```\n\n### Expected Run Time\n\nThe included test should run for ~5 million cycles over a wall clock time of ~5 minutes.\n\n```\n\u003e time $ROCKETCHIP_DIR/emulator-freechips.rocketchip.system-RoccExampleConfig -c pk pk/examples-pk-accumulator\n[INFO] Write R[1] = 0xdead\n[INFO] Read R[1]\n[INFO]   Received 0xdead (expected 0xdead)\n[INFO] Accum R[1] with 0xffffffffffffe042\n[INFO] Read R[1]\n[INFO]   Received 0xbeef (expected 0xbeef)\n[INFO] Load 0xbad (virt: 0x0xfee9ac0, phys: 0x0x8ffffac0) via L1 virtual address\n[INFO] Read R[1]\n[INFO]   Received 0xbad (expected 0xbad)\nCompleted after 3278954 cycles\n\nreal\t5m2.738s\nuser\t5m0.262s\nsys\t0m1.179s\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseldridge%2Frocket-rocc-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseldridge%2Frocket-rocc-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseldridge%2Frocket-rocc-examples/lists"}