3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-10-05 15:34:02 +00:00

coolrunner2: Also construct the XOR cell in the macrocell

This commit is contained in:
Robert Ou 2017-06-25 02:20:42 -07:00
parent a64b56648d
commit 908ce3fdce
2 changed files with 34 additions and 7 deletions

View file

@ -41,3 +41,17 @@ module ORTERM(IN, OUT);
end
end
endmodule
module MACROCELL_XOR(IN_PTC, IN_ORTERM, OUT);
parameter INVERT_PTC = 0;
parameter INVERT_OUT = 0;
input IN_PTC;
input IN_ORTERM;
output wire OUT;
wire xor_intermed;
assign OUT = INVERT_OUT ? ~xor_intermed : xor_intermed;
assign xor_intermed = INVERT_PTC ? IN_ORTERM ^ ~IN_PTC : IN_ORTERM ^ IN_PTC;
endmodule