def testReporter(self):
     project = Project()
     XmlProjectParser.load_project(self.project_path, project)
     # Check the synthesis reporter
     self.assertTrue(
         callable(project.get_reporter())
     )
Example #2
0
 def testGenerics(self):
     project = Project()
     XmlProjectParser.load_project(self.project_path, project)
     # Check the synthesis generics
     self.assertDictEqual(
         self.project_generics,
         project.get_generics(),
     )
Example #3
0
 def testProjectConstraints(self):
     project = Project()
     XmlProjectParser.load_project(self.project_path, project)
     # Check the project constraints
     self.assertEqual(
         self.project_constraints,
         [os.path.basename(c.path) for c in project.get_constraints()],
     )
 def testSimulationDirectory(self):
     project = Project()
     XmlProjectParser.load_project(self.project_path, project)
     abs_path = os.path.join(
         os.path.abspath(self.root),
         self.simulation_directory
     )
     self.assertEqual(project.get_simulation_directory(), abs_path)
 def testProjectPart(self):
     project = Project()
     XmlProjectParser.load_project(self.project_path, project)
     # Check project part
     self.assertEqual(
         self.project_part,
         project.get_fpga_part()
     )
 def testSimulationToolName(self):
     project = Project()
     XmlProjectParser.load_project(self.project_path, project)
     # Check simulation tool name
     self.assertEqual(
         self.simulation_tool_name,
         project.get_simulation_tool_name()
     )
 def testSynthesisToolName(self):
     project = Project()
     XmlProjectParser.load_project(self.project_path, project)
     # Check synthesis tool name
     self.assertEqual(
         self.synthesis_tool_name,
         project.get_synthesis_tool_name()
     )
 def testProjectConstraints(self):
     project = Project()
     XmlProjectParser.load_project(self.project_path, project)
     # Check the project constraints
     self.assertEqual(
         self.project_constraints,
         [os.path.basename(c.path) for c in project.get_constraints()],
     )
 def testGenerics(self):
     project = Project()
     XmlProjectParser.load_project(self.project_path, project)
     # Check the synthesis generics
     self.assertDictEqual(
         self.project_generics,
         project.get_generics(),
     )
Example #10
0
 def testPreprocessor(self):
     project = Project()
     XmlProjectParser.load_project(self.project_path, project)
     files = project.get_files()
     preprocessors = list(
         filter(lambda x: os.path.exists(x.preprocessor), files))
     self.assertTrue(len(preprocessors) > 0)
     project.run_preprocessors()
 def testPreprocessor(self):
     project = Project()
     XmlProjectParser.load_project(self.project_path, project)
     files = project.get_files()
     preprocessors = list(
         filter(
             lambda x: os.path.exists(x.preprocessor), files
         )
     )
     self.assertTrue(len(preprocessors) > 0)
     project.run_preprocessors()
Example #12
0
    def testFileSet(self):
        project = Project()
        XmlProjectParser.load_project(self.project_path, project)
        # Check the file set loaded from the project
        expected_files = []
        for libname in self.project_structure.keys():
            files = self.project_structure[libname]
            for path in files:
                expected_files.append(os.path.basename(path))

        self.assertEqual(
            sorted(expected_files),
            sorted([os.path.basename(f.path) for f in project.get_files()]),
        )
Example #13
0
 def do_load_project(self, path):
     """Load the given project XML file: load_project <path_to_project>"""
     path = os.path.abspath(path)
     if os.path.exists(path) and os.path.isfile(path):
         try:
             log.info(
                 'Loading {0} in current working directory: {1}'.format(
                     path, os.getcwd()))
             XmlProjectParser.load_project(path, self.project)
         except:
             log.error('The project could not be loaded due to an error:')
             log.error(traceback.format_exc())
     else:
         log.error('File not found: {0}'.format(path))
    def testFileSet(self):
        project = Project()
        XmlProjectParser.load_project(self.project_path, project)
        # Check the file set loaded from the project
        expected_files = []
        for libname in self.project_structure.keys():
            files = self.project_structure[libname]
            for path in files:
                expected_files.append(os.path.basename(path))

        self.assertEqual(
            sorted(expected_files),
            sorted([os.path.basename(f.path) for f in project.get_files()]),
        )
Example #15
0
 def do_load_project(self, path):
     """Load the given project XML file: load_project <path_to_project>"""
     path = os.path.abspath(path)
     if os.path.exists(path) and os.path.isfile(path):
         try:
             log.info(
                 'Loading {0} in current working directory: {1}'.format(
                     path,
                     os.getcwd()
                 )
             )
             XmlProjectParser.load_project(path, self.project)
         except:
             log.error('The project could not be loaded due to an error:')
             log.error(traceback.format_exc())
     else:
         log.error('File not found: {0}'.format(path))
Example #16
0
 def locateProjects(self):
     """
     Return a list of projects found in the current path.
     """
     projects = []
     logging.getLogger("chiptools").setLevel(logging.CRITICAL)
     for filePath in os.listdir(os.getcwd()):
         if filePath.endswith('.xml'):
             try:
                 tempProject = Project()
                 # Load the XML file
                 XmlProjectParser.load_project(filePath, tempProject)
                 # If the project contains files we can add it to our list
                 files = tempProject.get_files()
                 files = files if files is not None else []
                 if len(files) != 0:
                     projects.append(filePath)
             except:
                 pass
     logging.getLogger("chiptools").setLevel(logging.INFO)
     return projects
Example #17
0
 def locateProjects(self):
     """
     Return a list of projects found in the current path.
     """
     projects = []
     logging.getLogger("chiptools").setLevel(
         logging.CRITICAL
     )
     for filePath in os.listdir(os.getcwd()):
         if filePath.endswith('.xml'):
             try:
                 tempProject = Project()
                 # Load the XML file
                 XmlProjectParser.load_project(filePath, tempProject)
                 # If the project contains files we can add it to our list
                 files = tempProject.get_files()
                 files = files if files is not None else []
                 if len(files) != 0:
                     projects.append(filePath)
             except:
                 pass
     logging.getLogger("chiptools").setLevel(logging.INFO)
     return projects
Example #18
0
 def testReporter(self):
     project = Project()
     XmlProjectParser.load_project(self.project_path, project)
     # Check the synthesis reporter
     self.assertTrue(callable(project.get_reporter()))
Example #19
0
 def testSimulationDirectory(self):
     project = Project()
     XmlProjectParser.load_project(self.project_path, project)
     abs_path = os.path.join(os.path.abspath(self.root),
                             self.simulation_directory)
     self.assertEqual(project.get_simulation_directory(), abs_path)
Example #20
0
 def testProjectLoad(self):
     project = Project()
     XmlProjectParser.load_project(self.project_path, project)
Example #21
0
 def testProjectPart(self):
     project = Project()
     XmlProjectParser.load_project(self.project_path, project)
     # Check project part
     self.assertEqual(self.project_part, project.get_fpga_part())
Example #22
0
 def testSimulationToolName(self):
     project = Project()
     XmlProjectParser.load_project(self.project_path, project)
     # Check simulation tool name
     self.assertEqual(self.simulation_tool_name,
                      project.get_simulation_tool_name())
 def testProjectLoad(self):
     project = Project()
     XmlProjectParser.load_project(self.project_path, project)
Example #24
0
 def testSynthesisToolName(self):
     project = Project()
     XmlProjectParser.load_project(self.project_path, project)
     # Check synthesis tool name
     self.assertEqual(self.synthesis_tool_name,
                      project.get_synthesis_tool_name())