file copy -force "./src/softconsole/miv-rv32i-cxp-device.hex" "./$Prjname/miv-rv32i-cxp-device.hex"

# Import source files
import_files -library work -hdl_source ./src/hdl/word_alignment.v
import_files -library work -hdl_source ./src/hdl/slvs_frame_end_gen.v

build_design_hierarchy 

#Sourcing the Tcl files for creating individual components under the top level
source ./src/components/CORERESET_PF_C1.tcl 
source ./src/components/CorePCS_C0.tcl 
source ./src/components/PF_CCC_C1.tcl 
source ./src/components/SLVS_EC_RX_C0.tcl 
source ./src/components/IMX_TOP.tcl 
source ./src/components/PF_DRI_C0.tcl 
source ./src/components/PF_INIT_MONITOR_C0.tcl 
source ./src/components/COREAHBTOAPB3_C0.tcl 
source ./src/components/COREAXI4INTERCONNECT_C0.tcl 
source ./src/components/COREAXITOAHBL_C0.tcl 
source ./src/components/COREI2C_C0.tcl 
source ./src/components/COREJTAGDEBUG_C0.tcl 
source ./src/components/CoreAPB3_C0.tcl 
source ./src/components/CoreGPIO_C0.tcl 
source ./src/components/MIV_RV32_C0.tcl 
source ./src/components/PF_SRAM_AHBL_AXI_C0.tcl 
source ./src/components/PROC_SS.tcl 
source ./src/components/CoaXpress_TOP_C0.tcl 
source ./src/components/PF_XCVR_ERM_C0.tcl 
source ./src/components/PF_XCVR_ERM_C1.tcl 
source ./src/components/CorePCS_C1.tcl 
source ./src/components/PF_XCVR_REF_CLK_C0.tcl 
source ./src/components/PF_TX_PLL_C0.tcl 
source ./src/components/PF_CCC_C0.tcl 
source ./src/components/CXP_DEVICE_TOP.tcl 
source ./src/components/top.tcl 
build_design_hierarchy


build_design_hierarchy 

# Set top level module
build_design_hierarchy 
set_root -module {top::work} 

save_project
puts "Design generated successfully\n"
