Skip to content

Commit 22e0cfb

Browse files
Merge pull request #3259 from verilog-to-routing/slang_top_map_removal
Removing Top Module Mapping With Slang
2 parents 5d4ef4e + 0be355d commit 22e0cfb

File tree

2 files changed

+14
-102
lines changed

2 files changed

+14
-102
lines changed

vtr_flow/misc/yosys/slang_filelist.tcl

Lines changed: 12 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -2,118 +2,30 @@
22
#
33
# Includes a function that builds a filelist of
44
# HDL files provided by the circuit list to be
5-
# read by read_slang. This function also identifies
6-
# the respective top modules of HDL files in the filelist.
5+
# read by read_slang.
76

87

9-
namespace eval ::slang {
10-
# INFO: Maps HDL files to respective top module(s)
11-
# top_map insertion syntax:
12-
# <file> <top module>
13-
array set top_map {
14-
and_latch.v and_latch
15-
multiclock_output_and_latch.v multiclock_output_and_latch
16-
multiclock_reader_writer.v multiclock_reader_writer
17-
multiclock_separate_and_latch.v multiclock_separate_and_latch
18-
arm_core.v arm_core
19-
bgm.v bgm
20-
blob_merge.v RLE_BlobMerging
21-
boundtop.v paj_boundtop_hierarchy_no_mem
22-
ch_intrinsics.v memset
23-
diffeq1.v diffeq_paj_convert
24-
diffeq2.v diffeq_f_systemC
25-
LU8PEEng.v LU8PEEng
26-
LU32PEEng.v LU32PEEng
27-
LU64PEEng.v LU64PEEng
28-
mcml.v mcml
29-
mkDelayWorker32B.v mkDelayWorker32B
30-
mkPktMerge.v mkPktMerge
31-
mkSMAdapter4B.v mkSMAdapter4B
32-
or1200.v or1200_flat
33-
raygentop.v paj_raygentop_hierarchy_no_mem
34-
sha.v sha1
35-
stereovision0.v sv_chip0_hierarchy_no_mem
36-
stereovision1.v sv_chip1_hierarchy_no_mem
37-
stereovision2.v sv_chip2_hierarchy_no_mem
38-
stereovision3.v sv_chip3_hierarchy_no_mem
39-
button_controller.sv top
40-
display_control.sv top
41-
debounce.sv top
42-
timer.sv top
43-
deepfreeze.style1.sv top
44-
pulse_led.v top
45-
clock.sv top
46-
single_ff.v top
47-
single_wire.v top
48-
PWM.v top
49-
flattened_pulse_width_led.sv top
50-
modify_count.sv top
51-
time_counter.sv top
52-
spree.v system
53-
attention_layer.v attention_layer
54-
bnn.v bnn
55-
tpu_like.small.os.v top
56-
tpu_like.small.ws.v top
57-
dla_like.small.v DLA
58-
conv_layer_hls.v top
59-
conv_layer.v conv_layer
60-
eltwise_layer.v eltwise_layer
61-
robot_rl.v robot_maze
62-
reduction_layer.v reduction_layer
63-
spmv.v spmv
64-
softmax.v softmax
65-
}
66-
# INFO: List of HDL includes files
67-
# includes_map insertion syntax:
68-
# <file> include
69-
array set includes_map {
70-
hard_block_include.v include
71-
}
72-
73-
74-
variable top_args {}
75-
768
# Function - build_filelist:
779
#
7810
# Validates file extensions of input files and writes the names
79-
# of input files to the file list to be read by yosys-slang. Also appends
80-
# the respective top modules of HDL files being read by slang to the read_slang command.
11+
# of input files to the file list to be read by yosys-slang.
8112
#
8213
# Parameters:
8314
#
8415
# circuit_list - list of circuits passed into the flow
8516
# file_list - text file being written to that will contain
8617
# the names of circuits from circuit list.
8718
#
88-
proc build_filelist { circuit_list file_list } {
89-
variable top_args
90-
variable top_map
91-
variable includes_map
92-
set top_args {}
93-
set fh [open $file_list "w"]
94-
foreach f $circuit_list {
95-
set ext [string tolower [file extension $f]]
96-
if {$ext == ".sv" || $ext == ".svh" || $ext == ".v" || $ext == ".vh"} {
97-
if {$f != "vtr_primitives.v" && $f != "vtr_blackboxes.v"} {
98-
#Includes file
99-
if {[info exists includes_map($f)]} {
100-
puts $fh $f
101-
#HDL file or top module isn't in top_map
102-
} elseif {![info exists top_map($f)]} {
103-
error "No top module set for $f"
104-
#HDL file and respective top module in top_map
105-
} else {
106-
puts $fh $f
107-
set top_name $top_map($f)
108-
lappend top_args --top $top_name
109-
}
110-
}
111-
} else {
112-
close $fh
113-
error "Unsupported file type. Yosys-Slang accepts .sv .svh .v .vh. File {$f}"
114-
}
19+
proc build_filelist { circuit_list file_list } {
20+
set fh [open $file_list "w"]
21+
foreach f $circuit_list {
22+
set ext [string tolower [file extension $f]]
23+
if {$ext == ".sv" || $ext == ".svh" || $ext == ".v" || $ext == ".vh"} {
24+
puts $fh $f
25+
} else {
26+
close $fh
27+
error "Unsupported file type. Yosys-Slang accepts .sv .svh .v .vh. Failing File {$f}"
11528
}
116-
close $fh
117-
return $top_args
11829
}
30+
close $fh
11931
}

vtr_flow/misc/yosys/synthesis.tcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ if {$env(PARSER) == "slang" } {
3434
source [file join [pwd] "slang_filelist.tcl"]
3535
set readfile [file join [pwd] "filelist.txt"]
3636
#Writing names of circuit files to file list
37-
set slang_tops [::slang::build_filelist {XXX} $readfile]
37+
build_filelist {XXX} $readfile
3838
puts "Using Yosys read_slang command"
3939
#Read vtr_primitives library and user design verilog in same command
40-
read_slang -v $env(PRIMITIVES) {*}$slang_tops -C $readfile
40+
read_slang -v $env(PRIMITIVES) -C $readfile
4141
} elseif {$env(PARSER) == "default" } {
4242
puts "Using Yosys read_verilog command"
4343
read_verilog -nomem2reg +/parmys/vtr_primitives.v

0 commit comments

Comments
 (0)