Ensure OLMC/SOP invariant with tristate

This commit is contained in:
annoyatron255 2024-05-05 00:20:18 -05:00
parent 5c5d325937
commit f296c19383
No known key found for this signature in database
GPG key ID: 95283811BE4E93F8
5 changed files with 42 additions and 5 deletions

View file

@ -89,7 +89,13 @@ iopadmap -bits -outpad GAL_COMB_OUTPUT_P A:Y */t:GAL_SOP "%x:+\[Y\]" */t:GAL_SOP
techmap -map techmaps/olmc_comb.v
# Add trivial SOPs between directly connected OLMCs
techmap -max_iter 1 -map techmaps/trivial_sop_olmc.v */t:GAL_OLMC %ci1 */w:* %i */t:GAL_SOP %co1 */w:* %i %i %c %co1 %D */t:GAL_OLMC %D
techmap -max_iter 1 -map techmaps/trivial_sop_olmc.v */t:GAL_OLMC "%ci1:+\[A\]" */w:* %i */t:GAL_SOP %co1 */w:* %i %i %c %co1 %D */t:GAL_OLMC %D
# Add trivial SOPs between directly connected OLMCs and INPUTs
techmap -max_iter 1 -map techmaps/trivial_sop_olmc.v */t:GAL_OLMC "%ci1:+\[A\]" */w:* %i */t:GAL_INPUT %co1 */w:* %i %i %c %co1 %D
# Add trivial 1SOPs between directly connected OLMC enables and INPUTs
techmap -max_iter 1 -map techmaps/trivial_1sop_olmc.v */t:GAL_OLMC "%ci1:+\[E\]" */w:* %i */t:GAL_INPUT %co1 */w:* %i %i %c %co1 %D
clean -purge

View file

@ -0,0 +1,31 @@
(* techmap_celltype = "GAL_OLMC" *)
module _80_GAL_OLMC (C, E, A, Y);
parameter REGISTERED = 0;
parameter INVERTED = 0;
input C, E, A;
inout Y;
wire int;
generate
GAL_OLMC #(
.REGISTERED(REGISTERED),
.INVERTED(INVERTED)
) _TECHMAP_REPLACE_ (
.C(C),
.E(int),
.A(A),
.Y(Y)
);
GAL_1SOP #(
.WIDTH(1),
.DEPTH(1),
.TABLE(2'b10)
) trivial_1sop_olmc (
.A(E),
.Y(int),
);
endgenerate
endmodule

View file

@ -23,7 +23,7 @@ module _80_GAL_OLMC (C, E, A, Y);
.WIDTH(1),
.DEPTH(1),
.TABLE(2'b10)
) trivial_sop (
) trivial_sop_olmc (
.A(A),
.Y(int),
);

View file

@ -1,8 +1,9 @@
module tristate (
input a, b, c,
output y
input a, b, c, d,
output x, y
);
assign x = !d;
assign y = c ? a && b : 1'bz;
endmodule

View file

@ -6,4 +6,3 @@ set_io counter[3] 15
set_io counter[4] 16
set_io counter[5] 17
set_io counter[6] 18
set_io counter[7] 19