Giter Site home page Giter Site logo

reginald's Introduction

Reginald

Philipp Schilk 2022-2023

reginald's People

Contributors

schilkp avatar

Stargazers

Christoph Leitner avatar Andrea Ronco avatar  avatar  avatar

Watchers

 avatar Christoph Leitner avatar

Forkers

villanif

reginald's Issues

Documentation Model

Read the docs? MDBook? Integrate with GitHub pages?

Requires:

  • overview
  • quick start
  • YAML map spec
  • Per generator documentation
    • macromap
    • funcpack
    • MD docs
    • MD regdump
  • Developing a generator documentation
  • Driver template?

Do yourself a favour and lock everything else down a bit first.

Rework internal Datamodel

"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, ...} 

Initial Draft re-design [The Fede Edition]

  1. Split input and data model

  2. 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"
  1. Move from set width to per-register with default:
default_register_bitwidth: 8

...
registers:
  REGA:
    bitwidth: 8 # Override
  1. Enum:
    Refactor 'enums' to allow for brief+doc, and make syntax identical to field enum:
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.
  1. Device Name -> Map name
map_name: ADS129x
  1. Field bit definitions:
# 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
  1. Access:
    access: [r, w]

Add register_field_templates

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:
        ...

Change file interaction

Move from stdout piping to actual output file specification

Allow for "usercode" sections in generated file, if file exists, extract before re-gen.

c.funcpack: Add a "Unpack from map / by index" mechanism

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:

  • Reduces clutter/copy+paste/chance of forgetting to update index on snippet copy.

Cons:

  • More crazy macro-magic.... Less explicit about what it actually does.
  • Not every drive uses a map, likely should be gated?

c.funcpack improvements

  • Improve regstruct doxygen comment:
    • Always gen a comment
    • Brief should always be present. Either auto-gen or prefix for actual brief?
    • Mention + link packing & unpacking funcs + generics?

Better error messages

Parse pydantic error msgs? Inject custom msgs into pydantic?
Ditch pydantic and write custom parser?

Better config model + cmd arg model

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.