The FPU picks the FADD/FSUB operands and works out exponents and leading zeros as it takes them, and finds the back end's leading one a clock before using it; those were the paths that held the design to 91 MHz. Add, multiply and the multiply-adds now take 13 clocks, divide and square root 37, int -> float 9. Setup slack at 100 MHz is +0.286 ns. On the board: an empty FOR loop 6.4 us (was 8.3), SIN 33 us (was 37). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38 lines
1.5 KiB
Tcl
38 lines
1.5 KiB
Tcl
# Non-project Vivado build: vivado -mode batch -source scripts/build.tcl
|
|
# The CPU clock is 100 MHz * CPU_MULT / CPU_DIV (environment variables).
|
|
set root [file normalize [file dirname [info script]]/..]
|
|
set out $root/build
|
|
file mkdir $out
|
|
|
|
set mult [expr {[info exists ::env(CPU_MULT)] ? $::env(CPU_MULT) : 10.0}]
|
|
set div [expr {[info exists ::env(CPU_DIV)] ? $::env(CPU_DIV) : 10.0}]
|
|
set hz [expr {int(round(100e6 * $mult / $div))}]
|
|
puts "CPU clock: [expr {$hz / 1e6}] MHz"
|
|
|
|
read_verilog [glob $root/rtl/*.v]
|
|
read_mem $root/font/font.mem
|
|
read_mem $root/basic/basic.mem
|
|
read_mem $root/basic/basic-hi.mem
|
|
read_mem $root/monitor/monitor.mem
|
|
read_xdc $root/constraints/basys3.xdc
|
|
|
|
synth_design -top basys3_terminal -part xc7a35tcpg236-1 \
|
|
-generic CPU_MULT=$mult -generic CPU_DIV=$div -generic CPU_HZ=$hz
|
|
opt_design -directive Explore
|
|
place_design -directive ExtraTimingOpt
|
|
phys_opt_design -directive AggressiveExplore
|
|
route_design -directive Explore
|
|
phys_opt_design -directive AggressiveExplore
|
|
write_checkpoint -force $out/routed.dcp
|
|
|
|
report_utilization -file $out/utilization.rpt
|
|
report_timing_summary -file $out/timing.rpt
|
|
report_timing -max_paths 30 -nworst 1 -unique_pins -file $out/paths.rpt
|
|
write_bitstream -force $out/basys3_terminal.bit
|
|
write_cfgmem -force -format mcs -interface SPIx4 -size 4 \
|
|
-loadbit "up 0x0 $out/basys3_terminal.bit" $out/basys3_terminal.mcs
|
|
|
|
set wns [get_property SLACK [get_timing_paths -max_paths 1 -setup]]
|
|
puts "Worst setup slack: $wns ns"
|
|
if {$wns < 0} { error "timing not met" }
|