# Timing build of the core alone: vivado -mode batch -source bench/build.tcl # MULT/DIV environment variables set the clock (default 9/10 = 90 MHz). set root [file normalize [file dirname [info script]]/..] set out $root/build/bench file mkdir $out set mult [expr {[info exists ::env(MULT)] ? $::env(MULT) : 9.0}] set div [expr {[info exists ::env(DIV)] ? $::env(DIV) : 10.0}] puts "CPU clock: [expr {100.0 * $mult / $div}] MHz" read_verilog $root/rtl/rv32_cpu.v $root/rtl/rv32_fpu.v $root/bench/cpu_bench.v read_mem $root/bench/bench.mem read_xdc $root/bench/bench.xdc synth_design -top cpu_bench -part xc7a35tcpg236-1 -generic MULT=$mult -generic DIV=$div opt_design -directive Explore place_design -directive ExtraTimingOpt phys_opt_design -directive AggressiveExplore route_design -directive Explore phys_opt_design -directive AggressiveExplore report_utilization -file $out/utilization.rpt report_utilization -hierarchical -file $out/util_hier.rpt report_timing_summary -file $out/timing.rpt report_timing -max_paths 20 -nworst 1 -unique_pins -file $out/paths.rpt write_bitstream -force $out/cpu_bench.bit set wns [get_property SLACK [get_timing_paths -max_paths 1 -setup]] puts "Worst setup slack: $wns ns"