File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22# Simple script that loops over benchmarks using
33# a native yosys script running at the command line
44#####################################################################
5+ # TODO: use read_slang instead of read_verilog (vlist)
6+ #
57import argparse
68import subprocess
79import os
1416 parser = argparse .ArgumentParser (description = """\
1517
1618LogikBench bare metal usage example
17- -Calls tools using single file scripts
19+ -Runs using single file jinja script template
1820-No dependency on external run time infrastructures
21+
1922Example Usage:
20- make.py -tool yosys -group epfl
23+ python make.py -tool yosys -target ice40 -group epfl -name mem_ctrl
24+
2125""" , formatter_class = argparse .RawDescriptionHelpFormatter )
2226
2327 parser .add_argument ("-group" ,
3236 required = True ,
3337 help = "Benchmark tool" )
3438 parser .add_argument ("-target" ,
35- choices = ['ice40' ],
3639 required = True ,
3740 help = "Benchmark target" )
3841
Original file line number Diff line number Diff line change 1+ # === USER CONFIGURATION ===
2+ set proj_name "{{ name }}"
3+ set proj_dir "./vivado_project"
4+ set top_module "{{ top }}"
5+ set part "{{ target }}"
6+ set filelist "{{ filename }}"
7+
8+ # === PROJECT SETUP ===
9+ create_project $proj_name $proj_dir -part $part -force
10+
11+ # Read .f file and add RTL + includes
12+ set fp [open $filelist r]
13+ while {[gets $fp line] >= 0} {
14+ set line [string trim $line]
15+ if {[string match "#*" $line] || $line eq ""} {
16+ continue ;# Skip comments and empty lines
17+ } elseif {[string match "-I*" $line]} {
18+ set incdir [string range $line 2 end]
19+ set_property include_dirs [concat $incdir] [current_fileset]
20+ } elseif {[file exists $line]} {
21+ add_files $line
22+ } else {
23+ puts "Warning: Skipping unknown or missing entry: $line"
24+ }
25+ }
26+ close $fp
27+
28+ # Set top module
29+ set_property top $top_module [current_fileset]
30+
31+ # === SYNTHESIS ===
32+ launch_runs synth_1
33+ wait_on_run synth_1
34+
35+ # === REPORTING ===
36+ report_utilization -file "$proj_dir/post_synth_util.rpt"
37+ report_timing_summary -file "$proj_dir/post_synth_timing.rpt"
You can’t perform that action at this time.
0 commit comments