Added scripts/yosys/synth_gates

This commit is contained in:
Clifford Wolf 2015-09-12 14:02:23 +02:00
parent 686289adc5
commit 00844092ee
3 changed files with 76 additions and 0 deletions

View File

@ -0,0 +1,32 @@
library(gates) {
cell(NOT) {
area: 2; // 7404 hex inverter
pin(A) { direction: input; }
pin(Y) { direction: output;
function: "A'"; }
}
cell(NAND) {
area: 3; // 7400 quad 2-input NAND gate
pin(A) { direction: input; }
pin(B) { direction: input; }
pin(Y) { direction: output;
function: "(A*B)'"; }
}
cell(NOR) {
area: 3; // 7402 quad 2-input NOR gate
pin(A) { direction: input; }
pin(B) { direction: input; }
pin(Y) { direction: output;
function: "(A+B)'"; }
}
cell(DFF) {
area: 6; // 7474 dual D positive edge triggered flip-flop
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"; }
}
}

View File

@ -0,0 +1,30 @@
module top (
input clk, resetn,
output mem_valid,
output mem_instr,
input mem_ready,
output [31:0] mem_addr,
output [31:0] mem_wdata,
output [ 3:0] mem_wstrb,
input [31:0] mem_rdata
);
picorv32 #(
.ENABLE_COUNTERS(0),
.LATCHED_MEM_RDATA(1),
.TWO_STAGE_SHIFT(0),
.CATCH_MISALIGN(0),
.CATCH_ILLINSN(0)
) picorv32 (
.clk (clk ),
.resetn (resetn ),
.mem_valid(mem_valid),
.mem_instr(mem_instr),
.mem_ready(mem_ready),
.mem_addr (mem_addr ),
.mem_wdata(mem_wdata),
.mem_wstrb(mem_wstrb),
.mem_rdata(mem_rdata)
);
endmodule

View File

@ -0,0 +1,14 @@
read_verilog synth_gates.v
read_verilog ../../picorv32.v
hierarchy -top top
proc; flatten
synth
dfflibmap -prepare -liberty synth_gates.lib
abc -dff -liberty synth_gates.lib
dfflibmap -liberty synth_gates.lib
stat
write_blif synth_gates.blif