printf "Compile VHDL Files\n"
if(alcom acc16.vhd)	{{printf "Error: alcom acc16.vhd\n"}{ exit}}
if(alcom alu.vhd)	{{printf "Error: alu.vhd	\n"}{ exit}}
if(alcom buf1.vhd)	{{printf "Error: buf1.vhd	\n"}{ exit}}
if(alcom buf2.vhd)	{{printf "Error: buf2.vhd	\n"}{ exit}}
if(alcom fr.vhd)	{{printf "Error: fr.vhd		\n"}{ exit}}
if(alcom idc_seq.vhd)	{{printf "Error: idc_seq.vhd	\n"}{ exit}}
if(alcom ir16.vhd)	{{printf "Error: ir16.vhd	\n"}{ exit}}
if(alcom ix12.vhd)	{{printf "Error: ix12.vhd	\n"}{ exit}}
if(alcom mar12.vhd)	{{printf "Error: mar12.vhd	\n"}{ exit}}
if(alcom pc12.vhd)	{{printf "Error: pc12.vhd	\n"}{ exit}}
if(alcom sp12.vhd)	{{printf "Error: sp12.vhd	\n"}{ exit}}
if(alcom kite_core.vhd)	{{printf "Error: kite_core.vhd	\n"}{ exit}}
if(alcom kite_chip.vhd)	{{printf "Error: kite_chip.vhd	\n"}{ exit}}

printf "Open VHDL Files\n"
if(opn design -vhdl acc16.vhd)	{{printf "Error: acc16.vhd	\n"}{exit}}
if(opn design -vhdl alu.vhd)	{{printf "Error: alu.vhd	\n"}{exit}}
if(opn design -vhdl buf1.vhd)	{{printf "Error: buf1.vhd	\n"}{exit}}
if(opn design -vhdl buf2.vhd)	{{printf "Error: buf2.vhd	\n"}{exit}}
if(opn design -vhdl fr.vhd)	{{printf "Error: fr.vhd		\n"}{exit}}

if(add vhdl -enc OneHot -g "")	{{printf "Error: Encode OneHot	\n"}{exit}}

if(opn design -vhdl idc_seq.vhd){{printf "Error: idc_seq.vhd	\n"}{exit}}
if(opn design -vhdl ir16.vhd)	{{printf "Error: ir16.vhd	\n"}{exit}}
if(opn design -vhdl ix12.vhd)	{{printf "Error: ix12.vhd	\n"}{exit}}
if(opn design -vhdl mar12.vhd)	{{printf "Error: mar12.vhd	\n"}{exit}}
if(opn design -vhdl pc12.vhd)	{{printf "Error: pc.vhd		\n"}{exit}}
if(opn design -vhdl sp12.vhd)	{{printf "Error: sp12.vhd	\n"}{exit}}
if(opn design -vhdl kite_core.vhd){{printf "Error: kite_core.vhd\n"}{exit}}
if(opn design -vhdl kite_chip.vhd){{printf "Error: kite_chip.vhd\n"}{exit}}

printf "Set Target Technology(LCA XC4000)\n"
if(env dst xc4k/default)	{{printf "Error: env dst xc4k\n"}{exit}}

printf "Synthesis\n"
if(syn vhdl work kite_chip -arch beha)	{}{{printf "Error: syn kite_chip\n"}{exit}}

printf "Set Device Informations\n"
if(add env -custom device_number "4010" speed_grade -5 package_type "PGA" num_pins "191" temp_range "Commercial  0 to +70 C" enhanced_ce "No" macro_mapping "NONE" macro_mapping_type "AREA" sgconfig_file "PADs on top level, PORTs on other levels") {{printf "Error: Add env XC4010\n"}{exit}}

printf "Optimize\n"
if(opt area -low)	{{printf "Error: opt area\n"}{exit}}

printf "Add IO Buffers\n"
if(opt custom "add_rm_tech_io yes ()  add") {{printf "Error: add IO Buffers"}{exit}}

printf "Insert Global Buffers\n"
if(opt custom "xi_global_ins_del_top clk_only ()  insert") {{printf "Error: Insert Global Buffer\n"}{exit}}

printf "Write XNF\n"
if(opt custom "wr_xnf_nl xnf_kite/opt_nl.xnf xnf_kite/opt_nl.als no") {{printf "Error: Write XNF\n"}{exit}}

printf "Run Complete\n"
quit



