mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-22 13:53:40 +00:00
Added $lcu cell type
This commit is contained in:
parent
48b00dccea
commit
af0c8873bb
8 changed files with 142 additions and 76 deletions
|
@ -459,6 +459,29 @@ endmodule
|
|||
|
||||
// --------------------------------------------------------
|
||||
|
||||
module \$lcu (P, G, CI, CO);
|
||||
|
||||
parameter WIDTH = 1;
|
||||
|
||||
input [WIDTH-1:0] P, G;
|
||||
input CI;
|
||||
|
||||
output reg [WIDTH-1:0] CO;
|
||||
|
||||
integer i;
|
||||
always @* begin
|
||||
CO = 'bx;
|
||||
if (^{P, G, CI} !== 1'bx) begin
|
||||
CO[0] = G[0] || (P[0] && CI);
|
||||
for (i = 1; i < WIDTH; i = i+1)
|
||||
CO[i] = G[i] || (P[i] && CO[i-1]);
|
||||
end
|
||||
end
|
||||
|
||||
endmodule
|
||||
|
||||
// --------------------------------------------------------
|
||||
|
||||
module \$alu (A, B, CI, BI, X, Y, CO);
|
||||
|
||||
parameter A_SIGNED = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue