You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I understand, this effectively adds a register, but without the need to explicitly declare variables, expand processes, etc. So this register breaks the logic loop.
As I also understand, the only case where the mem[mem[r]] construct would be absolutely necessary is if you had a dual read port asynchronous memory where the data of the first port is chained to the address of the second port. In all other cases, there is at least one cycle between reads, and so the $past trick will work (although it might get messy with intervening writes..?).
Can you please explain the nature of this limitation? Is this a real logic loop according to Verilog semantics or is this an artifact of the way Yosys lowers Verilog features? Is my workaround 'correct'?
What would I have to do if I had the dual read port asynchronous memory as described above and wanted to verify it? Yes, probably not a very good idea, but I think it is synthesizable with LUTRAM and enough duplication, so this can in principle be encountered in a real world design.
The text was updated successfully, but these errors were encountered:
Running the memory command to explode the RAM to registers and logic removes the logic loop error, but will increase the cost of verification for larger designs.
It would seem like a possible solution would be splitting the single $mem cell with two read ports to two $mem cells each with one read port. But I don't think this exists as a Yosys command at the moment.
I am writing a formal specification for a CPU instruction that performs double indirection. I.e. it does
reg = mem[mem[op]];
I am trying to write an assertion like this:
This fails, indicating a logic loop. I have worked around this by rewriting it as:
As I understand, this effectively adds a register, but without the need to explicitly declare variables, expand processes, etc. So this register breaks the logic loop.
As I also understand, the only case where the
mem[mem[r]]
construct would be absolutely necessary is if you had a dual read port asynchronous memory where the data of the first port is chained to the address of the second port. In all other cases, there is at least one cycle between reads, and so the$past
trick will work (although it might get messy with intervening writes..?).Can you please explain the nature of this limitation? Is this a real logic loop according to Verilog semantics or is this an artifact of the way Yosys lowers Verilog features? Is my workaround 'correct'?
What would I have to do if I had the dual read port asynchronous memory as described above and wanted to verify it? Yes, probably not a very good idea, but I think it is synthesizable with LUTRAM and enough duplication, so this can in principle be encountered in a real world design.
The text was updated successfully, but these errors were encountered: