OBJS += techlibs/coolrunner2/synth_coolrunner2.o
OBJS += techlibs/coolrunner2/coolrunner2_sop.o
+$(eval $(call add_share_file,share/coolrunner2,techlibs/coolrunner2/cells_latch.v))
$(eval $(call add_share_file,share/coolrunner2,techlibs/coolrunner2/cells_sim.v))
$(eval $(call add_share_file,share/coolrunner2,techlibs/coolrunner2/xc2_dff.lib))
--- /dev/null
+module $_DLATCH_P_(input E, input D, output Q);
+ LDCP _TECHMAP_REPLACE_ (
+ .D(D),
+ .G(E),
+ .Q(Q),
+ .PRE(1'b0),
+ .CLR(1'b0)
+ );
+endmodule
+
+module $_DLATCH_N_(input E, input D, output Q);
+ LDCP_N _TECHMAP_REPLACE_ (
+ .D(D),
+ .G(E),
+ .Q(Q),
+ .PRE(1'b0),
+ .CLR(1'b0)
+ );
+endmodule
Q <= D;
end
endmodule
+
+module LDCP (G, PRE, CLR, D, Q);
+ parameter INIT = 0;
+
+ input G, PRE, CLR, D;
+ output reg Q;
+
+ initial begin
+ Q <= INIT;
+ end
+
+ always @* begin
+ if (CLR == 1)
+ Q <= 0;
+ else if (G == 1)
+ Q <= D;
+ else if (PRE == 1)
+ Q <= 1;
+ end
+endmodule
+
+module LDCP_N (G, PRE, CLR, D, Q);
+ parameter INIT = 0;
+
+ input G, PRE, CLR, D;
+ output reg Q;
+
+ initial begin
+ Q <= INIT;
+ end
+
+ always @* begin
+ if (CLR == 1)
+ Q <= 0;
+ else if (G == 0)
+ Q <= D;
+ else if (PRE == 1)
+ Q <= 1;
+ end
+endmodule
{
run("opt -fast -full");
run("techmap");
+ run("techmap -map +/coolrunner2/cells_latch.v");
run("dfflibmap -prepare -liberty +/coolrunner2/xc2_dff.lib");
}
run("dfflibmap -liberty +/coolrunner2/xc2_dff.lib");
run("dffinit -ff FDCP Q INIT");
run("dffinit -ff FDCP_N Q INIT");
+ run("dffinit -ff LDCP Q INIT");
+ run("dffinit -ff LDCP_N Q INIT");
run("iopadmap -bits -inpad IBUF O:I -outpad IOBUFE I:IO -inoutpad IOBUFE O:IO -toutpad IOBUFE E:I:IO -tinoutpad IOBUFE E:O:I:IO");
}