################################################################################
# Main tcl for the module
################################################################################

# ==============================================================================
proc init {} {
    variable Config

    # Parse configuration from VHDL package
    parseVhdlConfigFile Config "../hdl/pkg_corr_matrixpi.vhd"
}

# ==============================================================================
proc setSources {} {
  variable Sources

  # Generate VHDL package with modversion
  genModVerFile VHDL ../hdl/pkg_corr_matrixpi_version.vhd

  lappend Sources {"../hdl/pkg_corr_matrixpi_version.vhd" "VHDL"}
  lappend Sources {"../hdl/pkg_corr_matrixpi.vhd" "VHDL 2008"}
  lappend Sources {"../hdl/corr_pi.vhd" "VHDL 2008"}
  lappend Sources {"../hdl/matrix_mul.vhd" "VHDL 2008"}
  lappend Sources {"../hdl/orbit_error.vhd" "VHDL 2008"}
  lappend Sources {"../hdl/data_serializer.vhd" "VHDL 2008"}
  lappend Sources {"../hdl/top_corr_matrixpi.vhd" "VHDL 2008"}
  lappend Sources [list "${::fwfwk::LibPath}/desy_vhdl/hdl/memory/ram/ram_tdp.vhd" "VHDL 2008" "desy"]
  lappend Sources [list "${::fwfwk::LibPath}/desy_vhdl/hdl/math/pkg_math_signed.vhd" "VHDL 2008" "desy"]
}

# ==============================================================================
proc setAddressSpace {} {
    variable AddressSpace
    addAddressSpace AddressSpace "corr_matrixpi" RDL {} ../rdl/corr_matrixpi.rdl
}

# ==============================================================================
proc doOnCreate {} {
  variable Sources
  addSources "Sources"
}

# ==============================================================================
proc doOnBuild {} {
}

# ==============================================================================
proc setSim {} {
}