Coder Social home page Coder Social logo

Indicate bus width about netlistsvg HOT 15 CLOSED

nturley avatar nturley commented on May 18, 2024
Indicate bus width

from netlistsvg.

Comments (15)

nobodywasishere avatar nobodywasishere commented on May 18, 2024 2

I got double line thickness to indicate a bus working with this commit.

Before:

image

After (along with some other changes I made):

image1

I've also started looking into indicating the bus width with an edge label but so far it's proved unsuccessful. ElkJS seems to make space for the labels but doesn't actually place them for some reason.

from netlistsvg.

mithro avatar mithro commented on May 18, 2024 1

I would love to see this integrated into netlistsvg and demos in https://github.com/SymbiFlow/sphinxcontrib-hdl-diagrams

from netlistsvg.

nturley avatar nturley commented on May 18, 2024

ELK supports edge labels, but it's going to really clutter up the schematic if we have every single edge labeled. So I think the only tricky part about this is deciding which edges to add labels to.

Yosys also provides net names, so in theory we could also consider putting the netnames as an edge label.

from netlistsvg.

kasbah avatar kasbah commented on May 18, 2024

I could have sworn there was some universal convention in digital logic schematics to indicate bus widths with some slanted edges. Something like this:

But maybe dotted or squiggly somehow? I can't find any examples. Do you know what I am thinking of? This would have to be done with a graph node.

from netlistsvg.

kasbah avatar kasbah commented on May 18, 2024

I guess the convention is just a single slanted line and a number next to it.

image

from: https://tex.stackexchange.com/questions/125460/drawing-bus-width-like-markers-with-number-on-arrows

from netlistsvg.

nturley avatar nturley commented on May 18, 2024

finding the coordinates of the slanty line also makes this a little tricky.

from netlistsvg.

rjordans avatar rjordans commented on May 18, 2024

Would it be an option to draw buses in another color / thickness to distinguish them from individual lines? I agree that adding labels or width may clutter the figure indeed

from netlistsvg.

rjordans avatar rjordans commented on May 18, 2024

Another option may be to add the slanted line with number as one of the nodes on the line for ELK to place for you? That should help in keeping things clean

from netlistsvg.

nturley avatar nturley commented on May 18, 2024

I like that solution. It would add more columns but I think that is fine.

from netlistsvg.

stevenbell avatar stevenbell commented on May 18, 2024

This would be really helpful to me. Even just using a bold line to indicate a bus versus a single wire would be a big help.

I'm happy to submit a PR if you can point me in the right direction to get started.

from netlistsvg.

nturley avatar nturley commented on May 18, 2024

Looks great. Well done.

from netlistsvg.

rjordans avatar rjordans commented on May 18, 2024

that's looking nice already!

from netlistsvg.

nobodywasishere avatar nobodywasishere commented on May 18, 2024

Alright I've worked on this a bit more and figured out why labels weren't showing up - they weren't being drawn. I've added that but it seems like some labels are inline and others aren't (i think the ones with junction points are inline). Maybe there's a function that's centering all the elements of an edge when there's a junction (?). Setting 'org.eclipse.elk.edgeLabels.inline' false in each label layoutOptions doesn't seem to do anything.

Ideally the labels would be closer to the source, but setting 'org.eclipse.elk.core.options.EdgeLabelPlacement': 'HEAD' doesn't seem to do anything either. Ideally the design would also be less expanded (closer to how it was before).

Either way I've been able to manually offset it so it looks okay (but may have a line going over the label). Also, adding the labels does change layout, just an FYI.

Without manual offset (same json as above):

Screenshot_2021-03-19_13-24-33

With manual offset:

Screenshot_2021-03-19_13-24-59

All code is on this edgeLabels branch if anyone else wants to take a look at it. Any feedback welcome.

from netlistsvg.

nobodywasishere avatar nobodywasishere commented on May 18, 2024

I'm also on the netlistsvg Gitter if anyone wants to talk about this there.

from netlistsvg.

mithro avatar mithro commented on May 18, 2024

This is super cool!

from netlistsvg.

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.