Skip to content

Commit 32d455c

Browse files
committed
[Infra]: - handle "include" feature for Yosys in running VTR scripts
- add tests to check the "include" feature works properly for all VTR frontends Signed-off-by: Seyed Alireza Damghani <[email protected]> m
1 parent 35d15ce commit 32d455c

File tree

9 files changed

+136
-43
lines changed

9 files changed

+136
-43
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ jobs:
155155
include: [
156156
{
157157
name: 'Basic',
158-
params: '-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on',
158+
params: '-DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DODIN_USE_YOSYS=ON',
159159
suite: 'vtr_reg_basic'
160160
},
161161
{

vtr_flow/benchmarks/hdl_include/include/memory_controller.v

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ reg str_write_enable;
2424
reg [7:0] str_in;
2525
wire [7:0] str_out;
2626

27+
defparam _str.ADDR_WIDTH = 5;
28+
defparam _str.DATA_WIDTH = 8;
2729
single_port_ram _str (
2830
.clk( clk ),
2931
.addr( str_address ),

vtr_flow/scripts/python_libs/vtr/odin/odin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ def run(
109109
circuit_file :
110110
Circuit file to optimize
111111
112+
include_files :
113+
list of header files
114+
112115
output_netlist :
113116
File name to output the resulting circuit to
114117

vtr_flow/scripts/python_libs/vtr/yosys/yosys.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def init_script_file(
6969
vtr.file_replace(
7070
yosys_script_full_path,
7171
{
72-
"XXX": circuit_list[0],
72+
"XXX": "{}".format(" ".join(str(s) for s in circuit_list)),
7373
"YYY": yosys_models_full_path,
7474
"SSS": yosys_spram_full_path,
7575
"DDD": yosys_dpram_full_path,
@@ -121,6 +121,9 @@ def run(
121121
circuit_file :
122122
Circuit file to optimize
123123
124+
include_files :
125+
list of header files
126+
124127
output_netlist :
125128
File name to output the resulting circuit to
126129

vtr_flow/tasks/regression_tests/vtr_reg_basic/hdl_include/config/config.txt

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#################################################################
2+
# Configuration file for running experiments #
3+
# #
4+
# This config file is testing the ability to specify include #
5+
# files that should pass to the VTR frontend with the top #
6+
# module of the benchmark (ch_intrinsic_top.v). This is done #
7+
# by specifying two Verilog header files that provide essential #
8+
# definitions, and memory_controller design that provides the #
9+
# design of an internal component for ch_intrinsic_top. If the #
10+
# include files are not properly included during compilation #
11+
# the benchmark is incomplete and the flow will error out. #
12+
#################################################################
13+
14+
# Path to directory of circuits to use
15+
circuits_dir=benchmarks/hdl_include
16+
17+
# Path to directory of includes circuits to use
18+
includes_dir=benchmarks/hdl_include/include
19+
20+
# Path to directory of architectures to use
21+
archs_dir=arch/no_timing/memory_sweep
22+
23+
# Add circuits to list to sweep
24+
circuit_list_add=ch_intrinsics_modified.v
25+
26+
# Add circuits to includes list to sweep
27+
include_list_add=generic_definitions1.vh
28+
include_list_add=generic_definitions2.vh
29+
include_list_add=memory_controller.v
30+
31+
# Add architectures to list to sweep
32+
arch_list_add=k4_N10_memSize16384_memData64.xml
33+
34+
# Parse info and how to parse
35+
parse_file=vpr_no_timing.txt
36+
37+
# How to parse QoR info
38+
qor_parse_file=qor_no_timing.txt
39+
40+
# Script parameters
41+
script_params_common=-track_memory_usage --timing_analysis off
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#################################################################
2+
# Configuration file for running experiments #
3+
# #
4+
# This config file is testing the ability to specify include #
5+
# files that should pass to the VTR frontend with the top #
6+
# module of the benchmark (ch_intrinsic_top.v). This is done #
7+
# by specifying two Verilog header files that provide essential #
8+
# definitions, and memory_controller design that provides the #
9+
# design of an internal component for ch_intrinsic_top. If the #
10+
# include files are not properly included during compilation #
11+
# the benchmark is incomplete and the flow will error out. #
12+
#################################################################
13+
14+
# Path to directory of circuits to use
15+
circuits_dir=benchmarks/hdl_include
16+
17+
# Path to directory of includes circuits to use
18+
includes_dir=benchmarks/hdl_include/include
19+
20+
# Path to directory of architectures to use
21+
archs_dir=arch/no_timing/memory_sweep
22+
23+
# Add circuits to list to sweep
24+
circuit_list_add=ch_intrinsics_modified.v
25+
26+
# Add circuits to includes list to sweep
27+
include_list_add=generic_definitions1.vh
28+
include_list_add=generic_definitions2.vh
29+
include_list_add=memory_controller.v
30+
31+
# Add architectures to list to sweep
32+
arch_list_add=k4_N10_memSize16384_memData64.xml
33+
34+
# Parse info and how to parse
35+
parse_file=vpr_no_timing.txt
36+
37+
# How to parse QoR info
38+
qor_parse_file=qor_no_timing.txt
39+
40+
# Script parameters
41+
script_params_common=-track_memory_usage --timing_analysis off -start yosys
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#################################################################
2+
# Configuration file for running experiments #
3+
# #
4+
# This config file is testing the ability to specify include #
5+
# files that should pass to the VTR frontend with the top #
6+
# module of the benchmark (ch_intrinsic_top.v). This is done #
7+
# by specifying two Verilog header files that provide essential #
8+
# definitions, and memory_controller design that provides the #
9+
# design of an internal component for ch_intrinsic_top. If the #
10+
# include files are not properly included during compilation #
11+
# the benchmark is incomplete and the flow will error out. #
12+
#################################################################
13+
14+
# Path to directory of circuits to use
15+
circuits_dir=benchmarks/hdl_include
16+
17+
# Path to directory of includes circuits to use
18+
includes_dir=benchmarks/hdl_include/include
19+
20+
# Path to directory of architectures to use
21+
archs_dir=arch/no_timing/memory_sweep
22+
23+
# Add circuits to list to sweep
24+
circuit_list_add=ch_intrinsics_modified.v
25+
26+
# Add circuits to includes list to sweep
27+
include_list_add=generic_definitions1.vh
28+
include_list_add=generic_definitions2.vh
29+
include_list_add=memory_controller.v
30+
31+
# Add architectures to list to sweep
32+
arch_list_add=k4_N10_memSize16384_memData64.xml
33+
34+
# Parse info and how to parse
35+
parse_file=vpr_no_timing.txt
36+
37+
# How to parse QoR info
38+
qor_parse_file=qor_no_timing.txt
39+
40+
# Script parameters
41+
script_params_common=-track_memory_usage --timing_analysis off -elaborator yosys -fflegalize
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
regression_tests/vtr_reg_basic/basic_no_timing
22
regression_tests/vtr_reg_basic/basic_timing
33
regression_tests/vtr_reg_basic/basic_timing_no_sdc
4-
regression_tests/vtr_reg_basic/hdl_include
4+
regression_tests/vtr_reg_basic/hdl_include_odin
5+
regression_tests/vtr_reg_basic/hdl_include_yosys
6+
regression_tests/vtr_reg_basic/hdl_include_yosys_odin

0 commit comments

Comments
 (0)