# Build Local Bus Model
vcom -93 ../Models/LocalBusModel/LocalBusModelPkg.vhd
vcom -93 ../Models/LocalBusModel/LocalBusModel.vhd

# Build common components shared by multiple FPGAs
vcom -93 ../Common/src/StrobeExtender.vhd
vcom -93 ../Common/src/SpiAD.vhd
vcom -93 ../Common/src/Spi16.vhd
vcom -93 ../Common/src/i2c_master_bit_ctrl.vhd
vcom -93 ../Common/src/i2c_master_byte_ctrl.vhd

# Build System FPGA components
vcom -93 ../SystemFPGA/src/SystemMonitorPkg.vhd
vcom -93 ../SystemFPGA/src/SystemFpgaPkg.vhd
vcom -93 ../SystemFPGA/src/SysLBusInterface.vhd
vcom -93 ../SystemFPGA/src/FpgaConfig.vhd
vcom -93 ../SystemFPGA/src/SystemMonitor.vhd
vcom -93 ../SystemFPGA/src/SystemFpgaTop.vhd

# Build DSP FPGA components
vcom -93 ../DspFPGA/src/DspFpgaPkg.vhd
vcom -93 ../DspFPGA/src/DataRectifier.vhd
vcom -93 ../DspFPGA/src/TriggerGenerator.vhd
vcom -93 ../DspFPGA/src/InterfaceGate.vhd
vcom -93 ../DspFPGA/src/Gate.vhd
vcom -93 ../DspFPGA/src/GateResultSelect.vhd
vcom -93 ../DspFPGA/src/BeaSwitch.vhd
vcom -93 ../DspFPGA/src/SIPOCtrl.vhd
vcom -93 ../DspFPGA/src/DspLBusInterface.vhd
vcom -93 ../DspFPGA/src/SyncPulse.vhd
vcom -93 ../DspFPGA/src/RamWriteCtrl.vhd
vcom -93 ../DspFPGA/src/RamArbitrate.vhd

vcom -93 ../DspFPGA/src/CalControl.vhd
vcom -93 ../DspFPGA/src/ClkRst.vhd
vcom -93 ../DspFPGA/src/Ddr2State.vhd
vcom -93 ../DspFPGA/src/Ddr2IO.vhd
vcom -93 ../DspFPGA/src/Ddr2FifoWrEn0.vhd
vcom -93 ../DspFPGA/src/Ddr2FifoWrEn1.vhd
vcom -93 ../DspFPGA/src/GrayCounter4BitRd.vhd
vcom -93 ../DspFPGA/src/GrayCounter4BitWr.vhd
vcom -93 ../DspFPGA/src/Ddr2DataPath.vhd
vcom -93 ../DspFPGA/src/DqsDelay.vhd
vcom -93 ../DspFPGA/src/TapDelay.vhd
vcom -93 ../DspFPGA/src/SDRAMRefresh.vhd
vcom -93 ../DspFPGA/src/SPDRead.vhd
vcom -93 ../DspFPGA/src/SDRAMIf.vhd

vcom -93 ../DspFPGA/src/TCGControl.vhd
vcom -93 ../DspFPGA/src/EncoderCounter.vhd
vcom -93 ../DspFPGA/src/DspFpgaTop.vhd

# Build models
vcom -93 ../Models/AD9230/AdcModelPkg.vhd
vcom -93 ../Models/AD5621/AD5621.vhd
vcom -93 ../Models/AD9230/AdcTest.vhd
vcom -93 ../Models/AD9230/AD9230.vhd
vcom -93 ../Models/ADC128S022/ADC128S022.vhd
vcom -93 ../Models/AD7314/AD7314.vhd
vcom -93 ../Models/HC595/HC595.vhd
vcom -93 ../Models/AD9742/AD9742.vhd
vcom -93 ../Models/SPD_EEPROM/SPD_EEPROM.vhd

vlog  ../Models/IDT71V416S/idt71v416s10.v

# Build 1GByte SODIMM RAM model
vlog +define+sg5 +define+x8 +incdir+../Models/DDR2_DIMM ../Models/DDR2_DIMM/ddr2.v
vlog +incdir+../Models/DDR2_DIMM ../Models/DDR2_DIMM/ddr2_sodimm.v
# or for 2GByte SODIMM
#vlog +define+sg5 +define+x8 +define+SODIMM2G +incdir+../Models/DDR2_DIMM ../Models/DDR2_DIMM/ddr2.v
#vlog +define+SODIMM2G +incdir+../Models/DDR2_DIMM ../Models/DDR2_DIMM/ddr2_sodimm.v


# Build Simulation control common entity
vcom -93 ../Testbench/SimCtrl.vhd
