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

Creating signals named like verilog keywords produces invalid verilog #53

Closed
anuejn opened this issue Mar 31, 2019 · 3 comments
Closed

Comments

@anuejn
Copy link
Contributor

anuejn commented Mar 31, 2019

The following valid migen code...

from nmigen import *
from nmigen.cli import main


input = Signal()
output = Signal()

m = Module()
m.d.comb += output.eq(input)

main(m, ports=[input, output])

... produces the following invalid verilog (with python fail.py generate:

/* Generated by Yosys 0.8+143 (git sha1 c82aa49d, gcc 8.2.1 -march=x86-64 -mtune=generic -O2 -fno-plt -fPIC -Os) */

(* top =  1  *)
(* generator = "nMigen" *)
module top(output, input);
  (* src = "fail.py:6" *)
  reg \$next\output ;
  (* src = "fail.py:5" *)
  input input;
  (* src = "fail.py:6" *)
  output output;
  always @* begin
    \$next\output  = 1'h0;
    \$next\output  = input;
  end
  assign output = \$next\output ;
endmodule

I dont really know, whether this should be handled by yosys (since nMigen produces valid ir) or by nMigen itself.

@programmerjake
Copy link
Contributor

I would think this is a yosys bug.

@whitequark
Copy link
Contributor

You are using the Yosys commit just before I fixed that bug.

@anuejn
Copy link
Contributor Author

anuejn commented Apr 1, 2019

ah thanks for fixing :), works now 👍

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

No branches or pull requests

3 participants