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

Add support for Print in simulation #432

Closed
whitequark opened this issue Jul 13, 2020 · 7 comments
Closed

Add support for Print in simulation #432

whitequark opened this issue Jul 13, 2020 · 7 comments

Comments

@whitequark
Copy link
Member

A Display feature, similar to Verilog $display, has been requested a few times. We would depend on Yosys to implement it, which in fact is strongly in favor of having it.

Related to #427.

@whitequark whitequark changed the title Add support for Display Add support for Display in simulation Jul 13, 2020
@whitequark whitequark added this to the 0.3 milestone Oct 12, 2020
@BracketMaster
Copy link

Why would yosys need to support the display cell?
Is the thought that there would be an
m.d.comb += Display(f’foo {bar}’}?

And that yosys right now doesnt accept verilog with
Display?

I don’t imagine that yosys has anything useful it could
do with Display except in the case of CXXrtl, so perhaps
Yosys would mostly ignore Display?

@whitequark
Copy link
Member Author

Is the thought that there would be an m.d.comb += Display(f’foo {bar}’}?

Yes.

I don’t imagine that yosys has anything useful it could do with Display

It should read and write Verilog with $display statements. Some reasons why that's necessary are:

  • LiteX integrates with nMigen through Verilog;
  • Using nMigen with iverilog or Verilator.

@RobertBaruch
Copy link
Contributor

I'm assuming we wouldn't use f-strings because that evaluates the expressions before passing control to the called function. Something more like m.d.comb += Display(s, *args, **kwargs) which does the equivalent of s.format(args, kwargs) except in $display language?

Also, is there an RTLIL equivalent?

@whitequark
Copy link
Member Author

Something more like m.d.comb += Display(s, *args, **kwargs) which does the equivalent of s.format(args, kwargs) except in $display language?

Yep.

Also, is there an RTLIL equivalent?

Not yet, but I'm working on it, like, right now.

@RobertBaruch
Copy link
Contributor

Not yet, but I'm working on it, like, right now.

I kinda figured because now I recall the big meows about $display last week on Twitter :D

@whitequark whitequark modified the milestones: 0.3, 0.4 Dec 14, 2021
@whitequark whitequark removed this from the 0.4 milestone Feb 3, 2023
@ghost
Copy link

ghost commented Aug 22, 2023

FWIW I have some WIP here that I'm planning to turn into something neat and PR-able in the coming days.

@ghost ghost mentioned this issue Aug 22, 2023
4 tasks
@whitequark whitequark added this to the 0.5 milestone Feb 1, 2024
@whitequark whitequark changed the title Add support for Display in simulation Add support for Print in simulation Feb 1, 2024
@whitequark
Copy link
Member Author

Support for this feature has been accepted via RFC 50 and implementation is tracked in issue #1186.

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

Successfully merging a pull request may close this issue.

3 participants