We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Consider this minimal example:
from migen import * from migen.fhdl import verilog class my_module(Module): def __init__(self): self.input = Signal(8) self.output = Signal(32) self.comb += self.output.eq(Cat(self.input, self.input+1, self.input+2, self.input+3)) def tb(dut): yield dut.input.eq(0) print(f'{(yield dut.output):#010x}') m = my_module() run_simulation(m, tb(m)) # print(verilog.convert(m))
Expected output: 0x03020100 Produced output: 0x0c040100, i.e. self.input+1 takes 9 bits, the next one takes 10 bits etc.
0x03020100
0x0c040100
self.input+1
Yet, the generated Verilog code is correct and produces expected results when simulated by Vivado simulator: assign output_1 = {(input_1 + 2'd3), (input_1 + 2'd2), (input_1 + 1'd1), input_1};
assign output_1 = {(input_1 + 2'd3), (input_1 + 2'd2), (input_1 + 1'd1), input_1};
The text was updated successfully, but these errors were encountered:
It's the generated Verilog that's incorrect - self.input+x are supposed to be 9-bit numbers.
self.input+x
Sorry, something went wrong.
the next one takes 10 bits
It doesn't.
Yes after thinking about it I admit that my expectations were wrong, the way migen behaves makes sense. Still, the mismatch with Verilog is there...
No branches or pull requests
Consider this minimal example:
Expected output:
0x03020100
Produced output:
0x0c040100
, i.e.self.input+1
takes 9 bits, the next one takes 10 bits etc.Yet, the generated Verilog code is correct and produces expected results when simulated by Vivado simulator:
assign output_1 = {(input_1 + 2'd3), (input_1 + 2'd2), (input_1 + 1'd1), input_1};
The text was updated successfully, but these errors were encountered: