Skip to content

Commit

Permalink
Switch out Regz datastructures for SQLite (#316)
Browse files Browse the repository at this point in the history
* gen and atdf unit tests passing

* enable svd tests, add database indexes

* revert stm32 all.zig

* enable ARM interrupts

* add example builds to CI

* add commas

* add exmaples dir

* fix device ref

* fix atdf too

* shema -> format

* silent regz

* fix up register files

* add summary to double check examples actions

* fix typo

* don't do esp for now

* add tests to CI
  • Loading branch information
mattnite authored Dec 19, 2024
1 parent 5180d6b commit 1e5cf62
Show file tree
Hide file tree
Showing 43 changed files with 76,442 additions and 76,035 deletions.
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

0 comments on commit 1e5cf62

Please sign in to comment.