diff options
| author | Julian Blake Kongslie | 2021-03-24 08:35:07 -0700 |
|---|---|---|
| committer | Julian Blake Kongslie | 2021-03-24 08:50:57 -0700 |
| commit | 5c1df6d27f5dac143efc9ce84689b863dbee45bd (patch) | |
| tree | 9bb9c9bcab00e7d5a5d1b40467d8e5a810f0b706 /tcl | |
| parent | Clean before building. (diff) | |
| download | toycpu-5c1df6d27f5dac143efc9ce84689b863dbee45bd.tar.xz | |
Reorganize repo layout to make it a little easier to work within.
Diffstat (limited to '')
| -rw-r--r-- | tcl/clean.tcl (renamed from clean.tcl) | 0 | ||||
| -rw-r--r-- | tcl/init.tcl | 38 |
2 files changed, 38 insertions, 0 deletions
diff --git a/clean.tcl b/tcl/clean.tcl index eeadcb7..eeadcb7 100644 --- a/clean.tcl +++ b/tcl/clean.tcl | |||
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 | ||
