diff options
Diffstat (limited to 'tcl')
| -rw-r--r-- | tcl/clean.tcl | 3 | ||||
| -rw-r--r-- | tcl/init.tcl | 38 |
2 files changed, 41 insertions, 0 deletions
diff --git a/tcl/clean.tcl b/tcl/clean.tcl new file mode 100644 index 0000000..eeadcb7 --- /dev/null +++ b/tcl/clean.tcl | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | project_open toycpu -revision toycpu | ||
| 2 | |||
| 3 | project_clean -revision toycpu | ||
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 @@ | |||
| 1 | project_new toycpu -revision toycpu -overwrite | ||
| 2 | |||
| 3 | set_global_assignment -name DEVICE 10CL025YU256I7G | ||
| 4 | |||
| 5 | set_global_assignment -name TOP_LEVEL_ENTITY top | ||
| 6 | set_global_assignment -name VERILOG_INPUT_VERSION SYSTEMVERILOG_2005 | ||
| 7 | set_global_assignment -name VERILOG_MACRO "SYNTHESIS=1" | ||
| 8 | |||
| 9 | proc 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 | |||
| 14 | pin E1 clk | ||
| 15 | pin J15 reset_n | ||
| 16 | |||
| 17 | create_base_clock -fmax "50 MHz" clk | ||
| 18 | |||
| 19 | proc 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 | |||
| 25 | proc 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 | |||
| 36 | add_dir "." | ||
| 37 | |||
| 38 | project_close | ||
