
from litex.build.generic_platform import ConstraintError
from litex.gen import *
from litex.soc.interconnect.csr import *

from gateware.info import git
from gateware.info import dna
from gateware.info import platform as platform_info


class Info(Module, AutoCSR):
    def __init__(self, platform, platform_name, target_name):
        self.submodules.dna = dna.DNA()
        self.submodules.git = git.GitInfo()
        self.submodules.platform = platform_info.PlatformInfo(platform_name, target_name)


from litex.build.generic_platform import ConstraintError
from litex.gen import *
from litex.soc.interconnect.csr import *

from gateware.info import git
from gateware.info import dna
from gateware.info import xadc
from gateware.info import platform as platform_info


class Info(Module, AutoCSR):
    def __init__(self, platform, platform_name, target_name):
        self.submodules.dna = dna.DNA()
        self.submodules.git = git.GitInfo()
        self.submodules.platform = platform_info.PlatformInfo(platform_name, target_name)

        if "xc7" in platform.device:
            self.submodules.xadc = xadc.XADC()


Add xadc if device supports it.
gateware: Add xadc if device supports it.

  
  from litex.build.generic_platform import ConstraintError
  from litex.gen import *
  from litex.soc.interconnect.csr import *
  
  from gateware.info import git
  from gateware.info import dna
+ from gateware.info import xadc
  from gateware.info import platform as platform_info
  
  
  class Info(Module, AutoCSR):
      def __init__(self, platform, platform_name, target_name):
          self.submodules.dna = dna.DNA()
          self.submodules.git = git.GitInfo()
          self.submodules.platform = platform_info.PlatformInfo(platform_name, target_name)
  
+         if "xc7" in platform.device:
+             self.submodules.xadc = xadc.XADC()
+ 
+ 
Add xadc if device supports it.
## Code Before:

from litex.build.generic_platform import ConstraintError
from litex.gen import *
from litex.soc.interconnect.csr import *

from gateware.info import git
from gateware.info import dna
from gateware.info import platform as platform_info


class Info(Module, AutoCSR):
    def __init__(self, platform, platform_name, target_name):
        self.submodules.dna = dna.DNA()
        self.submodules.git = git.GitInfo()
        self.submodules.platform = platform_info.PlatformInfo(platform_name, target_name)

## Instruction:
Add xadc if device supports it.
## Code After:

from litex.build.generic_platform import ConstraintError
from litex.gen import *
from litex.soc.interconnect.csr import *

from gateware.info import git
from gateware.info import dna
from gateware.info import xadc
from gateware.info import platform as platform_info


class Info(Module, AutoCSR):
    def __init__(self, platform, platform_name, target_name):
        self.submodules.dna = dna.DNA()
        self.submodules.git = git.GitInfo()
        self.submodules.platform = platform_info.PlatformInfo(platform_name, target_name)

        if "xc7" in platform.device:
            self.submodules.xadc = xadc.XADC()

