Download firmware/build.zig from Snapkitty/Intent-V: direct link, hf CLI and curl.
- Browser
- Download file 1.45 kB
-
https://huggingface.co/Snapkitty/Intent-V/resolve/main/firmware/build.zig
- Command line
-
hf download hf://Snapkitty/Intent-V/firmware/build.zig
-
curl -L -o build.zig https://huggingface.co/Snapkitty/Intent-V/resolve/main/firmware/build.zig
1.45 kB
| // SPDX-License-Identifier: LicenseRef-Sovereign-Leviathan-SL-AGPL3-001 | |
| // Licensing: see LICENSE in the repository root. | |
| // Targets Zig 0.13.x. Build: `zig build` -> zig-out/bin/intent-v.elf | |
| const std = ("std"); | |
| pub fn build(b: *std.Build) void { | |
| const target = b.resolveTargetQuery(.{ | |
| .cpu_arch = .riscv32, | |
| .os_tag = .freestanding, | |
| .abi = .none, | |
| .cpu_features_add = std.Target.riscv.featureSet(&.{.m}), | |
| }); | |
| // Debug pulls in enough compiler-rt/panic code to overflow the 64K ROM | |
| // (measured overflow: 149544 bytes). ReleaseSmall fits. Override with | |
| // -Doptimize=Debug only if the linker ROM is enlarged. | |
| const optimize = b.option(std.builtin.OptimizeMode, "optimize", "Optimization mode") orelse .ReleaseSmall; | |
| const exe = b.addExecutable(.{ | |
| .name = "intent-v.elf", | |
| .root_source_file = b.path("src/main.zig"), | |
| .target = target, | |
| .optimize = optimize, | |
| .single_threaded = true, | |
| }); | |
| exe.setLinkerScript(b.path("linker.ld")); | |
| b.installArtifact(exe); | |
| // Host-side unit tests for the register-level logic (no hardware needed). | |
| const host_tests = b.addTest(.{ | |
| .root_source_file = b.path("src/ccu.zig"), | |
| .target = b.standardTargetOptions(.{}), | |
| .optimize = optimize, | |
| }); | |
| const run_tests = b.addRunArtifact(host_tests); | |
| b.step("test", "Run host-side unit tests").dependOn(&run_tests.step); | |
| } | |