Giter Club home page Giter Club logo

Comments (10)

kasbah avatar kasbah commented on June 23, 2024 1

I have started working on this as nturley/netlistsvg#6.

from pycircuit.

dvc94ch avatar dvc94ch commented on June 23, 2024

We don't need a python implementation. We can export json and modify netlistsvg to render it inside the viewer. We can probably add a export to svg or png feature inside the viewer. Or something along those lines. Thank you for the link!

I'm not set on any single programming language, python / node and probably at some point rust for performance critical parts - this is a playground so we can use whatever gives the quickest results, and there is something generally useful it can be moved to it's own repo later.

from pycircuit.

kasbah avatar kasbah commented on June 23, 2024

Yes, looking over it, outputting the subset of the Yosys netlist that Netlistsvg supports and adding some SVG "skins" for analog components could be a good way to go for a proof of concept. What do you mean by "the viewer" though?

An interactive viewer that lets you "zoom" into sub-circuits would be really cool. Worth noting from the Netlistsvg readme:

Yosysjs and klayjs are both capable of handling sub circuits and subgraphs. It might be interesting to see what kind of images I can produce from a hierarchal design.

from pycircuit.

dvc94ch avatar dvc94ch commented on June 23, 2024

What do you mean by "the viewer" though

There is kind of a prototype in the viewer subfolder. You can start it with node viewer/app.js net.svg pcb.svg it's not very user friendly yet... pcb.svg doesn't have any styling built in it's in viewer/css/pcb.svg.css, the net highlighting is currently broken...

from pycircuit.

kasbah avatar kasbah commented on June 23, 2024

Ah, completely missed that. Very cool! The style of the Graphviz output makes more sense now.

from pycircuit.

dvc94ch avatar dvc94ch commented on June 23, 2024

Started work on this, like the results so far. this depends on #4, since port directions need to be specified and checked for consistency. This also allows removing the component labels, since they are no longer needed, new Inst('R', '10K') and SubInst(joule_thief()).

from pycircuit.

dvc94ch avatar dvc94ch commented on June 23, 2024

Still pretty awful, using netlistsvg master. Correctly and consistently setting input and output information should make them look much better.

Power to signal or power to power nets should use vertical components, while signal to signal nets should use horizontal components. (analysis mostly implemented)

Port swapping and better skins should also make it look much better.

The generic component should allow connecting nets at the top and bottom too so that power flows from top to bottom and signal flows from left to right.

screenshot from 2018-01-08 21-52-09
screenshot from 2018-01-08 21-52-16
screenshot from 2018-01-08 21-52-23

from pycircuit.

kasbah avatar kasbah commented on June 23, 2024

You should add these examples to netlistsvg and open issues for features you mentioned that haven't been opened yet.

from pycircuit.

nturley avatar nturley commented on June 23, 2024

Hi, @dvc94ch . You raise some good points.

Port swapping and better skins should also make it look much better.

Port swapping is definitely a problem. I'm still trying to figure out the rules for when to port swap. Better skins meaning more components?

Power to signal or power to power nets should use vertical components, while signal to signal nets should use horizontal components

Right now I've been using a vertical flow for the analog skin, which does a bad job with horizontal ports so I've been just trying to use as many vertical components as possible, but presumably a typical circuit has more signal nets than power/gnd nets so maybe we should switch to a horizontal flow. Now that I have the lateral edge thing figured out, I might be able to make it look good. I'll try some experiments and see how it looks.

The generic component should allow connecting nets at the top and bottom too

A simple fix would be to add some special info in the netlist for generic components, but I just tagged all the lateral ports in the skin, so maybe I should just start tagging all of the port directions in the netlist and use that to determine which ports are lateral.

Example 1:

untitled
Laterals branch fixed this problem. It just merged to master. Wires to horizontal ports were always messy until that merged.


untitled
This needs a port swap. The resistor is connected from a southward port to a lateral port so we should be able to determine the optimal direction. The fact that the southward port is VCC should be an even bigger hint about the correct resistor orientation.


untitled
Laterals branch does a better job with this one as well.

Example 2:

untitled

Laterals branch fixed this


untitled

Turn off LONGEST_PATH. I think I turned it back off on master. I still think that NETWORK_SIMPLEX is better for analog.

Example 3:

untitled
port swap, port swap, port swap.

So I think the issues for these layouts

  • Port swap specific components (Especially when they are connected to VCC or GND) nturley/netlistsvg#17
  • See if we can get a better layout with a horizontal flow nturley/netlistsvg#31
  • Add more components in the skin (I don't think we need an issue for this because this will never be complete)
  • Generics should have a way to get vertical ports nturley/netlistsvg#30

from pycircuit.

dvc94ch avatar dvc94ch commented on June 23, 2024

Progress so far:
Things that can still be done from the pycircuit side are the following:

  • custom logic for port swapping transformer - needs to add dots to symbol to show current flow (joule_thief)
  • improve finding circuit paths on signal nets (sallen key without psu example can't determine that the resistor needs port swapping)
  • improve finding circuit paths for circuits without external ports (sallen key with psu connected)

screenshot from 2018-01-10 17-30-25
screenshot from 2018-01-10 17-30-30
screenshot from 2018-01-10 17-30-43
screenshot from 2018-01-10 17-30-54
screenshot from 2018-01-10 17-31-03
screenshot from 2018-01-10 17-31-17

from pycircuit.

Related Issues (20)

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.