diff options
| author | Julian Blake Kongslie | 2021-03-28 14:48:30 -0700 |
|---|---|---|
| committer | Julian Blake Kongslie | 2021-03-28 14:48:30 -0700 |
| commit | 7a1311c16c36b18a66a5ee43511fb9ad5093ec3a (patch) | |
| tree | 09df63644ac11dee4f2de25d476437e73fcdea84 /tcl/init.tcl | |
| download | noncpu-7a1311c16c36b18a66a5ee43511fb9ad5093ec3a.tar.xz | |
Initial commit.
Diffstat (limited to '')
| -rw-r--r-- | tcl/init.tcl | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tcl/init.tcl b/tcl/init.tcl new file mode 100644 index 0000000..039af91 --- /dev/null +++ b/tcl/init.tcl | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | project_new noncpu -revision noncpu -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 | # This is the clock for timing-driven synthesis, not timing analysis. | ||
| 18 | # See clocks.sdf for the other clock. | ||
| 19 | create_base_clock -fmax "50 MHz" clk | ||
| 20 | |||
| 21 | proc add_files {typ ext dir} { | ||
| 22 | foreach name [glob -nocomplain -directory $dir -type f "*.$ext"] { | ||
| 23 | set_global_assignment -name "${typ}_FILE" $name | ||
| 24 | } | ||
| 25 | } | ||
| 26 | |||
| 27 | proc add_dir {dir} { | ||
| 28 | add_files CDF cdf $dir | ||
| 29 | add_files HEX hex $dir | ||
| 30 | add_files SDC sdc $dir | ||
| 31 | add_files VERILOG sv $dir | ||
| 32 | add_files VERILOG svh $dir | ||
| 33 | |||
| 34 | foreach subdir [glob -nocomplain -directory $dir -type d *] { | ||
| 35 | add_dir $subdir | ||
| 36 | } | ||
| 37 | } | ||
| 38 | |||
| 39 | add_dir . | ||
| 40 | |||
| 41 | project_close | ||
