Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding color to the nextpnr (critical path) output? #1047

Open
TheZoq2 opened this issue Nov 25, 2022 · 0 comments
Open

Adding color to the nextpnr (critical path) output? #1047

TheZoq2 opened this issue Nov 25, 2022 · 0 comments

Comments

@TheZoq2
Copy link

TheZoq2 commented Nov 25, 2022

Seeing there is some interest colors in the nextpnr output https://mastodon.social/@lofty@chaos.social/109402807095687030 reminded me of an experiment I did a while back of highlighting the critical path reports:

image

In that screenshot it's done as an external regex but I would be interested in making the change properly inside nextpnr if there is interest from your side

Before writing the code however, I wanted to check what the options for implementing it is. I found https://github.com/YosysHQ/nextpnr/blob/master/common/kernel/timing.cc#L717 and associated functions which seems to be the place to make the change, but the question i'm having is how to do the color printing in a good way.

Doing it manually by printing ANSI escape codes (and whatever windows wants) would be doable, but kind of feels like something where I'd reach for a library, especially when you want to do things like turning off the colors if being piped somewhere. Would it be OK to add something like https://github.com/ikalnytskyi/termcolor into 3rdparty to do this?

I hope my tired rambling makes sense, to summarize, 1: would it be desirable to have colored critical path info? 2: What's the best way to do it? Manually, with a library, or something else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant