generic: Add synth_generic.tcl
Signed-off-by: David Shah <dave@ds0.me>
This commit is contained in:
parent
f88ddf85b2
commit
99c3713293
9
generic/synth/blink.v
Normal file
9
generic/synth/blink.v
Normal file
@ -0,0 +1,9 @@
|
||||
module top(input clk, output reg [7:0] leds);
|
||||
|
||||
reg [25:0] ctr;
|
||||
always @(posedge clk)
|
||||
ctr <= ctr + 1'b1;
|
||||
|
||||
assign leds = ctr[25:18];
|
||||
|
||||
endmodule
|
@ -7,6 +7,4 @@ module \$lut (A, Y);
|
||||
LUT #(.K(`LUT_K), .INIT(LUT)) _TECHMAP_REPLACE_ (.I(A), .Q(Y));
|
||||
endmodule
|
||||
|
||||
|
||||
module \$_DFF_N_ (input D, C, output Q); DFF _TECHMAP_REPLACE_ (.D(D), .Q(Q), .CLK(C)); endmodule
|
||||
module \$_DFF_P_ (input D, C, output Q); DFF _TECHMAP_REPLACE_ (.D(D), .Q(Q), .CLK(!C)); endmodule
|
||||
module \$_DFF_P_ (input D, C, output Q); DFF _TECHMAP_REPLACE_ (.D(D), .Q(Q), .CLK(C)); endmodule
|
||||
|
24
generic/synth/synth_generic.tcl
Normal file
24
generic/synth/synth_generic.tcl
Normal file
@ -0,0 +1,24 @@
|
||||
# Usage
|
||||
# tcl synth_generic.tcl {K} {out.json}
|
||||
|
||||
set LUT_K 4
|
||||
if {$argc > 0} { set LUT_K [lindex $argv 0] }
|
||||
yosys read_verilog -lib [file dirname [file normalize $argv0]]/prims.v
|
||||
yosys hierarchy -check
|
||||
yosys proc
|
||||
yosys flatten
|
||||
yosys tribuf -logic
|
||||
yosys deminout
|
||||
yosys synth -run coarse
|
||||
yosys memory_map
|
||||
yosys opt -full
|
||||
yosys techmap -map +/techmap.v
|
||||
yosys opt -fast
|
||||
yosys abc -lut $LUT_K
|
||||
yosys clean
|
||||
yosys techmap -D LUT_K=$LUT_K -map [file dirname [file normalize $argv0]]/cells_map.v
|
||||
yosys clean
|
||||
yosys hierarchy -check
|
||||
yosys stat
|
||||
|
||||
if {$argc > 1} { yosys write_json [lindex $argv 1] }
|
Loading…
Reference in New Issue
Block a user