GithubHelp home page GithubHelp logo

faebryk's Introduction

faebryk

[fˈɛbɹɪk]


Open-source software-defined EDA tool

Version License: MIT Pull requests open Issues open Discord PyPI - Downloads GitHub commit activity

Code style: black

In short faebryk is a python library that allows you to design ready-to-order electronics (PCBs, schematics, etc) in code. It aims to reduce the entry-barrier for hardware design by bridging the gap between software and hardware design.


Using faebryk

> pip install faebryk
import faebryk.library._F as F
from faebryk.core.core import Module
from faebryk.libs.experiments.buildutil import (
    tag_and_export_module_to_netlist
)

class App(Module): 
    def __init__(self) -> None:
        super().__init__()

        class _NODES(Module.NODES()):
            led = F.PoweredLED()
            battery = F.Battery()

        self.NODEs = _NODES(self)

        # Connections
        self.NODEs.led.IFs.power.connect(
            self.NODEs.battery.IFs.power)

        # Parametrize
        self.NODEs.led.NODEs.led.PARAMs.color.merge(
            F.LED.Color.YELLOW)
        self.NODEs.led.NODEs.led.PARAMs.brightness.merge(
            F.Range.lower_bound(30e-3))


tag_and_export_module_to_netlist(App())


About

What [is faebryk]

faebryk is an open-source software-defined electronic design automation (EDA) tool. Think of it like the evolution from EDA tools like KiCAD, Altium, Eagle... in the way those were the next step from designing electronic circuits on paper. The main idea of faebryk is to describe your product on the highest level possible and then iteratively refining the description to arrive on a complete and detailed implementation. In comparison to classic EDA and design tools which use GUIs, faebryk uses code (Python) to create designs. While the main focus is on the EDA part currently, faebryk aims to become a holistic system design tool.

How [does designing with faebryk work]

faebryk itself is just a python library that you include in your project. It is providing you with all the tools to describe and design your system and to export that design into something useful like for example a netlist, a devicetree, gerbers etc, which you then can use in the next steps of your project. Key concepts of faebryk are the graph, importers, exporters, the library and the user application. To understand how to use faebryk in your project see using faebryk.

Who [is faebryk]

faebryk is a community driven project. That means faebryk does not only consist out of core developers but also users, external contributors, moderators and you! It is founded by a group of embedded, electrical, product design and software engineers with a love for making.

Why [do we make faebryk]

We noticed that the innovations of software engineering that make fast, scalable, robust solutions possible have not found their way into hardware design. Furthermore there is a lot of duplicate work done. Think of determining the pinout of a SoC and then having to translate that exact pinout into software again or having to constantly adapt designs for supply chain issues. Additionally, hardware design has quite a big barrier of entry for makers, but we don't think it has to. Currently hardware design is also quite labor intensive with very little automation. faebryk aims to tackle all those issues and also opens up some exciting possibilities, such as benefiting from the version management and collaboration tools that are used in modern software development.

When [is faebryk being developed]

faebryk is being continuously developed. The core team focuses on core functionality and features of faebryk, as well as the general direction of the project. The strength of the community can really shine with the development of importers, exporters, libraries, and projects, but everyone is welcome to help out where they can.

Where [do we develop faebryk]

faebryk is being developed completely in the open on Github. All the information you need to start using and contributing to faebryk will be in or linked to from this repository. If you have any questions you can ask them on our Discord. For pull requests and bug-reports, see our contributing guidelines.


Development

Installing from source

Setup

> git clone https://github.com/faebryk/faebryk.git
> cd faebryk
>
> poetry install

Running examples

> poetry shell
> python ./examples/<sample_name>.py

Versioning

faebryk uses semantic versioning in the releases.

As feabryk is still in the early stages of development new releases will have a lot of (breaking) changes in them. Our roadmap(TODO) will show you where the project is going to and what you can expect in future releases.

Contributing

See CONTRIBUTING.md

To get inspiration on things to work on check out the issues.

Running your own experiments/Making samples

First follow the steps in get running from source. Then add a file in examples/ (you can use one of the examples as template). Call your file with python3 examples/<yourfile>.py.

Running tests

Run

> pytest test

Community Support

Community support is provided via Discord; see the Resources below for details.

Resources

faebryk's People

Contributors

erikkallen avatar ioannisp-iteng avatar nor8quoh1r avatar ruben-iteng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

faebryk's Issues

[Bug]: README.md: Discord link is expired

Contact Details

No response

Current Behaviour

Discord invite link expired in the README.md

Expected Behaviour

Link should work

Possible Solution

Use this link in the README.md

https://discord.gg/95jYuPmnUW

Version

0.0.1

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Library: Rethink _from

Feature Request

The _from traits are quite niche application and a lot of work to implement. They also require some ugly hacks.
Maybe we should reconsider their existence.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Make sure we are using logger everywhere

Contact Details

No response

Feature Request

Currently print() is used extensively.
We should use the logger everywhere, to make using & debugging easier.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Add RP2040

Feature Request

Add the Raspberry Pi RP2040 microcontroller.
The goal is to implement all the information from the datasheet into faebryk to see what features need to be added to faebryk.

Progress here

Implementation should happen in the following steps (from outside to inside functionality of the microcontroller):

  • Package
    • IO
      • Power supplies
      • Crystal
      • SWD
      • QSPI
      • USB
      • GPIO
    • Hardware peripherals
      • GPIO PinMux
      • Pin map
      • UART
      • I2C
      • SPI
      • PWM
      • ADC
      • (Timer, Watchdog, RTC, SSI)
    • PIO
      • PIO0
      • PIO1
  • Clock generation
  • Bus
  • Memory
  • DMA
  • Processors
  • ...

This figure from the datasheet clearly shows the different levels we can implement:
image

Code of Conduct

  • I agree to follow this project's Code of Conduct

Export netlist graph to image

Feature Request

Add a method to export the netlist graph to an image instead of plotting it on the screen.

Code of Conduct

  • I agree to follow this project's Code of Conduct

v1.0.0

Contact Details

No response

Feature Request

Release 1.0.0 TODOs

  • #41
  • examples
    • clean up
    • #64
    • fix example.py
    • fix tests
  • make release
    • #29
    • make github release/tag
    • bump version in version.py
    • bump version in setup.cfg
  • add licence to files
  • test on clean venv
  • #34
  • #16
  • #66

Code of Conduct

  • I agree to follow this project's Code of Conduct

[Meta]: Adjust titles of old issues

Contact Details

No response

Feature Request

Since we are using now the issue template, we can update the old issues to be consistent.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Library: Make TI_CD4011BE trait from_component for cd4011

Feature Request

See iterative_design_nand #packaging block.
We should be able to make components less abstract.
That one's a good example for that.

(Also adjust the sample then).

Code of Conduct

  • I agree to follow this project's Code of Conduct

Explore ui possibilities

Feature Request

We might want to build a proper ui for things like exploring the graph or debugging.

These look like useful tools:

Text UI

UI

Graph

Other

Code of Conduct

  • I agree to follow this project's Code of Conduct

Improve imports

Feature Request

I have the feeling that the way we do imports is not the right way in python.
Have a look at that.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Composited components

Contact Details

No response

Feature Request

Currently making composited components is awkward.
See CD4011.
Issues:

  • needs to be extracted before putting in graph
  • no checks for double use
  • ...

Maybe adding a is_composited" trait can help.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Make inheriting _from methods possible

Contact Details

No response

Feature Request

Take a look at CD4011 and TI_CD4011BE.
By inheriting from CD4011 it loses its from_nands method.
That should be possible to improve.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Add documentation to top of files

Contact Details

No response

Feature Request

I feel like having docs in the top of the file, describing

  • what it does
  • who it concerns
  • how to read it
  • how to change it
    would be a very handy addition to make contributing to and using faebryk easier.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Add explanation to current samples

Contact Details

No response

Feature Request

Add comments to existing samples, explaining their purpose.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Implement Links

Contact Details

No response

Feature Request

Links are currently missing.
They are basically implicit at the moment with no extra info.

For now good, because it will add extra complexity.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Add more labels to readme

Feature Request

Like Discord, and PyPi downloads

Code of Conduct

  • I agree to follow this project's Code of Conduct

Add linter

Contact Details

No response

Feature Request

Currently no checks/help.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Typo in templates and contact info useless

Contact Details

No response

Current Behaviour

There are some typos in the issue & PR templates + the contact info is useless.

Expected Behaviour

Possible Solution

#51

Version

0.0.1

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Improve interface->component links

Contact Details

No response

Feature Request

Currently we need to explicitly add this relationship which is quite error prone.
We need a way to add this relationship more elegantly while keeping the possibility of interfaces to be free from components.

Example of how it looks currently: samples/resistors_and_nand.py#22:

  # power
  battery = Component()
  battery.power = Power()
  battery.add_trait(has_defined_interfaces([battery.power]))
  battery.power.set_component(battery)

Code of Conduct

  • I agree to follow this project's Code of Conduct

Improve backlinks in traits

Contact Details

No response

Feature Request

Currently traits have no implicit reference to the object they are added to. This is quite unhandy because it forces each trait to explicitly define a constructor that takes the obj.

There should be a good way to improve this, so all traits automatically hold a reference to their object.

Code of Conduct

  • I agree to follow this project's Code of Conduct

KeyError in nx.draw_networkx_labels() function

Contact Details

No response

Current Behaviour

A KeyError occurred at line 974 in \networkx\drawing\nx_pylab.py when running samples/vindriktning.py in my fork

Expected Behaviour

The program exited without errors and a graph image.

Possible Solution

No response

Version

0.0.1

Relevant log output

File "C:\Users\xxxx\AppData\Roaming\Python\Python310\site-packages\networkx\drawing\nx_pylab.py", line 974, in draw_networkx_labels
    (x, y) = pos[n]
KeyError: <class 'faebryk.exporters.netlist.netlist.vertex'>({'node': 'COMP[Component:virt]@79B33342', 'pin': 1})

Code of Conduct

  • I agree to follow this project's Code of Conduct

To prefix, or not to prefix PR titles

Contact Details

No response

Feature Request

Should we put a prefix in front of pull request titles or only use tags?

Code of Conduct

  • I agree to follow this project's Code of Conduct

Core: Broken trait system

Current Behaviour

Traits are being checked against parents/children but not siblings/nephews

Expected Behaviour

Add a sibling trait results in the original trait being replaced in the object.

Possible Solution

Seperate traits from trait implementations.

Version

519890d

Relevant log output

➜  faebryk git:(feature/add_core_trait_tests) ✗ python test/test.py                             
....F.
======================================================================
FAIL: test_equality (test.library.test_core.TestTraits)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/.../faebryk/faebryk/test/library/test_core.py", line 79, in test_equality
    assertEqualSym(trait1_2(), trait1_1)
  File "/.../faebryk/faebryk/test/library/test_core.py", line 46, in assertEqualSym
    self.assertEqual(one, two)
AssertionError: <test.library.test_core.TestTraits.test_eq[45 chars]4040> != <class 'test.library.test_core.TestTraits.[28 chars]1_1'>

----------------------------------------------------------------------
Ran 6 tests in 0.008s

FAILED (failures=1)

Code of Conduct

  • I agree to follow this project's Code of Conduct

Make pinmux example

Feature Request

Create an example of how pinmux & electrical interface properties should work.

We can use the ESP32 - page 62

Code of Conduct

  • I agree to follow this project's Code of Conduct

Make multi-board designs possible

Feature Request

Currently it is assumed that the whole graph turns into a netlist.
This is especially unhandy as soon as we start working with modules.
The modules themselves are similar to aggregate components, with the exception that their inner components have actual footprints.
Currently we are using footprints to differentiate between "virtual" and "real" components.
Which actually just represents if a component is present on the board/netlist.

The best way to solve this would be to remove the whole notion of virtual components.
To place components onto the netlist/board we can use a new type of link (solder/mech?) and a new component (pcb). Each component will get one of those new interfaces which then will implement the footprint trait that components currently implement.
To place a component onto a board you can then just use the method of the new interface.

This enables us further to make multi-board designs and greatly facilitates the use of "snippets".
A modules is just a snippet with a board that is already connected to all internal components.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Make coding guidelines

Contact Details

No response

Feature Request

Add coding guidelines

Code of Conduct

  • I agree to follow this project's Code of Conduct

Delete PR type in PR template

Current Behaviour

It is redundant, it's in the description + as a tag

Expected Behaviour

Tag only for PR type

Possible Solution

No response

Version

1.0.0

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Add github notifications to Discord

Contact Details

No response

Feature Request

Add github notifications to Discord

Code of Conduct

  • I agree to follow this project's Code of Conduct

Create branch protection rules

Contact Details

No response

Feature Request

You can create a branch protection rule to enforce certain workflows for one or more branches, such as requiring an approving review or passing status checks for all pull requests merged into the protected branch.

https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/managing-a-branch-protection-rule

Code of Conduct

  • I agree to follow this project's Code of Conduct

Add circuit diagram exporter

Feature Request

Add an exporter for human readable circuit diagrams.

Some interesting projects:

Code of Conduct

  • I agree to follow this project's Code of Conduct

Add pip install method in readme

Feature Request

Currently only from source installation explained.
Add from pip too (don't forget to tell how to copy the samples).

Code of Conduct

  • I agree to follow this project's Code of Conduct

Split library classes into different files

Contact Details

No response

Current Behaviour

The library is monolithic.

Expected Behaviour

The library should be separated for easier use, maintenance, and development.

Possible Solution

  • faebryk
    • core
      • traits
        • interface
        • component
        • footprint
        • parameters
        • link
      • 1st order classes
      • FaebrykLibObjects
      • parameters
    • meta / helpers (to core?)
    • interfaces
    • footprints
    • components (general e.g. "resistor")
    • parts (specific part nr e.g. STM32F072C8T)
    • packages (3D CAD)
  • external libs

Version

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Todo list

Contact Details

No response

Feature Request

To-Do:

  • core
    • experiment with improving trait system
  • library
  • Coding convention
    • compA.vcc.connect(compB.vcc) or CompB.vcc.connect(compA.vcc)
    • project setup & file structure
    • [WIP] code of conduct
    • [WIP] contribution guidelines
  • examples
    • #74
    • full stack project
      • show all implementented functions
    • MVP project
      • can be template to start a project from scratch
  • integration
    • kicad
      • library integration
        • wrapper for kicad symbols/footprints/etc
        • conversion scripts to from kicad libs
      • pcbnew integration
        • call pcbnew directly on netlist
        • potentially invoke autorouter
        • ...
  • graph
    • make graph more powerful by encapsulating more information into nodes and edges
      ~ [ ] constraint system
  • exporters
    • non netlist generators: Come up with & implement other byproducts of faebryk
    • #75
      next to a netlist
    • devicetree
    • netlist
      • EDIF
      • kicad
      • other EDA's
  • Error handling
  • Tooling
    • better graph visualization
  • Test Framework
    • Setup tests for library (maybe just use samples?)
  • meta
    • logo
    • reserve names
      • website
      • pip
      • ...
    • discord integrations
    • surveys

Code of Conduct

  • I agree to follow this project's Code of Conduct

Core: No error thrown when component is defined but not added to the component list

This will not throw a Faebryk error, but give a KeyError when rendering the netlist with matplotlib

gnd = VirtualComponent(...)
vcc= VirtualComponent(...)
resistor = SMD_Resistor(..)

resistor.connect(1, vcc)
resistor.connect(2, gnd)

comps = [gnd, resistor]
    netlist = from_faebryk_t2_netlist(
        make_t2_netlist_from_t1(
            make_t1_netlist_from_graph(comps)
        )
    )

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.