|
|
@@ -0,0 +1,99 @@ |
|
|
|
// test comment |
|
|
|
/* test comment */ |
|
|
|
library(demo) { |
|
|
|
type (bus4) { |
|
|
|
base_type : array; |
|
|
|
data_type : bit; |
|
|
|
bit_width : 4; |
|
|
|
bit_from : 0; |
|
|
|
bit_to : 3; |
|
|
|
} |
|
|
|
cell(BUF) { |
|
|
|
area: 2; |
|
|
|
pin(A) { direction: input; } |
|
|
|
pin(Y) { direction: output; |
|
|
|
function: "A"; } |
|
|
|
} |
|
|
|
cell(NOT) { |
|
|
|
area: 2; |
|
|
|
pin(A) { direction: input; } |
|
|
|
pin(Y) { direction: output; |
|
|
|
function: "A'"; } |
|
|
|
} |
|
|
|
cell(XOR) { |
|
|
|
area: 100; |
|
|
|
pin(A) { direction: input; } |
|
|
|
pin(B) { direction: input; } |
|
|
|
pin(Y) { direction: output; |
|
|
|
function: "(A^B)"; } |
|
|
|
} |
|
|
|
// not used, see -g option of abc http://www.clifford.at/yosys/cmd_abc.html |
|
|
|
cell(XORDUAL) { |
|
|
|
area: 2; |
|
|
|
pin(A) { direction: input; } |
|
|
|
pin(B) { direction: input; } |
|
|
|
pin(C) { direction: input; } |
|
|
|
pin(D) { direction: input; } |
|
|
|
pin(Y) { direction: output; |
|
|
|
function: "(A^B)"; } |
|
|
|
pin(Z) { direction: output; |
|
|
|
function: "(C^D)"; } |
|
|
|
} |
|
|
|
cell(XOR2) { |
|
|
|
area: 2; |
|
|
|
bus(I1) { |
|
|
|
bus_type : bus4; |
|
|
|
direction : input; |
|
|
|
} |
|
|
|
bus(I2) { |
|
|
|
bus_type : bus4; |
|
|
|
direction : input; |
|
|
|
} |
|
|
|
bus(Y) { |
|
|
|
bus_type : bus4; |
|
|
|
direction : output; |
|
|
|
pin (Y[0:3]) { |
|
|
|
function: "(I1^I2)"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
cell(NAND) { |
|
|
|
area: 2; |
|
|
|
pin(A) { direction: input; } |
|
|
|
pin(B) { direction: input; } |
|
|
|
pin(Y) { direction: output; |
|
|
|
function: "(A*B)'"; } |
|
|
|
} |
|
|
|
cell(NOR) { |
|
|
|
area: 2; |
|
|
|
pin(A) { direction: input; } |
|
|
|
pin(B) { direction: input; } |
|
|
|
pin(Y) { direction: output; |
|
|
|
function: "(A+B)'"; } |
|
|
|
} |
|
|
|
cell(DFF) { |
|
|
|
area: 2; |
|
|
|
ff(IQ, IQN) { clocked_on: C; |
|
|
|
next_state: D; } |
|
|
|
pin(C) { direction: input; |
|
|
|
clock: true; } |
|
|
|
pin(D) { direction: input; } |
|
|
|
pin(Q) { direction: output; |
|
|
|
function: "IQ"; } |
|
|
|
} |
|
|
|
cell(DFFSR) { |
|
|
|
area: 2; |
|
|
|
ff("IQ", "IQN") { clocked_on: C; |
|
|
|
next_state: D; |
|
|
|
preset: S; |
|
|
|
clear: R; } |
|
|
|
pin(C) { direction: input; |
|
|
|
clock: true; } |
|
|
|
pin(D) { direction: input; } |
|
|
|
pin(Q) { direction: output; |
|
|
|
function: "IQ"; } |
|
|
|
pin(S) { direction: input; } |
|
|
|
pin(R) { direction: input; } |
|
|
|
; // empty statement |
|
|
|
} |
|
|
|
} |