summaryrefslogtreecommitdiff
path: root/tcl/init.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'tcl/init.tcl')
-rw-r--r--tcl/init.tcl38
1 files changed, 38 insertions, 0 deletions
diff --git a/tcl/init.tcl b/tcl/init.tcl
new file mode 100644
index 0000000..7bf3a13
--- /dev/null
+++ b/tcl/init.tcl
@@ -0,0 +1,38 @@
1project_new toycpu -revision toycpu -overwrite
2
3set_global_assignment -name DEVICE 10CL025YU256I7G
4
5set_global_assignment -name TOP_LEVEL_ENTITY top
6set_global_assignment -name VERILOG_INPUT_VERSION SYSTEMVERILOG_2005
7set_global_assignment -name VERILOG_MACRO "SYNTHESIS=1"
8
9proc pin {loc net} {
10 set_location_assignment -to $net "PIN_$loc"
11 set_instance_assignment -name IO_STANDARD "3.3V LVTTL" -to $net
12}
13
14pin E1 clk
15pin J15 reset_n
16
17create_base_clock -fmax "50 MHz" clk
18
19proc add_files {typ ext dir} {
20 foreach name [glob -nocomplain -directory $dir -type f "*.$ext"] {
21 set_global_assignment -name "${typ}_FILE" $name
22 }
23}
24
25proc add_dir {dir} {
26 add_files CDF cdf $dir
27 add_files HEX hex $dir
28 add_files SDC sdc $dir
29 add_files VERILOG sv $dir
30
31 foreach subdir [glob -nocomplain -directory $dir -type d *] {
32 add_dir $subdir
33 }
34}
35
36add_dir "."
37
38project_close