Philipp Schilk 2022-2023
schilkp / reginald Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Read the docs? MDBook? Integrate with GitHub pages?
Requires:
Do yourself a favour and lock everything else down a bit first.
"everything is a block including registers which are blocks with an unamed template" Figure it out. Blame @villanif.
Change block instantiation:
TemplateName:
instances: {Instance name: adr, ...}
At least verify that all examples are actually accepted.
Split input and data model
Add "Register Block" system:
CH1_SET: # Single register block instantiation
start_adr: 0x01
register_block_template: "CH_SETTINGS"
CHn_SET: # Multiple register block instantiation
start_adr: {1: 0x100, B: 0x200}
replace_str_with_instance_name: "n" # Optional, Fallback: suffix w\o any padding char
register_block_template: "CH_SETTINGS"
default_register_bitwidth: 8
...
registers:
REGA:
bitwidth: 8 # Override
register:
A:
...
fields:
SETTINGS:
bits: []
brief:
doc:
enum:
VALA:
..
OTHERFIELD:
...
enum: GPIO_MODE
shared_enums:
GPIO_MODE:
brief:
doc:
enum:
OUTPUT:
value: 0
brief: Pin configured as output.
INPUT:
value: 1
brief: Pin configured as input.
map_name: ADS129x
# Add:
bits: 1 # == [1]
bits: 1-4 # == [1,2,3,4]
bits: [1, 4-10] # == [1,4,5,6,7,8,9,10]
# Remove:
bits:
lsb_position: 1
width: 3
access: [r, w]
Specify default access as:
access: r
at register level (currently only specified at field level)
fields can override it
add nex register_field_templates feature, to quickly reproduce register fields. structure can be similar to already existing register_block_template:
register_field_templates:
EXAMPLE_FIELD_n:
bit_size: 3
enum:
SOMETHING:
...
SOMETHINGELSE:
...
Move from stdout piping to actual output file specification
Allow for "usercode" sections in generated file, if file exists, extract before re-gen.
Something to the effect of:
#define MYCOOLCHIP_MAPUNPACK_A(_map_) MYCOOLCHIP_UNPACK_A((_map_)[MYCOOLCHIP_REG_A])
This would have to be generated for every physical register instance, unlike the UNPACK macros, which are generated for every register layout.
Would reduce clutter for the common 'Grab from map and modify' workflow:
struct mycoolchip_reg_a reg_a = MYCOOLCHIP_UNPACK_A(regs[MYCOOLCHIP_REG_A]);
// vs:
struct mycoolchip_reg_a reg_a = MYCOOLCHIP_MAPUNPACK_A(regs);
Pros:
Cons:
Be consistent.
It would fit the use case of Reginald to be able to output Latex compatible code to display register fields.
The package Registers (documentation) seems to be the perfect candidate for this.
generate(cls, map: RegisterMap, cli: CLI)
uses map as input variable, however this is a standard function in python.
https://palletsprojects.com/p/jinja/
Avoid adding any YAML overhead, instead do generation & parameterization with a purpose-built tool.
Parse pydantic error msgs? Inject custom msgs into pydantic?
Ditch pydantic and write custom parser?
Allow for output name instead of output path ( Requires move to single file output. )
Setup some way for generators to spec their arguments, and allow all generator args (if not all args?) to be specified by a YAML file. This should likely include a way to generate a "default" YAML file to help with getting setup.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.