Skip to content

Commit 5e6bdad

Browse files
committed
[Infra]: - fix SPRAM/DPRAM VPR packing issue for circuits synthesized by Yosys
- fix a concatenation bug in arm_core caused failure in ABC for circuits synthesized by Yosys - remove SPRAM/DPRAM rename files - add info to Yosys synthesis script Signed-off-by: Seyed Alireza Damghani <[email protected]>
1 parent cb2a4d1 commit 5e6bdad

File tree

8 files changed

+31
-11
lines changed

8 files changed

+31
-11
lines changed

vtr_flow/benchmarks/verilog/arm_core.v

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4048,7 +4048,7 @@ reg [31:0] r11 = 32'hdeadbeef;
40484048
reg [31:0] r12 = 32'hdeadbeef;
40494049
reg [31:0] r13 = 32'hdeadbeef;
40504050
reg [31:0] r14 = 32'hdeadbeef;
4051-
reg [23:0] r15 = 24'hc0ffee;
4051+
reg [23:0] r15; // line: 4272
40524052

40534053
wire [31:0] r0_out;
40544054
wire [31:0] r1_out;
@@ -4268,7 +4268,8 @@ assign r15_out_rm_nxt = { i_status_bits_flags,
42684268
i_status_bits_firq_mask,
42694269
i_pc,
42704270
i_mode_exec};
4271-
4271+
4272+
// if r15 is initialized => Yosys+ABC:A CI/CO pair share the name (u_execute.u_register_bank.r15[1]) but do not link directly
42724273
assign r15_out_rn = {6'd0, r15, 2'd0};
42734274

42744275

vtr_flow/misc/synthesis.ys

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
# XXX is replaced with filename by the run_vtr_flow script
1+
#################################################################
2+
# Yosys synthesis script, including generic 'synth' commands, #
3+
# in addition to techmap asynchronous FFs and VTR hard blocks. #
4+
# Once the VTR flow runs with the Yosys front-end, Yosys #
5+
# synthesizes the input design using the following commands. #
6+
# #
7+
# NOTE: the script is adapted from the one Eddie Hung proposed #
8+
# for VTR-to-Bitstream[1]. However, a few minor changes to make #
9+
# it adaptable with the current VTR flow have been made. #
10+
# #
11+
# [1] http://eddiehung.github.io/vtb.html #
12+
#################################################################
13+
14+
# XXX (input circuit) is replaced with filename by the run_vtr_flow script
215
read_verilog -nolatches XXX
316

417
# These commands follow the generic `synth'
@@ -66,6 +79,7 @@ read_verilog -lib DDD #(DDD) will be replaced by dual_port_ram.v by python s
6679
read_verilog SSR #(SSR) will be replaced by spram_rename.v by python script
6780
read_verilog DDR #(DDR) will be replaced by dpram_rename.v by python script
6881

82+
6983
flatten
7084
# Lastly, check the hierarchy for any unknown modules,
7185
# and purge all modules (including blackboxes) that
@@ -78,4 +92,4 @@ tee -o /dev/stdout stat
7892
# the internal `$true'/`$false' signals vcc/gnd, but
7993
# switch `-impltf' doesn't output them
8094
# ZZZ will be replaced by run_vtr_flow.pl
81-
write_blif -true - vcc -false - gnd -undef - unconn -blackbox ZZZ
95+
write_blif -true + vcc -false + gnd -undef + unconn -blackbox ZZZ

vtr_flow/misc/yosyslib/dpram_rename.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
// depth and data may need to be splited
77
module dualPortRam(clk, we1, we2, addr1, addr2, data1, data2, out1, out2);
8-
parameter ADDR_WIDTH = 1;
8+
parameter ADDR_WIDTH = `MEM_MAXADDR;
99
parameter DATA_WIDTH = 1;
1010

1111
input clk;
@@ -57,4 +57,4 @@ module dual_port_ram(clk, data2, data1, addr2, addr1, we2, we1, out2, out1);
5757
out2 <= RAM[addr2];
5858
end
5959
*/
60-
endmodule
60+
endmodule

vtr_flow/misc/yosyslib/dual_port_ram.v

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
// depth and data may need to be splited
77
module dual_port_ram(clk, we1, we2, addr1, addr2, data1, data2, out1, out2);
8-
parameter ADDR_WIDTH = 1;
8+
parameter ADDR_WIDTH = `MEM_MAXADDR;
99
parameter DATA_WIDTH = 1;
1010

1111
input clk;
@@ -108,3 +108,4 @@ module dualPortRam(clk, data2, data1, addr2, addr1, we2, we1, out2, out1);
108108
end
109109
*/
110110
endmodule
111+

vtr_flow/misc/yosyslib/single_port_ram.v

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// depth and data may need to be splited
77
module single_port_ram(clk, we, addr, data, out);
88

9-
parameter ADDR_WIDTH = 1;
9+
parameter ADDR_WIDTH = `MEM_MAXADDR;
1010
parameter DATA_WIDTH = 1;
1111

1212
input clk;
@@ -89,3 +89,4 @@ module singlePortRam(clk, data, addr, we, out);
8989
end
9090
*/
9191
endmodule
92+

vtr_flow/misc/yosyslib/spram_rename.v

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
`timescale 1ps/1ps
22

3+
`define MEM_MAXADDR PPP
4+
`define MEM_MAXDATA 36
5+
36
// depth and data may need to be splited
47
module singlePortRam(clk, we, addr, data, out);
58

6-
parameter ADDR_WIDTH = 1;
9+
parameter ADDR_WIDTH = `MEM_MAXADDR;
710
parameter DATA_WIDTH = 1;
811

912
input clk;
@@ -46,4 +49,4 @@ module single_port_ram(clk, data, addr, we, out);
4649
out <= RAM[addr];
4750
end
4851
*/
49-
endmodule
52+
endmodule
Binary file not shown.

vtr_flow/tasks/regression_tests/vtr_reg_yosys/vtr_benchmarks/config/config.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ qor_parse_file=qor_standard.txt
4545
pass_requirements_file=pass_requirements.txt
4646

4747
#Script parameters
48-
script_params=-track_memory_usage -crit_path_router_iterations 100 -start yosys
48+
script_params=-track_memory_usage -crit_path_router_iterations 100 --route_chan_width 300 -start yosys

0 commit comments

Comments
 (0)