|
2 | 2 | #
|
3 | 3 | # Includes a function that builds a filelist of
|
4 | 4 | # 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. |
7 | 6 |
|
8 | 7 |
|
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 |
| - |
76 | 8 | # Function - build_filelist:
|
77 | 9 | #
|
78 | 10 | # 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. |
81 | 12 | #
|
82 | 13 | # Parameters:
|
83 | 14 | #
|
84 | 15 | # circuit_list - list of circuits passed into the flow
|
85 | 16 | # file_list - text file being written to that will contain
|
86 | 17 | # the names of circuits from circuit list.
|
87 | 18 | #
|
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}" |
115 | 28 | }
|
116 |
| - close $fh |
117 |
| - return $top_args |
118 | 29 | }
|
| 30 | + close $fh |
119 | 31 | }
|
0 commit comments