Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch out Regz datastructures for SQLite #316

Merged
merged 16 commits into from
Dec 19, 2024
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ jobs:
cd port/raspberrypi/rp2xxx
zig build test

- name: Unit Test Regz
run: zig build test
working-directory: tools/regz

- name: Unit Test UF2
run: zig build test
working-directory: tools/uf2

- name: Build Website
run: zig build
working-directory: website
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build Examples
on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
example_dir: [
#espressif/esp,
gigadevice/gd32,
microchip/avr,
microchip/atsam,
nordic/nrf5x,
nxp/lpc,
stmicro/stm32,
raspberrypi/rp2xxx,
wch/ch32v,
]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Zig
uses: mlugg/setup-zig@v1
with:
version: 0.13.0

- name: Build
run: zig build -Doptimize=ReleaseSmall --summary all
working-directory: examples/${{ matrix.example_dir }}
3 changes: 0 additions & 3 deletions build-internals/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@ pub const Chip = struct {

/// The provider for register definitions.
register_definition: union(enum) {
/// Use `regz` to create a zig file from a JSON schema.
json: LazyPath,

/// Use `regz` to create a json file from a SVD schema.
svd: LazyPath,

Expand Down
4 changes: 2 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,10 @@ pub fn MicroBuild(port_select: PortSelect) type {

const regz_exe = b.dependency("tools/regz", .{}).artifact("regz");
const chip_source = switch (target.chip.register_definition) {
.json, .atdf, .svd => |file| blk: {
.atdf, .svd => |file| blk: {
const regz_run = b.addRunArtifact(regz_exe);

regz_run.addArg("--schema"); // Explicitly set schema type, one of: svd, atdf, json
regz_run.addArg("--format");
regz_run.addArg(@tagName(target.chip.register_definition));

regz_run.addArg("--output_path"); // Write to a file
Expand Down
4 changes: 2 additions & 2 deletions port/gigadevice/gd32/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub fn init(dep: *std.Build.Dependency) Self {
.abi = .none,
},
.register_definition = .{
.json = b.path("src/chips/GD32VF103.json"),
.svd = b.path("src/chips/GD32VF103.svd"),
},
.memory_regions = &.{
.{ .offset = 0x08000000, .length = 128 * 1024, .kind = .flash },
Expand All @@ -55,7 +55,7 @@ pub fn init(dep: *std.Build.Dependency) Self {
.abi = .none,
},
.register_definition = .{
.json = b.path("src/chips/GD32VF103.json"),
.svd = b.path("src/chips/GD32VF103.svd"),
},
.memory_regions = &.{
.{ .offset = 0x08000000, .length = 64 * 1024, .kind = .flash },
Expand Down
Loading
Loading