From 5c1df6d27f5dac143efc9ce84689b863dbee45bd Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Wed, 24 Mar 2021 08:35:07 -0700 Subject: Reorganize repo layout to make it a little easier to work within. --- tcl/clean.tcl | 3 +++ tcl/init.tcl | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 tcl/clean.tcl create mode 100644 tcl/init.tcl (limited to 'tcl') 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 @@ +project_open toycpu -revision toycpu + +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 @@ +project_new toycpu -revision toycpu -overwrite + +set_global_assignment -name DEVICE 10CL025YU256I7G + +set_global_assignment -name TOP_LEVEL_ENTITY top +set_global_assignment -name VERILOG_INPUT_VERSION SYSTEMVERILOG_2005 +set_global_assignment -name VERILOG_MACRO "SYNTHESIS=1" + +proc pin {loc net} { + set_location_assignment -to $net "PIN_$loc" + set_instance_assignment -name IO_STANDARD "3.3V LVTTL" -to $net +} + +pin E1 clk +pin J15 reset_n + +create_base_clock -fmax "50 MHz" clk + +proc add_files {typ ext dir} { + foreach name [glob -nocomplain -directory $dir -type f "*.$ext"] { + set_global_assignment -name "${typ}_FILE" $name + } +} + +proc add_dir {dir} { + add_files CDF cdf $dir + add_files HEX hex $dir + add_files SDC sdc $dir + add_files VERILOG sv $dir + + foreach subdir [glob -nocomplain -directory $dir -type d *] { + add_dir $subdir + } +} + +add_dir "." + +project_close -- cgit v1.2.3