set project_name    qdr2

# Clean up old implementation
project -close eval("project -list")


# create a new project
project -new "$project_name.prj"

# Implementation version set
impl -remove [impl -list]


#add_file options
add_file -verilog "../../../source/magma.v"
add_file -verilog "../../../source/pll_qdr_syn.v"
add_file -verilog "../../../source/oddr_xp.v"
add_file -verilog "../../../source/pipeline.v"
add_file -verilog "../../../source/qdr2.v"
add_file -verilog "../../../source/qdr2_io.v"

#implementation: "rev_1"
impl -add rev_1

#device options
set_option -technology LATTICE-XP
set_option -part LFXP10C
set_option -package F388C
set_option -speed_grade -4

#compilation/mapping options
set_option -default_enum_encoding default
set_option -symbolic_fsm_compiler 1
set_option -resource_sharing 1

#map options
set_option -frequency 220.000
set_option -fanout_limit 100
set_option -disable_io_insertion 0
set_option -force_gsr auto

#simulation options
set_option -write_verilog 0
set_option -write_vhdl 0

#automatic place and route (vendor) options
set_option -write_apr_constraint 1

#implementation attributes
set_option -vlog_std v2001
set_option -auto_constrain_io 0
impl -active "rev_1"

set_option -result_file   "rev_1/$project_name\_io.edn"
project -run compile


project -run synthesis
save_project "$project_name.prj"


