{"repo":"SpencerTorres/Click-V","free":true,"listed":false,"github":"https://github.com/SpencerTorres/Click-V","clone":"git clone https://github.com/SpencerTorres/Click-V.git","description":"A RISC-V emulator built with ClickHouse SQL","language":"Go","stars":52,"topics":["clickhouse","database","risc-v","riscv","riscv-emulator","riscv32","sql"],"license":"Apache-2.0","category":"databases-storage","readme_excerpt":"Click-V A RISC-V emulator built with ClickHouse SQL. This emulator makes ClickHouse truly Turing complete. We are one step closer to running ClickHouse in ClickHouse. This project/repository isn't dev-friendly yet, I'm just uploading it here as a backup in case my PC catches fire. How it works The system will react to the following insert command: This command will trigger a large set of branched materialized views and Null tables that filter out the program's instructions to simulate reading/writing from registers and memory. External host machine access works via a single UDF with a custom binary format that gets read/written as an Array(UInt8) . The program is able to perform any logic. Printing to a console table and drawing are built-in. It can also open/close/read/write/seek files and sockets via the ClickOS UDF. For more details, see the architecture section. Performance Using the EmbeddedRocksDB table engine for registers/memory, the performance degrades as the memory grows because some parts of the emulator must scan through memory multiple times. For smaller binaries, it can run close to 60hz , but for complex binaries (such as Doom) it is closer to 12hz . How to run Steps: - Set up a ClickHouse v25.10+ image - Run all SQL statements in /sql/click-v.sql (exclude the syscalls at the bottom if you don't have the ClickOS UDF setup. See docker-compose.yml for clues.) - Load your own RISC-V 32im program into INSERT INTO clickv.load program (hex) VALUES ('FFFFFFFF') (make","default_branch":null,"files":null,"tree":[],"storefront":"/r/SpencerTorres","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/SpencerTorres/Click-V/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}