-
Notifications
You must be signed in to change notification settings - Fork 888
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
556 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
*.log | ||
test.ys | ||
*.filtered | ||
*.verilogsim |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
library(ls05_stdcells) { | ||
cell(XNOR2X1) { | ||
area : 206080.0 ; | ||
pin(B) { | ||
direction : input ; | ||
} | ||
pin(A) { | ||
direction : input ; | ||
} | ||
pin(Y) { | ||
direction : output ; | ||
function : !(B&!A|!B&A) ; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module XNOR2X1 (B, A, Y); | ||
input B; | ||
input A; | ||
output Y; | ||
assign Y = !(B&!A|!B&A); // !(B&!A|!B&A) | ||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
library(supergate) { | ||
cell(SRAM) { | ||
area : 1 ; | ||
pin(CE1) { | ||
direction : input ; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module SRAM (CE1); | ||
input CE1; | ||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
library(fake) { | ||
cell(bugbad) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module bugbad (); | ||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,211 @@ | ||
library(supergate) { | ||
cell(inv) { | ||
area : 1 ; | ||
pin(A) { | ||
direction : input ; | ||
} | ||
pin(Y) { | ||
direction : output ; | ||
function : A' ; | ||
} | ||
} | ||
cell(tri_inv) { | ||
area : 4 ; | ||
pin(A) { | ||
direction : input ; | ||
} | ||
pin(S) { | ||
direction : input ; | ||
} | ||
pin(Z) { | ||
direction : output ; | ||
function : A' ; | ||
} | ||
} | ||
cell(buffer) { | ||
area : 5 ; | ||
pin(A) { | ||
direction : input ; | ||
} | ||
pin(Y) { | ||
direction : output ; | ||
function : A ; | ||
} | ||
} | ||
cell(nand2) { | ||
area : 3 ; | ||
pin(A) { | ||
direction : input ; | ||
} | ||
pin(B) { | ||
direction : input ; | ||
} | ||
pin(Y) { | ||
direction : output ; | ||
function : (A * B)' ; | ||
} | ||
} | ||
cell(nor2) { | ||
area : 3 ; | ||
pin(A) { | ||
direction : input ; | ||
} | ||
pin(B) { | ||
direction : input ; | ||
} | ||
pin(Y) { | ||
direction : output ; | ||
function : (A + B)' ; | ||
} | ||
} | ||
cell(xor2) { | ||
area : 6 ; | ||
pin(A) { | ||
direction : input ; | ||
} | ||
pin(B) { | ||
direction : input ; | ||
} | ||
pin(Y) { | ||
direction : output ; | ||
function : (A *B') + (A' * B) ; | ||
} | ||
} | ||
cell(imux2) { | ||
area : 5 ; | ||
pin(A) { | ||
direction : input ; | ||
} | ||
pin(B) { | ||
direction : input ; | ||
} | ||
pin(S) { | ||
direction : input ; | ||
} | ||
pin(Y) { | ||
direction : output ; | ||
function : ( (A * S) + (B * S') )' ; | ||
} | ||
} | ||
cell(dff) { | ||
area : 6 ; | ||
ff(IQ, IQN) { | ||
next_state : D ; | ||
clocked_on : CLK ; | ||
clear : RESET ; | ||
preset : PRESET ; | ||
clear_preset_var1 : L ; | ||
clear_preset_var2 : L ; | ||
} | ||
pin(D) { | ||
direction : input ; | ||
} | ||
pin(CLK) { | ||
direction : input ; | ||
} | ||
pin(RESET) { | ||
direction : input ; | ||
} | ||
pin(PRESET) { | ||
direction : input ; | ||
} | ||
pin(Q) { | ||
direction : output ; | ||
function : IQ ; | ||
} | ||
pin(QN) { | ||
direction : output ; | ||
function : IQN ; | ||
} | ||
} | ||
cell(latch) { | ||
area : 5 ; | ||
latch(IQ, IQN) { | ||
enable : G ; | ||
data_in : D ; | ||
} | ||
pin(D) { | ||
direction : input ; | ||
} | ||
pin(G) { | ||
direction : input ; | ||
} | ||
pin(Q) { | ||
direction : output ; | ||
function : IQ ; | ||
} | ||
pin(QN) { | ||
direction : output ; | ||
function : IQN ; | ||
} | ||
} | ||
cell(aoi211) { | ||
area : 3 ; | ||
pin(A) { | ||
direction : input ; | ||
} | ||
pin(B) { | ||
direction : input ; | ||
} | ||
pin(C) { | ||
direction : input ; | ||
} | ||
pin(Y) { | ||
direction : output ; | ||
function : ((A * B) + C)' ; | ||
} | ||
} | ||
cell(oai211) { | ||
area : 3 ; | ||
pin(A) { | ||
direction : input ; | ||
} | ||
pin(B) { | ||
direction : input ; | ||
} | ||
pin(C) { | ||
direction : input ; | ||
} | ||
pin(Y) { | ||
direction : output ; | ||
function : ((A + B) * C)' ; | ||
} | ||
} | ||
cell(halfadder) { | ||
area : 5 ; | ||
pin(A) { | ||
direction : input ; | ||
} | ||
pin(B) { | ||
direction : input ; | ||
} | ||
pin(C) { | ||
direction : output ; | ||
function : (A * B) ; | ||
} | ||
pin(Y) { | ||
direction : output ; | ||
function : (A *B') + (A' * B) ; | ||
} | ||
} | ||
cell(fulladder) { | ||
area : 8 ; | ||
pin(A) { | ||
direction : input ; | ||
} | ||
pin(B) { | ||
direction : input ; | ||
} | ||
pin(CI) { | ||
direction : input ; | ||
} | ||
pin(CO) { | ||
direction : output ; | ||
function : (((A * B)+(B * CI))+(CI * A)) ; | ||
} | ||
pin(Y) { | ||
direction : output ; | ||
function : ((A^B)^CI) ; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
module inv (A, Y); | ||
input A; | ||
output Y; | ||
assign Y = ~A; // A' | ||
endmodule | ||
module tri_inv (A, S, Z); | ||
input A; | ||
input S; | ||
output Z; | ||
assign Z = ~A; // A' | ||
endmodule | ||
module buffer (A, Y); | ||
input A; | ||
output Y; | ||
assign Y = A; // A | ||
endmodule | ||
module nand2 (A, B, Y); | ||
input A; | ||
input B; | ||
output Y; | ||
assign Y = ~(A&B); // (A * B)' | ||
endmodule | ||
module nor2 (A, B, Y); | ||
input A; | ||
input B; | ||
output Y; | ||
assign Y = ~(A|B); // (A + B)' | ||
endmodule | ||
module xor2 (A, B, Y); | ||
input A; | ||
input B; | ||
output Y; | ||
assign Y = (A&~B)|(~A&B); // (A *B') + (A' * B) | ||
endmodule | ||
module imux2 (A, B, S, Y); | ||
input A; | ||
input B; | ||
input S; | ||
output Y; | ||
assign Y = ~(&(A&S)|(B&~S)&); // ( (A * S) + (B * S') )' | ||
endmodule | ||
module dff (D, CLK, RESET, PRESET, Q, QN); | ||
reg IQ, IQN; | ||
input D; | ||
input CLK; | ||
input RESET; | ||
input PRESET; | ||
output Q; | ||
assign Q = IQ; // IQ | ||
output QN; | ||
assign QN = IQN; // IQN | ||
always @(posedge CLK, posedge RESET, posedge PRESET) begin | ||
if ((RESET) && (PRESET)) begin | ||
IQ <= 0; | ||
IQN <= 0; | ||
end | ||
else if (RESET) begin | ||
IQ <= 0; | ||
IQN <= 1; | ||
end | ||
else if (PRESET) begin | ||
IQ <= 1; | ||
IQN <= 0; | ||
end | ||
else begin | ||
// D | ||
IQ <= D; | ||
IQN <= ~(D); | ||
end | ||
end | ||
endmodule | ||
module latch (D, G, Q, QN); | ||
reg IQ, IQN; | ||
input D; | ||
input G; | ||
output Q; | ||
assign Q = IQ; // IQ | ||
output QN; | ||
assign QN = IQN; // IQN | ||
always @* begin | ||
if (G) begin | ||
IQ <= D; | ||
IQN <= ~(D); | ||
end | ||
end | ||
endmodule | ||
module aoi211 (A, B, C, Y); | ||
input A; | ||
input B; | ||
input C; | ||
output Y; | ||
assign Y = ~((A&B)|C); // ((A * B) + C)' | ||
endmodule | ||
module oai211 (A, B, C, Y); | ||
input A; | ||
input B; | ||
input C; | ||
output Y; | ||
assign Y = ~((A|B)&C); // ((A + B) * C)' | ||
endmodule | ||
module halfadder (A, B, C, Y); | ||
input A; | ||
input B; | ||
output C; | ||
assign C = (A&B); // (A * B) | ||
output Y; | ||
assign Y = (A&~B)|(~A&B); // (A *B') + (A' * B) | ||
endmodule | ||
module fulladder (A, B, CI, CO, Y); | ||
input A; | ||
input B; | ||
input CI; | ||
output CO; | ||
assign CO = (((A&B)|(B&CI))|(CI&A)); // (((A * B)+(B * CI))+(CI * A)) | ||
output Y; | ||
assign Y = ((A^B)^CI); // ((A^B)^CI) | ||
endmodule |
Oops, something went wrong.