mirror of https://github.com/YosysHQ/picorv32.git
Added scripts/yosys/synth_gates
This commit is contained in:
parent
686289adc5
commit
00844092ee
|
@ -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"; }
|
||||
}
|
||||
}
|
|
@ -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
|
|
@ -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
|
Loading…
Reference in New Issue