mirror of
https://github.com/annoyatron255/yosys4gal.git
synced 2024-12-22 18:52:23 +00:00
Ensure OLMC/SOP invariant with tristate
This commit is contained in:
parent
5c5d325937
commit
f296c19383
|
@ -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
|
techmap -map techmaps/olmc_comb.v
|
||||||
|
|
||||||
# Add trivial SOPs between directly connected OLMCs
|
# 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
|
clean -purge
|
||||||
|
|
||||||
|
|
31
techmaps/trivial_1sop_olmc.v
Normal file
31
techmaps/trivial_1sop_olmc.v
Normal 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
|
|
@ -23,7 +23,7 @@ module _80_GAL_OLMC (C, E, A, Y);
|
||||||
.WIDTH(1),
|
.WIDTH(1),
|
||||||
.DEPTH(1),
|
.DEPTH(1),
|
||||||
.TABLE(2'b10)
|
.TABLE(2'b10)
|
||||||
) trivial_sop (
|
) trivial_sop_olmc (
|
||||||
.A(A),
|
.A(A),
|
||||||
.Y(int),
|
.Y(int),
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
module tristate (
|
module tristate (
|
||||||
input a, b, c,
|
input a, b, c, d,
|
||||||
output y
|
output x, y
|
||||||
);
|
);
|
||||||
|
|
||||||
|
assign x = !d;
|
||||||
assign y = c ? a && b : 1'bz;
|
assign y = c ? a && b : 1'bz;
|
||||||
|
|
||||||
endmodule
|
endmodule
|
||||||
|
|
|
@ -6,4 +6,3 @@ set_io counter[3] 15
|
||||||
set_io counter[4] 16
|
set_io counter[4] 16
|
||||||
set_io counter[5] 17
|
set_io counter[5] 17
|
||||||
set_io counter[6] 18
|
set_io counter[6] 18
|
||||||
set_io counter[7] 19
|
|
||||||
|
|
Loading…
Reference in a new issue