mirror of https://github.com/YosysHQ/yosys.git
dfflibmap: add regression test for resetval clobber
This commit is contained in:
parent
332ea782eb
commit
eb96123030
|
|
@ -0,0 +1,52 @@
|
|||
library(test) {
|
||||
cell (bad_dff) {
|
||||
area : 1;
|
||||
ff("IQ", "IQN") {
|
||||
next_state : "!D"; // Look here
|
||||
clocked_on : "CLK";
|
||||
preset : "!RST"; // Look here
|
||||
}
|
||||
pin(D) {
|
||||
direction : input;
|
||||
}
|
||||
pin(CLK) {
|
||||
direction : input;
|
||||
}
|
||||
pin(RST) {
|
||||
direction : input;
|
||||
}
|
||||
pin(Q) {
|
||||
direction: output;
|
||||
function : "IQ";
|
||||
}
|
||||
pin(QN) {
|
||||
direction: output;
|
||||
function : "IQN";
|
||||
}
|
||||
}
|
||||
cell (good_dff) {
|
||||
area : 1;
|
||||
ff("IQ", "IQN") {
|
||||
next_state : "D"; // Look here
|
||||
clocked_on : "CLK";
|
||||
clear : "RST"; // Look here
|
||||
}
|
||||
pin(D) {
|
||||
direction : input;
|
||||
}
|
||||
pin(CLK) {
|
||||
direction : input;
|
||||
}
|
||||
pin(RST) {
|
||||
direction : input;
|
||||
}
|
||||
pin(Q) {
|
||||
direction: output;
|
||||
function : "IQ";
|
||||
}
|
||||
pin(QN) {
|
||||
direction: output;
|
||||
function : "IQN";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
read_verilog -icells <<EOT
|
||||
module top(input C, D, R, output Q);
|
||||
$_DFF_PP0_ ff (.C(C), .D(D), .R(R), .Q(Q));
|
||||
endmodule
|
||||
EOT
|
||||
|
||||
dfflibmap -liberty dfflibmap_resetval_clobber.lib top
|
||||
read_liberty dfflibmap_resetval_clobber.lib
|
||||
flatten -noscopeinfo
|
||||
opt_clean
|
||||
|
||||
select -assert-count 1 t:* top %i
|
||||
select -assert-count 1 t:$_DFF_PP0_ top %i
|
||||
Loading…
Reference in New Issue