Repository navigation
Openframe GPIO configurator - #33
Draft
marwaneltoukhy wants to merge 6 commits into
Draft
marwaneltoukhy wants to merge 6 commits into
marwaneltoukhy wants to merge 6 commits into
Conversation
…n openframe) - project.openframe spec in .cf/project.json (schema_version 1) with a shipped JSON Schema plus semantic validation: duplicate pads, bus bit gaps/duplicates, mixed directions, missing signals, reserved/keyword names, port clashes, macro domains not enabled. All errors are reported; no silent defaults. - Generators for verilog/rtl/openframe_gpio.v (CF_gpio_config per pad, named user ports, override parameters) and openlane/openframe_project_wrapper/power.json (VDD_NETS, GND_NETS, PDN_MACRO_CONNECTIONS). - cf openframe validate/generate [--check]/export/import (YAML or JSON). - cf gpio-config opens a Textual 44-pad grid on openframe projects. - cf init seeds project.openframe from .cf/openframe_default.json when present. - Adds pyyaml and jsonschema dependencies; bumps version to 2.7.0.
LibreLane 3 writes a cursor-restore escape to stdout on exit when attached to a TTY, so parsing the whole probe output as JSON failed with 'Extra data' and cf harden aborted before starting LibreLane. The probe now tags its JSON line and cf harden parses only that line, raising if it is missing.
…les are out of sync - When openlane/<macro>/power.json exists, cf harden (Nix and Docker) and the shared build_librelane_command pass it before config.* like openlane/Makefile, since LibreLane has no include and the last file's meta wins. - cf harden openframe_project_wrapper and cf precheck print a warning panel when project.openframe and the generated files differ, per file: missing, generated from a different spec (spec-sha256), edited by hand, or not generated by cf; also when the spec is missing or invalid.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
CF_gpio_configinstances inopenframe_project_wrapper.v.cf gpio-configrefused openframe projects, and it writesuser_defines.v, which is the wrong model for openframe. There was no single source of truth for pad modes, and nothing a web configurator could produce.power.json.cf hardenpassed a single config file, so it could not harden the new wrapper. LibreLane has no config include, and the last file'smetawins, sopower.jsonmust come beforeconfig.json.cf hardenaborted on LibreLane 3 before LibreLane even started. LibreLane 3 writes a cursor-restore escape to stdout on exit, which broke cf-cli's JSON parse of the step list.What
project.openframein.cf/project.json,schema_version: 1).unused_mode.chipfoundry_cli/openframe/openframe.schema.json).unused_mode, bus gaps or duplicate bits, mixed directions on one signal, output/bidir pads without a signal, analog pads with a signal, reserved or keyword names, generated-port clashes, macros on a disabled domain, and duplicate JSON/YAML keys.verilog/rtl/openframe_gpio.v: oneCF_gpio_configper pad with named user ports. A bidir signalxbecomesx_in,x_outandx_oeb.openlane/openframe_project_wrapper/power.json:VDD_NETS,GND_NETSandPDN_MACRO_CONNECTIONS, using LibreLane 3 names.spec-sha256header, so staleness can be detected.cf openframe validatecf openframe generate [--check], where--checkis for CIcf openframe exportandcf openframe import [--force], in YAML or JSON, for hand edits and the future web configuratorcf gpio-configon openframe. It opens a Textual 44-pad grid (mode, signal/bit and override modal, power modal, validate-on-save) and regenerates the files. The caravel path is unchanged.cf initon openframe. It seeds the spec from the template's.cf/openframe_default.jsonwhen the project has none.versions.jsonpinsopenlane_version: CI2609, which is upstream LibreLane 3.0.14.cf hardenconfig ordering. Whenopenlane/<macro>/power.jsonexists, it is passed beforeconfig.*on both Nix and Docker, matchingopenlane/Makefile. This lives in a shared helper thatcf previewalso uses. The banner showsConfig: power.json + config.json.cf harden openframe_project_wrapperandcf precheckprint a warning panel when the generated files don't match the spec.cf hardenparses only that line. It raises an error if the tag is missing.pyyamlandjsonschema.docs/OPENFRAME.mdcovering configure → generate → harden → precheck.Testing
pytestgives 234 passed, 1 skipped. There are 89 new tests:power.jsoncontentsgenerate --check, import/export/--force,initseedingpower.jsonordering for nix, docker and previewverilator --lint-only -Wallandiverilog -Wallare clean on generated RTL for the timer spec and a mixed-mode spec (tests skip if the tools are missing). Ruff E/F/I is clean on the new code.cf harden openframe_project_wrapper --use-dockeron the openframe PDN branch ran with LibreLane 3.0.14 andghcr.io/librelane/librelane:3.0.14.resolved.jsonshows thepower.jsonnets.Follow-ups
CI2609tag: it doesn't exist yet inchipfoundry/openlane-2(see the openlane-2 PR). Until it is created,cf setup --only-openlaneand the nix path cannot fetch it.versions.jsonpins open_pdks3e0e31dc…, which is not published in the ciel releases. LibreLane 3.0.14 pins sky1308afc8346…, and that revision was used for all verification. Updateopen_pdks_commits(andmpw_tagsif needed) before release.versions.jsonfrom upstream:cf hardenreads it from cf-climain, so the nix path keeps using CI2511 until this PR is merged.v1.2.0.tar.gzplus an IPM catalog entry) before pad overrides can be installed through IPM. Generated RTL with no overrides also works with v1.1.4.