Ensuring flip flop behavior is captured by write_btor
#3730
-
Hi all! Thanks again for such a wonderful tool. I use For example, if we have this module in module example(input clk, input in, output out);
reg r;
always @(posedge clk) begin
r <= in;
end
assign out = r;
endmodule and we run the following command: We get the following output:
This model is correct in some sense; i.e., the input It turns out we can get the btor to capture this if we use
Great! This is a little more complicated, but line 12 is the key: it determines whether BUT: it seems like So here's my question. It seems like the core functionality that I'm getting from Update: I'm realizing now that Yosys already sees my |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
The btor2 format doesn't have clocks, IIRC - the model just has "current state" and "next state". So there's no way to describe a multiclock design other than what |
Beta Was this translation helpful? Give feedback.
I don't think it's reliably possible to reverse the transformation to
$ff
thatclk2fflogic
does to reconstitute the original clock signal, so it might not be the right approach in a synthesis context (although if you keep the pre-clk2fflogic design around, you might be able to use the conclusions of the solver on that). There's a similar issue withabc
, and there what we do is to separate each clock domain and pass them individually to abc to handle. For example here they are identified inabc
:yosys/passes/techmap/abc.cc
Lines 2006 to 2167 in a9c792d